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
+1
View File
@@ -150,6 +150,7 @@ type rootInode struct {
kernfs.InodeAlwaysValid
kernfs.InodeAttrs
kernfs.InodeDirectoryNoNewChildren
kernfs.InodeNotAnonymous
kernfs.InodeNotSymlink
kernfs.InodeTemporary // This holds no meaning as this inode can't be Looked up and is always valid.
kernfs.InodeWatches
+1
View File
@@ -36,6 +36,7 @@ type masterInode struct {
implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeNotAnonymous
kernfs.InodeNotDirectory
kernfs.InodeNotSymlink
kernfs.InodeWatches
+1
View File
@@ -35,6 +35,7 @@ type replicaInode struct {
implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeNotAnonymous
kernfs.InodeNotDirectory
kernfs.InodeNotSymlink
kernfs.InodeWatches