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
df20e4bf
Commit
df20e4bf
authored
Jun 30, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document more methods of the Serve type.
parent
b8a27afb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
fuse/server.go
fuse/server.go
+13
-5
unionfs/autounion.go
unionfs/autounion.go
+1
-1
No files found.
fuse/server.go
View file @
df20e4bf
...
@@ -53,6 +53,9 @@ func (ms *Server) SetDebug(dbg bool) {
...
@@ -53,6 +53,9 @@ func (ms *Server) SetDebug(dbg bool) {
ms
.
debug
=
dbg
ms
.
debug
=
dbg
}
}
// KernelSettings returns the Init message from the kernel, so
// filesystems can adapt to availability of features of the kernel
// driver.
func
(
ms
*
Server
)
KernelSettings
()
raw
.
InitIn
{
func
(
ms
*
Server
)
KernelSettings
()
raw
.
InitIn
{
ms
.
reqMu
.
Lock
()
ms
.
reqMu
.
Lock
()
s
:=
ms
.
kernelSettings
s
:=
ms
.
kernelSettings
...
@@ -73,6 +76,8 @@ type LatencyMap interface {
...
@@ -73,6 +76,8 @@ type LatencyMap interface {
Add
(
name
string
,
dt
time
.
Duration
)
Add
(
name
string
,
dt
time
.
Duration
)
}
}
// RecordLatencies switches on collection of timing for each request
// coming from the kernel.P assing a nil argument switches off the
func
(
ms
*
Server
)
RecordLatencies
(
l
LatencyMap
)
{
func
(
ms
*
Server
)
RecordLatencies
(
l
LatencyMap
)
{
ms
.
latencies
=
l
ms
.
latencies
=
l
}
}
...
@@ -175,7 +180,9 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
...
@@ -175,7 +180,9 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
return
ms
,
nil
return
ms
,
nil
}
}
func
(
ms
*
Server
)
BufferPoolStats
()
string
{
// DebugData returns internal status information for debugging
// purposes.
func
(
ms
*
Server
)
DebugData
()
string
{
s
:=
ms
.
opts
.
Buffers
.
String
()
s
:=
ms
.
opts
.
Buffers
.
String
()
var
r
int
var
r
int
...
@@ -250,6 +257,7 @@ func (ms *Server) readRequest(exitIdle bool) (req *request, code Status) {
...
@@ -250,6 +257,7 @@ func (ms *Server) readRequest(exitIdle bool) (req *request, code Status) {
return
req
,
OK
return
req
,
OK
}
}
// returnRequest returns a request to the pool of unused requests.
func
(
ms
*
Server
)
returnRequest
(
req
*
request
)
{
func
(
ms
*
Server
)
returnRequest
(
req
*
request
)
{
ms
.
recordStats
(
req
)
ms
.
recordStats
(
req
)
...
@@ -277,7 +285,7 @@ func (ms *Server) recordStats(req *request) {
...
@@ -277,7 +285,7 @@ func (ms *Server) recordStats(req *request) {
}
}
}
}
//
Loop initiates the FUSE loop. Normally, callers should run Loop
()
//
Serve initiates the FUSE loop. Normally, callers should run Serve
()
// and wait for it to exit, but tests will want to run this in a
// and wait for it to exit, but tests will want to run this in a
// goroutine.
// goroutine.
//
//
...
@@ -473,9 +481,9 @@ func init() {
...
@@ -473,9 +481,9 @@ func init() {
defaultBufferPool
=
NewBufferPool
()
defaultBufferPool
=
NewBufferPool
()
}
}
// Wait
for the first request to be served. Use this to avoid racing
// Wait
Mount waits for the first request to be served. Use this to
//
between accessing the (empty) mountpoint, and the OS trying to
//
avoid racing between accessing the (empty) mountpoint, and the OS
// setup the user-space mount.
//
trying to
setup the user-space mount.
func
(
ms
*
Server
)
WaitMount
()
{
func
(
ms
*
Server
)
WaitMount
()
{
<-
ms
.
started
<-
ms
.
started
}
}
unionfs/autounion.go
View file @
df20e4bf
...
@@ -411,7 +411,7 @@ func (fs *autoUnionFs) DebugData() string {
...
@@ -411,7 +411,7 @@ func (fs *autoUnionFs) DebugData() string {
"Bufferpool: %v
\n
"
+
"Bufferpool: %v
\n
"
+
"Kernel: %v
\n
"
,
"Kernel: %v
\n
"
,
fuse
.
Version
(),
fuse
.
Version
(),
fs
.
mountState
.
BufferPoolStats
(),
fs
.
mountState
.
DebugData
(),
&
setting
)
&
setting
)
if
fs
.
connector
!=
nil
{
if
fs
.
connector
!=
nil
{
...
...
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