Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
3713ef6d
Commit
3713ef6d
authored
Jun 21, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some paranoia changes wrt locking.
parent
2d65aab9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+7
-9
fuse/pathops.go
fuse/pathops.go
+4
-2
No files found.
fuse/pathfilesystem.go
View file @
3713ef6d
...
...
@@ -411,8 +411,10 @@ func (me *FileSystemConnector) considerDropInode(n *inode) {
n
.
mount
.
treeLock
.
Lock
()
defer
n
.
mount
.
treeLock
.
Unlock
()
if
n
.
LookupCount
<=
0
&&
len
(
n
.
Children
)
==
0
&&
(
n
.
mountPoint
==
nil
||
n
.
mountPoint
.
unmountPending
)
&&
n
.
OpenCount
<=
0
{
dropInode
:=
n
.
LookupCount
<=
0
&&
len
(
n
.
Children
)
==
0
&&
(
n
.
mountPoint
==
nil
||
n
.
mountPoint
.
unmountPending
)
&&
n
.
OpenCount
<=
0
if
dropInode
{
n
.
setParent
(
nil
)
me
.
inodeMapMutex
.
Lock
()
...
...
@@ -517,15 +519,11 @@ func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem, opts *Fil
}
if
node
!=
me
.
rootNode
{
node
.
mount
.
treeLock
.
RLock
()
}
hasChildren
:=
len
(
node
.
Children
)
>
0
// don't use defer, as we don't want to hold the lock during
// fs.Mount().
if
node
!=
me
.
rootNode
{
node
.
mount
.
treeLock
.
RUnlock
()
node
.
mount
.
treeLock
.
Lock
()
defer
node
.
mount
.
treeLock
.
Unlock
()
}
hasChildren
:=
len
(
node
.
Children
)
>
0
if
hasChildren
{
return
EBUSY
}
...
...
fuse/pathops.go
View file @
3713ef6d
...
...
@@ -391,11 +391,13 @@ func (me *FileSystemConnector) Flush(input *FlushIn) Status {
// open could have changed things.
var
path
string
var
mount
*
mountData
b
.
mount
.
treeLock
.
RLock
()
lock
:=
&
b
.
mount
.
treeLock
lock
.
RLock
()
if
b
.
inode
.
Parent
!=
nil
{
path
,
mount
=
b
.
inode
.
GetPath
()
}
b
.
mount
.
treeL
ock
.
RUnlock
()
l
ock
.
RUnlock
()
if
mount
!=
nil
{
code
=
mount
.
fs
.
Flush
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment