Add device number support
parent
f54cd84222
commit
76071bba22
|
@ -191,6 +191,7 @@ func convertInMessage(
|
||||||
Parent: fuseops.InodeID(inMsg.Header().Nodeid),
|
Parent: fuseops.InodeID(inMsg.Header().Nodeid),
|
||||||
Name: string(name),
|
Name: string(name),
|
||||||
Mode: convertFileMode(in.Mode),
|
Mode: convertFileMode(in.Mode),
|
||||||
|
Rdev: in.Rdev,
|
||||||
OpContext: fuseops.OpContext{Pid: inMsg.Header().Pid},
|
OpContext: fuseops.OpContext{Pid: inMsg.Header().Pid},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -925,6 +926,10 @@ func convertAttributes(
|
||||||
if in.Mode&os.ModeSticky != 0 {
|
if in.Mode&os.ModeSticky != 0 {
|
||||||
out.Mode |= syscall.S_ISVTX
|
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
|
// Convert an absolute cache expiration time to a relative time from now for
|
||||||
|
|
|
@ -301,6 +301,9 @@ type MkNodeOp struct {
|
||||||
Name string
|
Name string
|
||||||
Mode os.FileMode
|
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.
|
// Set by the file system: information about the inode that was created.
|
||||||
//
|
//
|
||||||
// The lookup count for the inode is implicitly incremented. See notes on
|
// The lookup count for the inode is implicitly incremented. See notes on
|
||||||
|
|
|
@ -87,6 +87,9 @@ type InodeAttributes struct {
|
||||||
//
|
//
|
||||||
Mode os.FileMode
|
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.
|
// Time information. See `man 2 stat` for full details.
|
||||||
Atime time.Time // Time of last access
|
Atime time.Time // Time of last access
|
||||||
Mtime time.Time // Time of last modification
|
Mtime time.Time // Time of last modification
|
||||||
|
|
Loading…
Reference in New Issue