Commit 90eabd70 authored by lch's avatar lch Committed by Han-Wen Nienhuys

fs: separate integer conversion for different os

Change-Id: I8ff8e8dc9431b5af52e3ca8e78f0da73cead9008
parent 6e330dd3
...@@ -123,7 +123,7 @@ var _ = (NodeMknoder)((*LoopbackNode)(nil)) ...@@ -123,7 +123,7 @@ var _ = (NodeMknoder)((*LoopbackNode)(nil))
func (n *LoopbackNode) Mknod(ctx context.Context, name string, mode, rdev uint32, out *fuse.EntryOut) (*Inode, syscall.Errno) { func (n *LoopbackNode) Mknod(ctx context.Context, name string, mode, rdev uint32, out *fuse.EntryOut) (*Inode, syscall.Errno) {
p := filepath.Join(n.path(), name) p := filepath.Join(n.path(), name)
err := syscall.Mknod(p, mode, int(rdev)) err := syscall.Mknod(p, mode, intDev(rdev))
if err != nil { if err != nil {
return nil, ToErrno(err) return nil, ToErrno(err)
} }
......
...@@ -123,3 +123,7 @@ func (n *LoopbackNode) CopyFileRange(ctx context.Context, fhIn FileHandle, ...@@ -123,3 +123,7 @@ func (n *LoopbackNode) CopyFileRange(ctx context.Context, fhIn FileHandle,
len uint64, flags uint64) (uint32, syscall.Errno) { len uint64, flags uint64) (uint32, syscall.Errno) {
return 0, syscall.ENOSYS return 0, syscall.ENOSYS
} }
func intDev(dev uint32) int {
return int(dev)
}
...@@ -61,3 +61,7 @@ func (n *LoopbackNode) CopyFileRange(ctx context.Context, fhIn FileHandle, ...@@ -61,3 +61,7 @@ func (n *LoopbackNode) CopyFileRange(ctx context.Context, fhIn FileHandle,
count, err := unix.CopyFileRange(lfIn.fd, &signedOffIn, lfOut.fd, &signedOffOut, int(len), int(flags)) count, err := unix.CopyFileRange(lfIn.fd, &signedOffIn, lfOut.fd, &signedOffOut, int(len), int(flags))
return uint32(count), ToErrno(err) return uint32(count), ToErrno(err)
} }
func intDev(dev uint32) int {
return int(dev)
}
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