Commit 826e9def authored by Aaron Jacobs's avatar Aaron Jacobs

Implemented memFS.SetInodeAttributes.

parent 08afae57
......@@ -267,6 +267,32 @@ func (fs *memFS) GetInodeAttributes(
return
}
func (fs *memFS) SetInodeAttributes(
ctx context.Context,
req *fuse.SetInodeAttributesRequest) (
resp *fuse.SetInodeAttributesResponse, err error) {
resp = &fuse.SetInodeAttributesResponse{}
fs.mu.RLock()
defer fs.mu.RUnlock()
// Grab the inode.
inode := fs.getInodeForModifyingOrDie(req.Inode)
defer inode.mu.Unlock()
// Handle the request.
inode.SetAttributes(req.Size)
// Fill in the response.
resp.Attributes = inode.attributes
// We don't spontaneously mutate, so the kernel can cache as long as it wants
// (since it also handles invalidation).
resp.AttributesExpiration = fs.clock.Now().Add(365 * 24 * time.Hour)
return
}
func (fs *memFS) MkDir(
ctx context.Context,
req *fuse.MkDirRequest) (resp *fuse.MkDirResponse, err error) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment