Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
2f957ce7
Commit
2f957ce7
authored
Sep 01, 2017
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use waitgroup for parallel fuse mounting logic
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
c5f8a0c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
fuse/node/mount_unix.go
fuse/node/mount_unix.go
+9
-10
No files found.
fuse/node/mount_unix.go
View file @
2f957ce7
...
...
@@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"strings"
"sync"
core
"github.com/ipfs/go-ipfs/core"
ipns
"github.com/ipfs/go-ipfs/fuse/ipns"
...
...
@@ -63,28 +64,26 @@ func doMount(node *core.IpfsNode, fsdir, nsdir string) error {
}
// this sync stuff is so that both can be mounted simultaneously.
var
fsmount
mount
.
Mount
var
nsmount
mount
.
Mount
var
err1
error
var
err2
error
var
fsmount
,
nsmount
mount
.
Mount
var
err1
,
err2
error
done
:=
make
(
chan
struct
{})
var
wg
sync
.
WaitGroup
wg
.
Add
(
1
)
go
func
()
{
defer
wg
.
Done
()
fsmount
,
err1
=
rofs
.
Mount
(
node
,
fsdir
)
done
<-
struct
{}{}
}()
if
node
.
OnlineMode
()
{
wg
.
Add
(
1
)
go
func
()
{
defer
wg
.
Done
()
nsmount
,
err2
=
ipns
.
Mount
(
node
,
nsdir
,
fsdir
)
done
<-
struct
{}{}
}()
<-
done
}
<-
done
wg
.
Wait
()
if
err1
!=
nil
{
log
.
Errorf
(
"error mounting: %s"
,
err1
)
...
...
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