diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-12-07 17:27:46 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-07 17:27:46 +0000 |
commit | ea3706565d2b8dfe5d6c6fb0302d36b74b6b81a9 (patch) | |
tree | 1bdd771b33dce2dda0ff060ceec2954c1f3e4e28 /pkg/p9/server.go | |
parent | 3b58a0d9e1abd69df19c6a7845ea839c001e9f17 (diff) | |
parent | b28dc25aea0bddfca1481cebe24ad3aa71930844 (diff) |
Merge release-20201130.0-51-gb28dc25ae (automated)
Diffstat (limited to 'pkg/p9/server.go')
-rw-r--r-- | pkg/p9/server.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/pkg/p9/server.go b/pkg/p9/server.go index 3736f12a3..8c5c434fd 100644 --- a/pkg/p9/server.go +++ b/pkg/p9/server.go @@ -134,12 +134,11 @@ type fidRef struct { // The node above will be closed only when refs reaches zero. refs int64 - // openedMu protects opened and openFlags. - openedMu sync.Mutex - // opened indicates whether this has been opened already. // // This is updated in handlers.go. + // + // opened is protected by pathNode.opMu or renameMu (for write). opened bool // mode is the fidRef's mode from the walk. Only the type bits are @@ -151,6 +150,8 @@ type fidRef struct { // openFlags is the mode used in the open. // // This is updated in handlers.go. + // + // openFlags is protected by pathNode.opMu or renameMu (for write). openFlags OpenFlags // pathNode is the current pathNode for this FID. @@ -177,13 +178,6 @@ type fidRef struct { deleted uint32 } -// OpenFlags returns the flags the file was opened with and true iff the fid was opened previously. -func (f *fidRef) OpenFlags() (OpenFlags, bool) { - f.openedMu.Lock() - defer f.openedMu.Unlock() - return f.openFlags, f.opened -} - // IncRef increases the references on a fid. func (f *fidRef) IncRef() { atomic.AddInt64(&f.refs, 1) |