diff --git a/conversions.go b/conversions.go index 86aa7e9..fe9648c 100644 --- a/conversions.go +++ b/conversions.go @@ -191,6 +191,7 @@ func convertInMessage( Parent: fuseops.InodeID(inMsg.Header().Nodeid), Name: string(name), Mode: convertFileMode(in.Mode), + Rdev: in.Rdev, OpContext: fuseops.OpContext{Pid: inMsg.Header().Pid}, } @@ -925,6 +926,10 @@ func convertAttributes( if in.Mode&os.ModeSticky != 0 { out.Mode |= syscall.S_ISVTX } + + if out.Mode & (syscall.S_IFCHR | syscall.S_IFBLK) != 0 { + out.Rdev = in.Rdev + } } // Convert an absolute cache expiration time to a relative time from now for diff --git a/fuseops/ops.go b/fuseops/ops.go index 470f256..4b5db51 100644 --- a/fuseops/ops.go +++ b/fuseops/ops.go @@ -301,6 +301,9 @@ type MkNodeOp struct { Name string Mode os.FileMode + // The device number (only valid if created file is a device) + Rdev uint32 + // Set by the file system: information about the inode that was created. // // The lookup count for the inode is implicitly incremented. See notes on diff --git a/fuseops/simple_types.go b/fuseops/simple_types.go index f1c8149..5c6b9ca 100644 --- a/fuseops/simple_types.go +++ b/fuseops/simple_types.go @@ -87,6 +87,9 @@ type InodeAttributes struct { // Mode os.FileMode + // The device number. Only valid if the file is a device + Rdev uint32 + // Time information. See `man 2 stat` for full details. Atime time.Time // Time of last access Mtime time.Time // Time of last modification