Added time info.
parent
5514405606
commit
1750a271f5
|
@ -90,8 +90,11 @@ const RootInodeID InodeID = InodeID(bazilfuse.RootID)
|
||||||
// Attributes for a file or directory inode. Corresponds to struct inode (cf.
|
// Attributes for a file or directory inode. Corresponds to struct inode (cf.
|
||||||
// http://goo.gl/tvYyQt).
|
// http://goo.gl/tvYyQt).
|
||||||
type InodeAttributes struct {
|
type InodeAttributes struct {
|
||||||
Size uint64
|
Size uint64
|
||||||
Mode os.FileMode
|
Mode os.FileMode
|
||||||
|
Atime time.Time
|
||||||
|
Mtime time.Time
|
||||||
|
Crtime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// A generation number for an inode. Irrelevant for file systems that won't be
|
// A generation number for an inode. Irrelevant for file systems that won't be
|
||||||
|
|
|
@ -139,6 +139,12 @@ func (fs *HelloFS) LookUpInode(
|
||||||
resp.Child = childInode
|
resp.Child = childInode
|
||||||
resp.Attributes = gInodeInfo[childInode].attributes
|
resp.Attributes = gInodeInfo[childInode].attributes
|
||||||
|
|
||||||
|
// Patch attributes.
|
||||||
|
now := fs.Clock.Now()
|
||||||
|
resp.Attributes.Atime = now
|
||||||
|
resp.Attributes.Mtime = now
|
||||||
|
resp.Attributes.Crtime = now
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +164,12 @@ func (fs *HelloFS) GetInodeAttributes(
|
||||||
// Copy over its attributes.
|
// Copy over its attributes.
|
||||||
resp.Attributes = info.attributes
|
resp.Attributes = info.attributes
|
||||||
|
|
||||||
|
// Patch attributes.
|
||||||
|
now := fs.Clock.Now()
|
||||||
|
resp.Attributes.Atime = now
|
||||||
|
resp.Attributes.Mtime = now
|
||||||
|
resp.Attributes.Crtime = now
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,8 +206,11 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
|
||||||
|
|
||||||
func convertAttributes(inode InodeID, attr InodeAttributes) bazilfuse.Attr {
|
func convertAttributes(inode InodeID, attr InodeAttributes) bazilfuse.Attr {
|
||||||
return bazilfuse.Attr{
|
return bazilfuse.Attr{
|
||||||
Inode: uint64(inode),
|
Inode: uint64(inode),
|
||||||
Size: attr.Size,
|
Size: attr.Size,
|
||||||
Mode: attr.Mode,
|
Mode: attr.Mode,
|
||||||
|
Atime: attr.Atime,
|
||||||
|
Mtime: attr.Mtime,
|
||||||
|
Crtime: attr.Crtime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue