Deallocate removed directories.
parent
3076da562e
commit
d8905b0d05
|
@ -169,6 +169,12 @@ func (fs *memFS) allocateInode(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EXCLUSIVE_LOCKS_REQUIRED(fs.mu)
|
||||||
|
func (fs *memFS) deallocateInode(id fuse.InodeID) {
|
||||||
|
fs.freeInodes = append(fs.freeInodes, id)
|
||||||
|
fs.inodes[id] = nil
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// FileSystem methods
|
// FileSystem methods
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -326,8 +332,9 @@ func (fs *memFS) RmDir(
|
||||||
// Remove the entry within the parent.
|
// Remove the entry within the parent.
|
||||||
parent.RemoveChild(req.Name)
|
parent.RemoveChild(req.Name)
|
||||||
|
|
||||||
// TODO(jacobsa): Remove the child when it's forgotten. (Can we get a failing
|
// TODO(jacobsa): Don't remove the child until it's forgotten. Can we get a
|
||||||
// test by looking at inode ID allocation?)
|
// failing test by continuing to read from an opened dir handle?
|
||||||
|
fs.deallocateInode(childID)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue