Support changing mode.
parent
f10dc3e5ee
commit
13335f6e9b
|
@ -281,7 +281,7 @@ func (fs *memFS) SetInodeAttributes(
|
|||
defer inode.mu.Unlock()
|
||||
|
||||
// Handle the request.
|
||||
inode.SetAttributes(req.Size)
|
||||
inode.SetAttributes(req.Size, req.Mode)
|
||||
|
||||
// Fill in the response.
|
||||
resp.Attributes = inode.attributes
|
||||
|
|
|
@ -373,7 +373,7 @@ func (inode *inode) WriteAt(p []byte, off int64) (n int, err error) {
|
|||
// Update attributes from non-nil parameters.
|
||||
//
|
||||
// EXCLUSIVE_LOCKS_REQUIRED(inode.mu)
|
||||
func (inode *inode) SetAttributes(size *uint64) {
|
||||
func (inode *inode) SetAttributes(size *uint64, mode *os.FileMode) {
|
||||
// Update the modification time.
|
||||
inode.attributes.Mtime = inode.clock.Now()
|
||||
|
||||
|
@ -392,4 +392,9 @@ func (inode *inode) SetAttributes(size *uint64) {
|
|||
// Update attributes.
|
||||
inode.attributes.Size = *size
|
||||
}
|
||||
|
||||
// Change mode?
|
||||
if mode != nil {
|
||||
inode.attributes.Mode = *mode
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue