Mark some kernfs inode as Anonymous.

These inodes can never be part of a filesystem tree. They are nameless and
never have a parent.

This allows us to avoid taking a lock in kernfs.InotifyWithParent for such
anonymous inodes.

PiperOrigin-RevId: 538823227
This commit is contained in:
Nicolas Lacasse
2023-06-08 10:25:04 -07:00
committed by gVisor bot
parent 5fed8c81b8
commit 8c975e6e6e
23 changed files with 71 additions and 10 deletions
+2 -1
View File
@@ -94,10 +94,11 @@ func isEpollable(fd int) bool {
//
// +stateify savable
type inode struct {
kernfs.CachedMappable
kernfs.InodeNoStatFS
kernfs.InodeAnonymous // inode is effectively anonymous because it represents a donated FD.
kernfs.InodeNotDirectory
kernfs.InodeNotSymlink
kernfs.CachedMappable
kernfs.InodeTemporary // This holds no meaning as this inode can't be Looked up and is always valid.
kernfs.InodeWatches