Add device number support

master
Vitaliy Filippov 3 months ago
parent f54cd84222
commit 76071bba22
  1. 5
      conversions.go
  2. 3
      fuseops/ops.go
  3. 3
      fuseops/simple_types.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

@ -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

@ -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

Loading…
Cancel
Save