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
4cc77e52
Commit
4cc77e52
authored
Jul 06, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MaxBackground as tunable setting in fuse.MountOptions.
parent
f980c761
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
7 deletions
+16
-7
fuse/api.go
fuse/api.go
+3
-0
fuse/mountstate.go
fuse/mountstate.go
+10
-3
fuse/opcode.go
fuse/opcode.go
+2
-2
fuse/types.go
fuse/types.go
+1
-2
No files found.
fuse/api.go
View file @
4cc77e52
...
...
@@ -98,6 +98,9 @@ type FileSystemOptions struct {
type
MountOptions
struct
{
AllowOther
bool
// Default is _DEFAULT_BACKGROUND_TASKS, 12.
MaxBackground
int
}
// DefaultFileSystem implements a FileSystem that returns ENOSYS for every operation.
...
...
fuse/mountstate.go
View file @
4cc77e52
...
...
@@ -33,6 +33,7 @@ type MountState struct {
*
LatencyMap
opts
*
MountOptions
kernelSettings
InitIn
}
...
...
@@ -46,9 +47,15 @@ func (me *MountState) MountPoint() string {
// Mount filesystem on mountPoint.
func
(
me
*
MountState
)
Mount
(
mountPoint
string
,
opts
*
MountOptions
)
os
.
Error
{
if
opts
==
nil
{
opts
=
&
MountOptions
{
MaxBackground
:
_DEFAULT_BACKGROUND_TASKS
,
}
}
me
.
opts
=
opts
optStr
:=
""
if
opts
!=
nil
&&
opts
.
AllowOther
{
if
opts
.
AllowOther
{
optStr
=
"allow_other"
}
...
...
@@ -150,7 +157,7 @@ func (me *MountState) Loop(threaded bool) {
// This means that the request once read does not need to be
// assigned to another thread, so it avoids a context switch.
if
threaded
{
for
i
:=
0
;
i
<
_BACKGROUND_TASKS
;
i
++
{
for
i
:=
0
;
i
<
me
.
opts
.
MaxBackground
-
1
;
i
++
{
go
me
.
loop
()
}
}
...
...
fuse/opcode.go
View file @
4cc77e52
...
...
@@ -84,8 +84,8 @@ func doInit(state *MountState, req *request) {
MaxReadAhead
:
input
.
MaxReadAhead
,
Flags
:
state
.
kernelSettings
.
Flags
,
MaxWrite
:
maxRead
,
CongestionThreshold
:
_BACKGROUND_TASKS
*
3
/
4
,
MaxBackground
:
_BACKGROUND_TASKS
,
CongestionThreshold
:
uint16
(
state
.
opts
.
MaxBackground
*
3
/
4
)
,
MaxBackground
:
uint16
(
state
.
opts
.
MaxBackground
)
,
}
req
.
outData
=
unsafe
.
Pointer
(
out
)
...
...
fuse/types.go
View file @
4cc77e52
...
...
@@ -35,8 +35,7 @@ const (
)
const
(
// TODO - we should read this from /sys/fs/fuse/ , dynamically.
_BACKGROUND_TASKS
=
12
_DEFAULT_BACKGROUND_TASKS
=
12
)
type
Status
int32
...
...
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