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
f40a24c8
Commit
f40a24c8
authored
Aug 12, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pay attention to DisableWritebackCaching.
parent
842af250
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
connection.go
connection.go
+8
-12
mount.go
mount.go
+4
-4
No files found.
connection.go
View file @
f40a24c8
...
...
@@ -57,6 +57,7 @@ const maxReadahead = 1 << 20
// A connection to the fuse kernel process.
type
Connection
struct
{
cfg
MountConfig
debugLogger
*
log
.
Logger
errorLogger
*
log
.
Logger
...
...
@@ -65,9 +66,6 @@ type Connection struct {
dev
*
os
.
File
protocol
fusekernel
.
Protocol
// The context from which all op contexts inherit.
parentCtx
context
.
Context
mu
sync
.
Mutex
// A map from fuse "unique" request ID (*not* the op ID for logging used
...
...
@@ -94,15 +92,15 @@ type opState struct {
//
// The loggers may be nil.
func
newConnection
(
parentCtx
context
.
Context
,
cfg
MountConfig
,
debugLogger
*
log
.
Logger
,
errorLogger
*
log
.
Logger
,
dev
*
os
.
File
)
(
c
*
Connection
,
err
error
)
{
c
=
&
Connection
{
cfg
:
cfg
,
debugLogger
:
debugLogger
,
errorLogger
:
errorLogger
,
dev
:
dev
,
parentCtx
:
parentCtx
,
cancelFuncs
:
make
(
map
[
uint64
]
func
()),
}
...
...
@@ -165,12 +163,10 @@ func (c *Connection) Init() (err error) {
// Tell the kernel not to use pitifully small 4 KiB writes.
initOp
.
Flags
|=
fusekernel
.
InitBigWrites
// TODO(jacobsa): Make this opt out and discuss benefits and caveats:
// * Write performance may be better (cf. http://thread.gmane.org/gmane.comp.file-systems.fuse.devel/13923)
// * (Discuss what writeback caching even means)
// * File systems need to implement setattr for dealing with kernel's stored time (find code reference)
// * File systems no longer "own" mtime; kernel will cache it even if no writes (cf. http://thread.gmane.org/gmane.comp.file-systems.fuse.devel/14808)
initOp
.
Flags
|=
fusekernel
.
InitWritebackCache
// Enable writeback caching if the user hasn't asked us not to.
if
!
c
.
cfg
.
DisableWritebackCaching
{
initOp
.
Flags
|=
fusekernel
.
InitWritebackCache
}
c
.
Reply
(
ctx
,
nil
)
return
...
...
@@ -234,7 +230,7 @@ func (c *Connection) beginOp(
opCode
uint32
,
fuseID
uint64
)
(
ctx
context
.
Context
)
{
// Start with the parent context.
ctx
=
c
.
parentCtx
ctx
=
c
.
cfg
.
OpContext
// Set up a cancellation function.
//
...
...
mount.go
View file @
f40a24c8
...
...
@@ -67,14 +67,14 @@ func Mount(
}
// Choose a parent context for ops.
opContext
:=
config
.
OpContext
if
o
pContext
==
nil
{
o
pContext
=
context
.
Background
()
cfgCopy
:=
*
config
if
cfgCopy
.
O
pContext
==
nil
{
cfgCopy
.
O
pContext
=
context
.
Background
()
}
// Create a Connection object wrapping the device.
connection
,
err
:=
newConnection
(
opContext
,
cfgCopy
,
config
.
DebugLogger
,
config
.
ErrorLogger
,
dev
)
...
...
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