summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/mount_unsafe.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-02-14 13:39:51 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-14 13:40:39 -0800
commite4c7f3e6f6c19f3259820a4c41b69e85c0454379 (patch)
treec63b9ac4d97a715a226feba4fbbd5cab03bb6743 /pkg/sentry/vfs/mount_unsafe.go
parent50c493193b72997a6b09f353fd9217349941c494 (diff)
Inline vfs.VirtualFilesystem in Kernel struct
This saves one pointer dereference per VFS access. Updates #1623 PiperOrigin-RevId: 295216176
Diffstat (limited to 'pkg/sentry/vfs/mount_unsafe.go')
-rw-r--r--pkg/sentry/vfs/mount_unsafe.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/sentry/vfs/mount_unsafe.go b/pkg/sentry/vfs/mount_unsafe.go
index bd90d36c4..1fe766a44 100644
--- a/pkg/sentry/vfs/mount_unsafe.go
+++ b/pkg/sentry/vfs/mount_unsafe.go
@@ -64,6 +64,8 @@ func (mnt *Mount) storeKey(vd VirtualDentry) {
// (provided mutation is sufficiently uncommon).
//
// mountTable.Init() must be called on new mountTables before use.
+//
+// +stateify savable
type mountTable struct {
// mountTable is implemented as a seqcount-protected hash table that
// resolves collisions with linear probing, featuring Robin Hood insertion
@@ -75,8 +77,8 @@ type mountTable struct {
// intrinsics and inline assembly, limiting the performance of this
// approach.)
- seq sync.SeqCount
- seed uint32 // for hashing keys
+ seq sync.SeqCount `state:"nosave"`
+ seed uint32 // for hashing keys
// size holds both length (number of elements) and capacity (number of
// slots): capacity is stored as its base-2 log (referred to as order) in
@@ -89,7 +91,7 @@ type mountTable struct {
// length and cap in separate uint32s) for ~free.
size uint64
- slots unsafe.Pointer // []mountSlot; never nil after Init
+ slots unsafe.Pointer `state:"nosave"` // []mountSlot; never nil after Init
}
type mountSlot struct {