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
Levin Zimmermann
go-fuse
Commits
39b429e7
Commit
39b429e7
authored
Jun 30, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: Add MountOptions.SingleThreaded.
parent
a3347006
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
fuse/api.go
fuse/api.go
+4
-1
fuse/server.go
fuse/server.go
+7
-0
fuse/test/loopback_test.go
fuse/test/loopback_test.go
+2
-4
No files found.
fuse/api.go
View file @
39b429e7
...
...
@@ -57,9 +57,12 @@ type MountOptions struct {
// This may be useful for NFS.
RememberInodes
bool
// The
N
ame will show up on the output of the mount. Keep this string
// The
n
ame will show up on the output of the mount. Keep this string
// small.
Name
string
// If set, wrap the file system in a single-threaded wrapper.
SingleThreaded
bool
}
// RawFileSystem is an interface close to the FUSE wire protocol.
...
...
fuse/server.go
View file @
39b429e7
...
...
@@ -78,6 +78,9 @@ func (ms *Server) RecordLatencies(l LatencyMap) {
ms
.
latencies
=
l
}
// Unmount calls fusermount -u on the mount. This has the effect of
// shutting down the filesystem. After the Server is unmounted, it
// should be discarded.
func
(
ms
*
Server
)
Unmount
()
(
err
error
)
{
if
ms
.
mountPoint
==
""
{
return
nil
...
...
@@ -112,6 +115,10 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
}
}
o
:=
*
opts
if
o
.
SingleThreaded
{
fs
=
NewLockingRawFileSystem
(
fs
)
}
if
o
.
Buffers
==
nil
{
o
.
Buffers
=
defaultBufferPool
}
...
...
fuse/test/loopback_test.go
View file @
39b429e7
...
...
@@ -76,7 +76,6 @@ func NewTestCase(t *testing.T) *testCase {
pfs
=
pathfs
.
NewLoopbackFileSystem
(
me
.
orig
)
pfs
=
pathfs
.
NewLockingFileSystem
(
pfs
)
var
rfs
fuse
.
RawFileSystem
me
.
pathFs
=
pathfs
.
NewPathNodeFs
(
pfs
,
&
pathfs
.
PathNodeFsOptions
{
ClientInodes
:
true
})
me
.
connector
=
nodefs
.
NewFileSystemConnector
(
me
.
pathFs
,
...
...
@@ -85,10 +84,9 @@ func NewTestCase(t *testing.T) *testCase {
AttrTimeout
:
testTtl
,
NegativeTimeout
:
0.0
,
})
rfs
=
fuse
.
NewLockingRawFileSystem
(
me
.
connector
.
RawFS
())
me
.
connector
.
SetDebug
(
fuse
.
VerboseTest
())
me
.
state
,
err
=
fuse
.
NewServer
(
rfs
,
me
.
mnt
,
nil
)
me
.
state
,
err
=
fuse
.
NewServer
(
me
.
connector
.
RawFS
(),
me
.
mnt
,
&
fuse
.
MountOptions
{
SingleThreaded
:
true
})
if
err
!=
nil
{
t
.
Fatal
(
"NewServer:"
,
err
)
}
...
...
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