diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-05-12 20:28:06 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-12 20:28:06 +0000 |
commit | 0bf9a1ff877824eacb9df300f67def0babb20c9d (patch) | |
tree | 73750c067b12c71837c8bff28ff698b707774bf4 /pkg/sentry/fsimpl/tmpfs | |
parent | aadafcd285f6b78127bca5b6b7fa6b0c5abcc2da (diff) | |
parent | 07e32fa6967370ef29327417fd941c5130335fbc (diff) |
Merge release-20210503.0-47-g07e32fa69 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/tmpfs')
-rw-r--r-- | pkg/sentry/fsimpl/tmpfs/inode_refs.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/tmpfs/inode_refs.go b/pkg/sentry/fsimpl/tmpfs/inode_refs.go index a30d79603..d333bb742 100644 --- a/pkg/sentry/fsimpl/tmpfs/inode_refs.go +++ b/pkg/sentry/fsimpl/tmpfs/inode_refs.go @@ -20,6 +20,14 @@ var inodeobj *inode // Refs implements refs.RefCounter. It keeps a reference count using atomic // operations and calls the destructor when the count reaches zero. // +// NOTE: Do not introduce additional fields to the Refs struct. It is used by +// many filesystem objects, and we want to keep it as small as possible (i.e., +// the same size as using an int64 directly) to avoid taking up extra cache +// space. In general, this template should not be extended at the cost of +// performance. If it does not offer enough flexibility for a particular object +// (example: b/187877947), we should implement the RefCounter/CheckedObject +// interfaces manually. +// // +stateify savable type inodeRefs struct { // refCount is composed of two fields: |