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
7c2b5692
Commit
7c2b5692
authored
Feb 15, 2020
by
Michael Stapelberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement symlink caching
parent
ae5da07e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
connection.go
connection.go
+8
-0
internal/fusekernel/fuse_kernel.go
internal/fusekernel/fuse_kernel.go
+2
-0
mount_config.go
mount_config.go
+11
-0
No files found.
connection.go
View file @
7c2b5692
...
...
@@ -148,6 +148,8 @@ func (c *Connection) Init() error {
c
.
protocol
=
initOp
.
Kernel
}
cacheSymlinks
:=
initOp
.
Flags
&
fusekernel
.
InitCacheSymlinks
>
0
// Respond to the init op.
initOp
.
Library
=
c
.
protocol
initOp
.
MaxReadahead
=
maxReadahead
...
...
@@ -163,6 +165,12 @@ func (c *Connection) Init() error {
initOp
.
Flags
|=
fusekernel
.
InitWritebackCache
}
// Enable caching symlink targets in the kernel page cache if the user opted
// into it (might require fixing the size field of inode attributes first):
if
c
.
cfg
.
EnableSymlinkCaching
&&
cacheSymlinks
{
initOp
.
Flags
|=
fusekernel
.
InitCacheSymlinks
}
c
.
Reply
(
ctx
,
nil
)
return
nil
}
...
...
internal/fusekernel/fuse_kernel.go
View file @
7c2b5692
...
...
@@ -266,6 +266,7 @@ const (
InitAsyncDIO
InitFlags
=
1
<<
15
InitWritebackCache
InitFlags
=
1
<<
16
InitNoOpenSupport
InitFlags
=
1
<<
17
InitCacheSymlinks
InitFlags
=
1
<<
23
InitCaseSensitive
InitFlags
=
1
<<
29
// OS X only
InitVolRename
InitFlags
=
1
<<
30
// OS X only
...
...
@@ -296,6 +297,7 @@ var initFlagNames = []flagName{
{
uint32
(
InitAsyncDIO
),
"InitAsyncDIO"
},
{
uint32
(
InitWritebackCache
),
"InitWritebackCache"
},
{
uint32
(
InitNoOpenSupport
),
"InitNoOpenSupport"
},
{
uint32
(
InitCacheSymlinks
),
"InitCacheSymlinks"
},
{
uint32
(
InitCaseSensitive
),
"InitCaseSensitive"
},
{
uint32
(
InitVolRename
),
"InitVolRename"
},
...
...
mount_config.go
View file @
7c2b5692
...
...
@@ -128,6 +128,17 @@ type MountConfig struct {
// entries will be cached for an arbitrarily long time.
EnableVnodeCaching
bool
// Linux only.
//
// Linux 4.20 introduced caching symlink targets in the page cache:
// https://github.com/torvalds/linux/commit/5571f1e65486be025f73fa6aa30fb03725d362a2
//
// This is not enabled by default because the old behavior masked a bug:
// file systems could return any size in the inode attributes of
// symlinks. After enabling caching, the specified size caps the symlink
// target.
EnableSymlinkCaching
bool
// OS X only.
//
// The name of the mounted volume, as displayed in the Finder. If empty, a
...
...
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