Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
5ae9856c
Commit
5ae9856c
authored
Jun 09, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define that Server.ServeOps must wait for in-flights.
parent
100c7af2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
fuseutil/file_system.go
fuseutil/file_system.go
+7
-4
mounted_file_system.go
mounted_file_system.go
+2
-1
No files found.
fuseutil/file_system.go
View file @
5ae9856c
...
...
@@ -74,7 +74,7 @@ type FileSystem interface {
// cf. http://goo.gl/jnkHPO, fuse-devel thread "Fuse guarantees on concurrent
// requests").
func
NewFileSystemServer
(
fs
FileSystem
)
fuse
.
Server
{
return
fileSystemServer
{
return
&
fileSystemServer
{
fs
:
fs
,
}
}
...
...
@@ -84,7 +84,9 @@ type fileSystemServer struct {
opsInFlight
sync
.
WaitGroup
}
func
(
s
fileSystemServer
)
ServeOps
(
c
*
fuse
.
Connection
)
{
func
(
s
*
fileSystemServer
)
ServeOps
(
c
*
fuse
.
Connection
)
{
defer
s
.
opsInFlight
.
Wait
()
for
{
op
,
err
:=
c
.
ReadOp
()
if
err
==
io
.
EOF
{
...
...
@@ -100,7 +102,9 @@ func (s fileSystemServer) ServeOps(c *fuse.Connection) {
}
}
func
(
s
fileSystemServer
)
handleOp
(
op
fuseops
.
Op
)
{
func
(
s
*
fileSystemServer
)
handleOp
(
op
fuseops
.
Op
)
{
defer
s
.
opsInFlight
.
Done
()
// Delay if requested.
if
*
fRandomDelays
{
const
delayLimit
=
100
*
time
.
Microsecond
...
...
@@ -176,5 +180,4 @@ func (s fileSystemServer) handleOp(op fuseops.Op) {
}
op
.
Respond
(
err
)
s
.
opsInFlight
.
Done
()
}
mounted_file_system.go
View file @
5ae9856c
...
...
@@ -26,7 +26,8 @@ import (
// A type that knows how to serve ops read from a connection.
type
Server
interface
{
// Read and serve ops from the supplied connection until EOF.
// Read and serve ops from the supplied connection until EOF. Do not return
// until all operations have been responded to.
ServeOps
(
*
Connection
)
}
...
...
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