diff options
author | Jakob Unterwurzacher | 2016-07-03 19:14:12 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-07-03 19:18:34 +0200 |
commit | 9b725c15cf50cfb85ec6ec88c47843092775dedc (patch) | |
tree | 3fd5f651428e48cdd8485389c81de467d9e5d9a0 /internal/fusefrontend/file.go | |
parent | c9a472c12ff08a6481c086c791f3005e81dbbcf1 (diff) |
syscallcompat: OSX: add Fallocate and Openat wrappers
...and convert all calls to syscall.{Fallocate,Openat}
to syscallcompat .
Both syscalls are not available on OSX. We emulate Openat and just
return EOPNOTSUPP for Fallocate.
Diffstat (limited to 'internal/fusefrontend/file.go')
-rw-r--r-- | internal/fusefrontend/file.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index f0e0c41..b9bb2c9 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -101,7 +101,7 @@ func (f *file) createHeader() error { buf := h.Pack() // Prevent partially written (=corrupt) header by preallocating the space beforehand - err := syscallcompat.Prealloc(int(f.fd.Fd()), 0, contentenc.HEADER_LEN) + err := syscallcompat.EnospcPrealloc(int(f.fd.Fd()), 0, contentenc.HEADER_LEN) if err != nil { tlog.Warn.Printf("ino%d: createHeader: prealloc failed: %s\n", f.ino, err.Error()) return err @@ -262,7 +262,7 @@ func (f *file) doWrite(data []byte, off int64) (uint32, fuse.Status) { f.ino, uint64(len(blockData))-f.contentEnc.BlockOverhead(), b.BlockNo) // Prevent partially written (=corrupt) blocks by preallocating the space beforehand - err := syscallcompat.Prealloc(int(f.fd.Fd()), int64(blockOffset), int64(len(blockData))) + err := syscallcompat.EnospcPrealloc(int(f.fd.Fd()), int64(blockOffset), int64(len(blockData))) if err != nil { tlog.Warn.Printf("ino%d fh%d: doWrite: prealloc failed: %s", f.ino, f.intFd(), err.Error()) status = fuse.ToStatus(err) |