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
Show 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
...
...
@@ -90,45 +90,49 @@ func NewFileSystemServer(fs FileSystem) fuse.Server {
type
fileSystemServer
struct
{
fs
FileSystem
ops
InFlight
sync
.
WaitGroup
serve
InFlight
sync
.
WaitGroup
}
func
(
s
*
fileSystemServer
)
ServeOps
(
c
*
fuse
.
Connection
)
{
// When we are done, we clean up by waiting for all in-flight ops then
// destroying the file system.
defer
func
()
{
s
.
ops
InFlight
.
Wait
()
s
.
serve
InFlight
.
Wait
()
s
.
fs
.
Destroy
()
}()
for
{
s
.
serveInFlight
.
Add
(
1
)
s
.
serveOps
(
c
)
}
func
(
s
*
fileSystemServer
)
serveOps
(
c
*
fuse
.
Connection
)
{
defer
s
.
serveInFlight
.
Done
()
ctx
,
op
,
err
:=
c
.
ReadOp
()
if
err
==
io
.
EOF
{
break
return
}
if
err
!=
nil
{
panic
(
err
)
}
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
// 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
)
}
else
{
go
s
.
handleOp
(
c
,
ctx
,
op
)
}
}
}
func
(
s
*
fileSystemServer
)
handleOp
(
c
*
fuse
.
Connection
,
ctx
context
.
Context
,
op
interface
{})
{
defer
s
.
opsInFlight
.
Done
()
// Dispatch to the appropriate method.
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