Added FileSystem.SetInodeAttributes.

geesefs-0-30-9
Aaron Jacobs 2015-03-06 05:45:17 +11:00
parent 720e853031
commit 632b1e6120
2 changed files with 34 additions and 1 deletions

View File

@ -57,6 +57,14 @@ type FileSystem interface {
ctx context.Context,
req *GetInodeAttributesRequest) (*GetInodeAttributesResponse, error)
// Change attributes for an inode.
//
// The kernel calls this for obvious cases like chmod(2), and for less
// obvious cases like ftrunctate(2).
SetInodeAttributes(
ctx context.Context,
req *SetInodeAttributesRequest) (*SetInodeAttributesResponse, error)
// Forget an inode ID previously issued (e.g. by LookUpInode or MkDir). The
// kernel calls this when removing an inode from its internal caches.
ForgetInode(
@ -413,7 +421,24 @@ type GetInodeAttributesRequest struct {
type GetInodeAttributesResponse struct {
// Attributes for the inode, and the time at which they should expire. See
// notes on LookUpInodeResponse.AttributesExpiration for more.
// notes on ChildInodeEntry.AttributesExpiration for more.
Attributes InodeAttributes
AttributesExpiration time.Time
}
type SetInodeAttributesRequest struct {
Header RequestHeader
// The inode of interest.
Inode InodeID
// The attributes to modify, or nil for attributes that don't need a change.
Size *uint64
}
type SetInodeAttributesResponse struct {
// The new attributes for the inode, and the time at which they should
// expire. See notes on ChildInodeEntry.AttributesExpiration for more.
Attributes InodeAttributes
AttributesExpiration time.Time
}

View File

@ -856,3 +856,11 @@ func (t *MemFSTest) ReadsPastEndOfFile() {
ExpectEq(0, n)
ExpectEq("", string(buf[:n]))
}
func (t *MemFSTest) Chmod() {
AssertTrue(false, "TODO")
}
func (t *MemFSTest) Chtimes() {
AssertTrue(false, "TODO")
}