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
91664cfc
Commit
91664cfc
authored
Jul 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed maxReadahead.
parent
28605268
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
connection.go
connection.go
+20
-1
mount_config.go
mount_config.go
+0
-20
No files found.
connection.go
View file @
91664cfc
...
...
@@ -32,6 +32,25 @@ import (
"github.com/jacobsa/fuse/internal/fuseshim"
)
// Ask the Linux kernel for larger read requests.
//
// As of 2015-03-26, the behavior in the kernel is:
//
// * (http://goo.gl/bQ1f1i, http://goo.gl/HwBrR6) Set the local variable
// ra_pages to be init_response->max_readahead divided by the page size.
//
// * (http://goo.gl/gcIsSh, http://goo.gl/LKV2vA) Set
// backing_dev_info::ra_pages to the min of that value and what was sent
// in the request's max_readahead field.
//
// * (http://goo.gl/u2SqzH) Use backing_dev_info::ra_pages when deciding
// how much to read ahead.
//
// * (http://goo.gl/JnhbdL) Don't read ahead at all if that field is zero.
//
// Reading a page at a time is a drag. Ask for a larger size.
const
maxReadahead
=
1
<<
20
// A connection to the fuse kernel process.
type
Connection
struct
{
debugLogger
*
log
.
Logger
...
...
@@ -72,7 +91,7 @@ func newConnection(
Dev
:
dev
,
}
err
=
fuseshim
.
InitMount
(
wrapped
,
TODO
,
TODO
)
err
=
fuseshim
.
InitMount
(
wrapped
,
maxReadahead
,
TODO
)
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"fuseshim.InitMount: %v"
,
err
)
return
...
...
mount_config.go
View file @
91664cfc
...
...
@@ -129,26 +129,6 @@ func (c *MountConfig) bazilfuseOptions() (opts []fuseshim.MountOption) {
opts
=
append
(
opts
,
fuseshim
.
SetOption
(
"noappledouble"
,
""
))
}
// Ask the Linux kernel for larger read requests.
//
// As of 2015-03-26, the behavior in the kernel is:
//
// * (http://goo.gl/bQ1f1i, http://goo.gl/HwBrR6) Set the local variable
// ra_pages to be init_response->max_readahead divided by the page size.
//
// * (http://goo.gl/gcIsSh, http://goo.gl/LKV2vA) Set
// backing_dev_info::ra_pages to the min of that value and what was sent
// in the request's max_readahead field.
//
// * (http://goo.gl/u2SqzH) Use backing_dev_info::ra_pages when deciding
// how much to read ahead.
//
// * (http://goo.gl/JnhbdL) Don't read ahead at all if that field is zero.
//
// Reading a page at a time is a drag. Ask for a larger size.
const
maxReadahead
=
1
<<
20
opts
=
append
(
opts
,
fuseshim
.
MaxReadahead
(
maxReadahead
))
// Last but not least: other user-supplied options.
for
k
,
v
:=
range
c
.
Options
{
opts
=
append
(
opts
,
fuseshim
.
SetOption
(
k
,
v
))
...
...
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