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
59a13571
Commit
59a13571
authored
Mar 11, 2020
by
Kirill Smelkov
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X handle FUSE request inline, instead of spawning handleOp
XXX however it does not speedup jacobsa/fuse.
parent
2f654264
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
fuseutil/file_system.go
fuseutil/file_system.go
+28
-24
No files found.
fuseutil/file_system.go
View file @
59a13571
...
@@ -89,46 +89,50 @@ func NewFileSystemServer(fs FileSystem) fuse.Server {
...
@@ -89,46 +89,50 @@ func NewFileSystemServer(fs FileSystem) fuse.Server {
}
}
type
fileSystemServer
struct
{
type
fileSystemServer
struct
{
fs
FileSystem
fs
FileSystem
ops
InFlight
sync
.
WaitGroup
serve
InFlight
sync
.
WaitGroup
}
}
func
(
s
*
fileSystemServer
)
ServeOps
(
c
*
fuse
.
Connection
)
{
func
(
s
*
fileSystemServer
)
ServeOps
(
c
*
fuse
.
Connection
)
{
// When we are done, we clean up by waiting for all in-flight ops then
// When we are done, we clean up by waiting for all in-flight ops then
// destroying the file system.
// destroying the file system.
defer
func
()
{
defer
func
()
{
s
.
ops
InFlight
.
Wait
()
s
.
serve
InFlight
.
Wait
()
s
.
fs
.
Destroy
()
s
.
fs
.
Destroy
()
}()
}()
for
{
s
.
serveInFlight
.
Add
(
1
)
ctx
,
op
,
err
:=
c
.
ReadOp
()
s
.
serveOps
(
c
)
if
err
==
io
.
EOF
{
}
break
}
func
(
s
*
fileSystemServer
)
serveOps
(
c
*
fuse
.
Connection
)
{
defer
s
.
serveInFlight
.
Done
()
if
err
!=
nil
{
panic
(
err
)
ctx
,
op
,
err
:=
c
.
ReadOp
()
}
if
err
==
io
.
EOF
{
return
s
.
opsInFlight
.
Add
(
1
)
if
_
,
ok
:=
op
.
(
*
fuseops
.
ForgetInodeOp
);
ok
{
// Special case: call in this goroutine for
// forget inode ops, which may come in a
// flurry from the kernel and are generally
// cheap for the file system to handle
s
.
handleOp
(
c
,
ctx
,
op
)
}
else
{
go
s
.
handleOp
(
c
,
ctx
,
op
)
}
}
}
if
err
!=
nil
{
panic
(
err
)
}
// spawn .serveOps, not .handleOp to improve latency, because we
// already received FUSE request and want to handle it as fast as
// possible, i.e. now, without first putting handleOp into go scheduler
// queue. see e.g. https://github.com/golang/go/issues/15110 for details.
//
// improving FUSE request-response latency also improves IO throughput.
s
.
serveInFlight
.
Add
(
1
)
go
s
.
serveOps
(
c
)
s
.
handleOp
(
c
,
ctx
,
op
)
}
}
func
(
s
*
fileSystemServer
)
handleOp
(
func
(
s
*
fileSystemServer
)
handleOp
(
c
*
fuse
.
Connection
,
c
*
fuse
.
Connection
,
ctx
context
.
Context
,
ctx
context
.
Context
,
op
interface
{})
{
op
interface
{})
{
defer
s
.
opsInFlight
.
Done
()
// Dispatch to the appropriate method.
// Dispatch to the appropriate method.
var
err
error
var
err
error
...
...
Kirill Smelkov
@kirr
mentioned in commit
go-fuse@0aff2383
·
Mar 11, 2020
mentioned in commit
go-fuse@0aff2383
mentioned in commit go-fuse@0aff2383d192cf07557936a69ffed404038d094e
Toggle commit list
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