Commit e00427dc authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Move LoopbackFile.Allocate to linux specific code.

parent e90b7f3a
......@@ -193,16 +193,6 @@ func (f *LoopbackFile) GetAttr(a *Attr) Status {
return OK
}
func (f *LoopbackFile) Allocate(off uint64, sz uint64, mode uint32) Status {
f.lock.Lock()
err := syscall.Fallocate(int(f.File.Fd()), mode, int64(off), int64(sz))
f.lock.Unlock()
if err != nil {
return ToStatus(err)
}
return OK
}
////////////////////////////////////////////////////////////////
// ReadOnlyFile is a wrapper that denies writable operations
......
package fuse
import (
"syscall"
)
func (f *LoopbackFile) Allocate(off uint64, sz uint64, mode uint32) Status {
f.lock.Lock()
err := syscall.Fallocate(int(f.File.Fd()), mode, int64(off), int64(sz))
f.lock.Unlock()
if err != nil {
return ToStatus(err)
}
return OK
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment