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
40eebacb
Commit
40eebacb
authored
Feb 23, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add WaitMount() to wait for first request being done.
parent
90e49967
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
fuse/loopback_test.go
fuse/loopback_test.go
+2
-0
fuse/mountstate.go
fuse/mountstate.go
+15
-1
No files found.
fuse/loopback_test.go
View file @
40eebacb
...
...
@@ -91,6 +91,8 @@ func NewTestCase(t *testing.T) *testCase {
// Unthreaded, but in background.
go
me
.
state
.
Loop
()
me
.
state
.
WaitMount
()
return
me
}
...
...
fuse/mountstate.go
View file @
40eebacb
...
...
@@ -35,6 +35,8 @@ type MountState struct {
opts
*
MountOptions
started
chan
struct
{}
reqMu
sync
.
Mutex
reqPool
[]
*
request
readPool
[][]
byte
...
...
@@ -182,6 +184,7 @@ func NewMountState(fs RawFileSystem) *MountState {
ms
:=
new
(
MountState
)
ms
.
mountPoint
=
""
ms
.
fileSystem
=
fs
ms
.
started
=
make
(
chan
struct
{})
return
ms
}
...
...
@@ -385,7 +388,11 @@ func (ms *MountState) write(req *request) Status {
return
OK
}
return
ms
.
systemWrite
(
req
,
header
)
s
:=
ms
.
systemWrite
(
req
,
header
)
if
req
.
inHeader
.
Opcode
==
_OP_INIT
{
close
(
ms
.
started
)
}
return
s
}
func
(
ms
*
MountState
)
writeInodeNotify
(
entry
*
raw
.
NotifyInvalInodeOut
)
Status
{
...
...
@@ -483,3 +490,10 @@ var defaultBufferPool BufferPool
func
init
()
{
defaultBufferPool
=
NewBufferPool
()
}
// Wait for the first request to be served. Use this to avoid racing
// between accessing the (empty) mountpoint, and the OS trying to
// setup the user-space mount.
func
(
ms
*
MountState
)
WaitMount
()
{
<-
ms
.
started
}
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