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
Kirill Smelkov
go-fuse
Commits
de23b1ed
Commit
de23b1ed
authored
Feb 02, 2016
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: run OnMount outside of the parent treelock.
This lets you Mount multiple nodes in parallel.
parent
88b9481d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
fuse/nodefs/fsconnector.go
fuse/nodefs/fsconnector.go
+12
-3
No files found.
fuse/nodefs/fsconnector.go
View file @
de23b1ed
...
...
@@ -252,12 +252,22 @@ func (c *FileSystemConnector) mountRoot(opts *Options) {
// It returns ENOENT if the directory containing the mount point does
// not exist, and EBUSY if the intended mount point already exists.
func
(
c
*
FileSystemConnector
)
Mount
(
parent
*
Inode
,
name
string
,
root
Node
,
opts
*
Options
)
fuse
.
Status
{
node
,
code
:=
c
.
lockMount
(
parent
,
name
,
root
,
opts
)
if
!
code
.
Ok
()
{
return
code
}
node
.
Node
()
.
OnMount
(
c
)
return
code
}
func
(
c
*
FileSystemConnector
)
lockMount
(
parent
*
Inode
,
name
string
,
root
Node
,
opts
*
Options
)
(
*
Inode
,
fuse
.
Status
)
{
defer
c
.
verify
()
parent
.
mount
.
treeLock
.
Lock
()
defer
parent
.
mount
.
treeLock
.
Unlock
()
node
:=
parent
.
children
[
name
]
if
node
!=
nil
{
return
fuse
.
EBUSY
return
nil
,
fuse
.
EBUSY
}
node
=
newInode
(
true
,
root
)
...
...
@@ -274,8 +284,7 @@ func (c *FileSystemConnector) Mount(parent *Inode, name string, root Node, opts
log
.
Printf
(
"Mount %T on subdir %s, parent %d"
,
node
,
name
,
c
.
inodeMap
.
Handle
(
&
parent
.
handled
))
}
node
.
Node
()
.
OnMount
(
c
)
return
fuse
.
OK
return
node
,
fuse
.
OK
}
// Unmount() tries to unmount the given inode. It returns EINVAL if the
...
...
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