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
ee9c8261
Commit
ee9c8261
authored
Dec 19, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs: add Options.Logger, and use throughout
Change-Id: I4fabf222a306e5d3abdfda28422b046cd75c9a8c
parent
46bf7a5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
fs/api.go
fs/api.go
+7
-0
fs/bridge.go
fs/bridge.go
+7
-1
No files found.
fs/api.go
View file @
ee9c8261
...
...
@@ -168,6 +168,7 @@ package fs
import
(
"context"
"log"
"syscall"
"time"
...
...
@@ -603,4 +604,10 @@ type Options struct {
// ServerCallbacks can be provided to stub out notification
// functions for testing a filesystem without mounting it.
ServerCallbacks
ServerCallbacks
// Logger is a sink for diagnostic messages. Diagnostic
// messages are printed under conditions where we cannot
// return error, but want to signal something seems off
// anyway. If unset, no messages are printed.
Logger
*
log
.
Logger
}
fs/bridge.go
View file @
ee9c8261
...
...
@@ -119,7 +119,7 @@ func (b *rawBridge) newInodeUnlocked(ops InodeEmbedder, id StableAttr, persisten
t
=
expSleep
(
t
)
if
i
%
5000
==
0
{
log
.
Print
f
(
"blocked for %.0f seconds waiting for FORGET on i%d"
,
time
.
Since
(
t0
)
.
Seconds
(),
id
.
Ino
)
b
.
log
f
(
"blocked for %.0f seconds waiting for FORGET on i%d"
,
time
.
Since
(
t0
)
.
Seconds
(),
id
.
Ino
)
}
b
.
mu
.
Lock
()
}
...
...
@@ -129,6 +129,12 @@ func (b *rawBridge) newInodeUnlocked(ops InodeEmbedder, id StableAttr, persisten
return
ops
.
embed
()
}
func
(
b
*
rawBridge
)
logf
(
format
string
,
args
...
interface
{})
{
if
b
.
options
.
Logger
!=
nil
{
b
.
options
.
Logger
.
Printf
(
format
,
args
...
)
}
}
// expSleep sleeps for time `t` and returns an exponentially increasing value
// for the next sleep time, capped at 1 ms.
func
expSleep
(
t
time
.
Duration
)
time
.
Duration
{
...
...
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