projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e54bbc1
)
12308: Use RWMutex for filehandle map.
author
Tom Clegg <tom@tomclegg.ca>
Wed, 12 Feb 2020 16:39:18 +0000
(11:39 -0500)
committer
Tom Clegg <tom@tomclegg.ca>
Wed, 12 Feb 2020 16:39:18 +0000
(11:39 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>
lib/mount/fs.go
patch
|
blob
|
history
diff --git
a/lib/mount/fs.go
b/lib/mount/fs.go
index 774948f574607b04f8548837720e6ba5c06c7c2f..c18c83d86bd88da246c46ec5ed28f363dd29c18c 100644
(file)
--- a/
lib/mount/fs.go
+++ b/
lib/mount/fs.go
@@
-36,7
+36,7
@@
type keepFS struct {
root arvados.CustomFileSystem
open map[uint64]*sharedFile
lastFH uint64
- sync.Mutex
+ sync.
RW
Mutex
// If non-nil, this channel will be closed by Init() to notify
// other goroutines that the mount is ready.
@@
-62,8
+62,8
@@
func (fs *keepFS) newFH(f arvados.File) uint64 {
}
func (fs *keepFS) lookupFH(fh uint64) *sharedFile {
- fs.Lock()
- defer fs.Unlock()
+ fs.
R
Lock()
+ defer fs.
R
Unlock()
return fs.open[fh]
}