Commit 549c0c90 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: print tweaks for passthrough support

Change-Id: I513d6344ff0d22649c240bbf31ef901dca70f4e2
parent f0fd3eaf
...@@ -35,7 +35,9 @@ func (ms *Server) RegisterBackingFd(fd int, flags uint32) (int32, syscall.Errno) ...@@ -35,7 +35,9 @@ func (ms *Server) RegisterBackingFd(fd int, flags uint32) (int32, syscall.Errno)
ms.writeMu.Lock() ms.writeMu.Lock()
id, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(ms.mountFd), uintptr(_DEV_IOC_BACKING_OPEN), uintptr(unsafe.Pointer(&m))) id, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(ms.mountFd), uintptr(_DEV_IOC_BACKING_OPEN), uintptr(unsafe.Pointer(&m)))
ms.writeMu.Unlock() ms.writeMu.Unlock()
if ms.opts.Debug {
ms.opts.Logger.Printf("ioctl: BACKING_OPEN %d (flags %x): id %d (%v)", fd, flags, id, errno)
}
return int32(id), errno return int32(id), errno
} }
...@@ -43,8 +45,11 @@ func (ms *Server) RegisterBackingFd(fd int, flags uint32) (int32, syscall.Errno) ...@@ -43,8 +45,11 @@ func (ms *Server) RegisterBackingFd(fd int, flags uint32) (int32, syscall.Errno)
// should have been acquired before using RegisterBackingFd. // should have been acquired before using RegisterBackingFd.
func (ms *Server) UnregisterBackingFd(id int32) syscall.Errno { func (ms *Server) UnregisterBackingFd(id int32) syscall.Errno {
ms.writeMu.Lock() ms.writeMu.Lock()
_, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(ms.mountFd), uintptr(_DEV_IOC_BACKING_CLOSE), uintptr(unsafe.Pointer(&id))) _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(ms.mountFd), uintptr(_DEV_IOC_BACKING_CLOSE), uintptr(unsafe.Pointer(&id)))
ms.writeMu.Unlock() ms.writeMu.Unlock()
return ep if ms.opts.Debug {
ms.opts.Logger.Printf("ioctl: BACKING_CLOSE id %d: %v", id, errno)
}
return errno
} }
...@@ -215,7 +215,7 @@ func (in *OpenOut) string() string { ...@@ -215,7 +215,7 @@ func (in *OpenOut) string() string {
if in.BackingID != 0 { if in.BackingID != 0 {
backing = fmt.Sprintf("backing=%d ", in.BackingID) backing = fmt.Sprintf("backing=%d ", in.BackingID)
} }
return fmt.Sprintf("{Fh %d %s %s}", in.Fh, backing, return fmt.Sprintf("{Fh %d %s%s}", in.Fh, backing,
flagString(fuseOpenFlagNames, int64(in.OpenFlags), "")) flagString(fuseOpenFlagNames, int64(in.OpenFlags), ""))
} }
......
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