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
b6256e6f
Commit
b6256e6f
authored
Apr 27, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also set CongestionThreshold and MaxBackground. Drop some FUSE_ prefixes.
parent
4d2a634b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
fuse/opcode.go
fuse/opcode.go
+8
-5
fuse/types.go
fuse/types.go
+17
-20
No files found.
fuse/opcode.go
View file @
b6256e6f
...
@@ -3,9 +3,12 @@ package fuse
...
@@ -3,9 +3,12 @@ package fuse
import
(
import
(
"bytes"
"bytes"
"fmt"
"fmt"
"log"
"unsafe"
"unsafe"
)
)
var
_
=
log
.
Printf
func
replyString
(
opcode
Opcode
,
ptr
unsafe
.
Pointer
)
string
{
func
replyString
(
opcode
Opcode
,
ptr
unsafe
.
Pointer
)
string
{
h
:=
getHandler
(
opcode
)
h
:=
getHandler
(
opcode
)
var
val
interface
{}
var
val
interface
{}
...
@@ -20,17 +23,15 @@ func replyString(opcode Opcode, ptr unsafe.Pointer) string {
...
@@ -20,17 +23,15 @@ func replyString(opcode Opcode, ptr unsafe.Pointer) string {
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
func
doInit
(
state
*
MountState
,
req
*
request
)
{
func
doInit
(
state
*
MountState
,
req
*
request
)
{
input
:=
(
*
InitIn
)(
req
.
inData
)
input
:=
(
*
InitIn
)(
req
.
inData
)
if
input
.
Major
!=
FUSE_KERNEL_VERSION
{
if
input
.
Major
!=
FUSE_KERNEL_VERSION
{
fmt
.
Printf
(
"Major versions does not match. Given %d, want %d
\n
"
,
input
.
Major
,
FUSE_KERNEL_VERSION
)
log
.
Printf
(
"Major versions does not match. Given %d, want %d
\n
"
,
input
.
Major
,
FUSE_KERNEL_VERSION
)
req
.
status
=
EIO
req
.
status
=
EIO
return
return
}
}
if
input
.
Minor
<
FUSE_KERNEL_MINOR_VERSION
{
if
input
.
Minor
<
FUSE_KERNEL_MINOR_VERSION
{
fmt
.
Printf
(
"Minor version is less than we support. Given %d, want at least %d
\n
"
,
input
.
Minor
,
FUSE_KERNEL_MINOR_VERSION
)
log
.
Printf
(
"Minor version is less than we support. Given %d, want at least %d
\n
"
,
input
.
Minor
,
FUSE_KERNEL_MINOR_VERSION
)
req
.
status
=
EIO
req
.
status
=
EIO
return
return
}
}
...
@@ -39,8 +40,10 @@ func doInit(state *MountState, req *request) {
...
@@ -39,8 +40,10 @@ func doInit(state *MountState, req *request) {
Major
:
FUSE_KERNEL_VERSION
,
Major
:
FUSE_KERNEL_VERSION
,
Minor
:
FUSE_KERNEL_MINOR_VERSION
,
Minor
:
FUSE_KERNEL_MINOR_VERSION
,
MaxReadAhead
:
input
.
MaxReadAhead
,
MaxReadAhead
:
input
.
MaxReadAhead
,
Flags
:
FUSE_ASYNC_READ
|
FUSE_POSIX_LOCKS
|
FUSE
_BIG_WRITES
,
Flags
:
CAP_ASYNC_READ
|
CAP_POSIX_LOCKS
|
CAP
_BIG_WRITES
,
MaxWrite
:
maxRead
,
MaxWrite
:
maxRead
,
CongestionThreshold
:
_BACKGROUND_TASKS
*
3
/
4
,
MaxBackground
:
_BACKGROUND_TASKS
,
}
}
req
.
outData
=
unsafe
.
Pointer
(
out
)
req
.
outData
=
unsafe
.
Pointer
(
out
)
...
...
fuse/types.go
View file @
b6256e6f
...
@@ -24,19 +24,23 @@ const (
...
@@ -24,19 +24,23 @@ const (
FATTR_MTIME_NOW
=
(
1
<<
8
)
FATTR_MTIME_NOW
=
(
1
<<
8
)
FATTR_LOCKOWNER
=
(
1
<<
9
)
FATTR_LOCKOWNER
=
(
1
<<
9
)
// OpenIn.Flags
// OpenIn.Flags
FOPEN_DIRECT_IO
=
(
1
<<
0
)
FOPEN_DIRECT_IO
=
(
1
<<
0
)
FOPEN_KEEP_CACHE
=
(
1
<<
1
)
FOPEN_KEEP_CACHE
=
(
1
<<
1
)
FOPEN_NONSEEKABLE
=
(
1
<<
2
)
FOPEN_NONSEEKABLE
=
(
1
<<
2
)
// To be set in InitOut.Flags.
// To be set in InitOut.Flags.
FUSE_ASYNC_READ
=
(
1
<<
0
)
CAP_ASYNC_READ
=
(
1
<<
0
)
FUSE_POSIX_LOCKS
=
(
1
<<
1
)
CAP_POSIX_LOCKS
=
(
1
<<
1
)
FUSE_FILE_OPS
=
(
1
<<
2
)
CAP_FILE_OPS
=
(
1
<<
2
)
FUSE_ATOMIC_O_TRUNC
=
(
1
<<
3
)
CAP_ATOMIC_O_TRUNC
=
(
1
<<
3
)
FUSE_EXPORT_SUPPORT
=
(
1
<<
4
)
CAP_EXPORT_SUPPORT
=
(
1
<<
4
)
FUSE_BIG_WRITES
=
(
1
<<
5
)
CAP_BIG_WRITES
=
(
1
<<
5
)
FUSE_DONT_MASK
=
(
1
<<
6
)
CAP_DONT_MASK
=
(
1
<<
6
)
CAP_SPLICE_WRITE
=
(
1
<<
7
)
CAP_SPLICE_MOVE
=
(
1
<<
8
)
CAP_SPLICE_READ
=
(
1
<<
9
)
FUSE_UNKNOWN_INO
=
0xffffffff
FUSE_UNKNOWN_INO
=
0xffffffff
...
@@ -61,19 +65,7 @@ const (
...
@@ -61,19 +65,7 @@ const (
FUSE_POLL_SCHEDULE_NOTIFY
=
(
1
<<
0
)
FUSE_POLL_SCHEDULE_NOTIFY
=
(
1
<<
0
)
FUSE_COMPAT_WRITE_IN_SIZE
=
24
FUSE_MIN_READ_BUFFER
=
8192
FUSE_MIN_READ_BUFFER
=
8192
FUSE_COMPAT_ENTRY_OUT_SIZE
=
120
FUSE_COMPAT_ATTR_OUT_SIZE
=
96
FUSE_COMPAT_MKNOD_IN_SIZE
=
8
FUSE_COMPAT_STATFS_SIZE
=
48
CUSE_INIT_INFO_MAX
=
4096
CUSE_INIT_INFO_MAX
=
4096
S_IFDIR
=
syscall
.
S_IFDIR
S_IFDIR
=
syscall
.
S_IFDIR
...
@@ -85,6 +77,11 @@ const (
...
@@ -85,6 +77,11 @@ const (
O_ANYWRITE
=
uint32
(
os
.
O_WRONLY
|
os
.
O_RDWR
|
os
.
O_APPEND
|
os
.
O_CREATE
|
os
.
O_TRUNC
)
O_ANYWRITE
=
uint32
(
os
.
O_WRONLY
|
os
.
O_RDWR
|
os
.
O_APPEND
|
os
.
O_CREATE
|
os
.
O_TRUNC
)
)
)
const
(
// TODO - we should read this from /sys/fs/fuse/ , dynamically.
_BACKGROUND_TASKS
=
12
)
type
Status
int32
type
Status
int32
const
(
const
(
...
...
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