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
Kirill Smelkov
go-fuse
Commits
cc423d1b
Commit
cc423d1b
authored
Mar 27, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: make opcode uint32 instead of int32
Thanks to Ryan Lamore (ryanlamore) for spotting this
parent
1b101181
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
62 deletions
+62
-62
fuse/opcode.go
fuse/opcode.go
+61
-61
fuse/types.go
fuse/types.go
+1
-1
No files found.
fuse/opcode.go
View file @
cc423d1b
...
@@ -15,60 +15,60 @@ import (
...
@@ -15,60 +15,60 @@ import (
)
)
const
(
const
(
_OP_LOOKUP
=
int32
(
1
)
_OP_LOOKUP
=
u
int32
(
1
)
_OP_FORGET
=
int32
(
2
)
_OP_FORGET
=
u
int32
(
2
)
_OP_GETATTR
=
int32
(
3
)
_OP_GETATTR
=
u
int32
(
3
)
_OP_SETATTR
=
int32
(
4
)
_OP_SETATTR
=
u
int32
(
4
)
_OP_READLINK
=
int32
(
5
)
_OP_READLINK
=
u
int32
(
5
)
_OP_SYMLINK
=
int32
(
6
)
_OP_SYMLINK
=
u
int32
(
6
)
_OP_MKNOD
=
int32
(
8
)
_OP_MKNOD
=
u
int32
(
8
)
_OP_MKDIR
=
int32
(
9
)
_OP_MKDIR
=
u
int32
(
9
)
_OP_UNLINK
=
int32
(
10
)
_OP_UNLINK
=
u
int32
(
10
)
_OP_RMDIR
=
int32
(
11
)
_OP_RMDIR
=
u
int32
(
11
)
_OP_RENAME
=
int32
(
12
)
_OP_RENAME
=
u
int32
(
12
)
_OP_LINK
=
int32
(
13
)
_OP_LINK
=
u
int32
(
13
)
_OP_OPEN
=
int32
(
14
)
_OP_OPEN
=
u
int32
(
14
)
_OP_READ
=
int32
(
15
)
_OP_READ
=
u
int32
(
15
)
_OP_WRITE
=
int32
(
16
)
_OP_WRITE
=
u
int32
(
16
)
_OP_STATFS
=
int32
(
17
)
_OP_STATFS
=
u
int32
(
17
)
_OP_RELEASE
=
int32
(
18
)
_OP_RELEASE
=
u
int32
(
18
)
_OP_FSYNC
=
int32
(
20
)
_OP_FSYNC
=
u
int32
(
20
)
_OP_SETXATTR
=
int32
(
21
)
_OP_SETXATTR
=
u
int32
(
21
)
_OP_GETXATTR
=
int32
(
22
)
_OP_GETXATTR
=
u
int32
(
22
)
_OP_LISTXATTR
=
int32
(
23
)
_OP_LISTXATTR
=
u
int32
(
23
)
_OP_REMOVEXATTR
=
int32
(
24
)
_OP_REMOVEXATTR
=
u
int32
(
24
)
_OP_FLUSH
=
int32
(
25
)
_OP_FLUSH
=
u
int32
(
25
)
_OP_INIT
=
int32
(
26
)
_OP_INIT
=
u
int32
(
26
)
_OP_OPENDIR
=
int32
(
27
)
_OP_OPENDIR
=
u
int32
(
27
)
_OP_READDIR
=
int32
(
28
)
_OP_READDIR
=
u
int32
(
28
)
_OP_RELEASEDIR
=
int32
(
29
)
_OP_RELEASEDIR
=
u
int32
(
29
)
_OP_FSYNCDIR
=
int32
(
30
)
_OP_FSYNCDIR
=
u
int32
(
30
)
_OP_GETLK
=
int32
(
31
)
_OP_GETLK
=
u
int32
(
31
)
_OP_SETLK
=
int32
(
32
)
_OP_SETLK
=
u
int32
(
32
)
_OP_SETLKW
=
int32
(
33
)
_OP_SETLKW
=
u
int32
(
33
)
_OP_ACCESS
=
int32
(
34
)
_OP_ACCESS
=
u
int32
(
34
)
_OP_CREATE
=
int32
(
35
)
_OP_CREATE
=
u
int32
(
35
)
_OP_INTERRUPT
=
int32
(
36
)
_OP_INTERRUPT
=
u
int32
(
36
)
_OP_BMAP
=
int32
(
37
)
_OP_BMAP
=
u
int32
(
37
)
_OP_DESTROY
=
int32
(
38
)
_OP_DESTROY
=
u
int32
(
38
)
_OP_IOCTL
=
int32
(
39
)
_OP_IOCTL
=
u
int32
(
39
)
_OP_POLL
=
int32
(
40
)
_OP_POLL
=
u
int32
(
40
)
_OP_NOTIFY_REPLY
=
int32
(
41
)
_OP_NOTIFY_REPLY
=
u
int32
(
41
)
_OP_BATCH_FORGET
=
int32
(
42
)
_OP_BATCH_FORGET
=
u
int32
(
42
)
_OP_FALLOCATE
=
int32
(
43
)
// protocol version 19.
_OP_FALLOCATE
=
u
int32
(
43
)
// protocol version 19.
_OP_READDIRPLUS
=
int32
(
44
)
// protocol version 21.
_OP_READDIRPLUS
=
u
int32
(
44
)
// protocol version 21.
_OP_RENAME2
=
int32
(
45
)
// protocol version 23.
_OP_RENAME2
=
u
int32
(
45
)
// protocol version 23.
_OP_LSEEK
=
int32
(
46
)
_OP_LSEEK
=
u
int32
(
46
)
_OP_COPY_FILE_RANGE
=
int32
(
47
)
_OP_COPY_FILE_RANGE
=
u
int32
(
47
)
// The following entries don't have to be compatible across Go-FUSE versions.
// The following entries don't have to be compatible across Go-FUSE versions.
_OP_NOTIFY_INVAL_ENTRY
=
int32
(
100
)
_OP_NOTIFY_INVAL_ENTRY
=
u
int32
(
100
)
_OP_NOTIFY_INVAL_INODE
=
int32
(
101
)
_OP_NOTIFY_INVAL_INODE
=
u
int32
(
101
)
_OP_NOTIFY_STORE_CACHE
=
int32
(
102
)
_OP_NOTIFY_STORE_CACHE
=
u
int32
(
102
)
_OP_NOTIFY_RETRIEVE_CACHE
=
int32
(
103
)
_OP_NOTIFY_RETRIEVE_CACHE
=
u
int32
(
103
)
_OP_NOTIFY_DELETE
=
int32
(
104
)
// protocol version 18
_OP_NOTIFY_DELETE
=
u
int32
(
104
)
// protocol version 18
_OPCODE_COUNT
=
int32
(
105
)
_OPCODE_COUNT
=
u
int32
(
105
)
)
)
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
...
@@ -492,7 +492,7 @@ type operationHandler struct {
...
@@ -492,7 +492,7 @@ type operationHandler struct {
var
operationHandlers
[]
*
operationHandler
var
operationHandlers
[]
*
operationHandler
func
operationName
(
op
int32
)
string
{
func
operationName
(
op
u
int32
)
string
{
h
:=
getHandler
(
op
)
h
:=
getHandler
(
op
)
if
h
==
nil
{
if
h
==
nil
{
return
"unknown"
return
"unknown"
...
@@ -500,7 +500,7 @@ func operationName(op int32) string {
...
@@ -500,7 +500,7 @@ func operationName(op int32) string {
return
h
.
Name
return
h
.
Name
}
}
func
getHandler
(
o
int32
)
*
operationHandler
{
func
getHandler
(
o
u
int32
)
*
operationHandler
{
if
o
>=
_OPCODE_COUNT
{
if
o
>=
_OPCODE_COUNT
{
return
nil
return
nil
}
}
...
@@ -513,12 +513,12 @@ func init() {
...
@@ -513,12 +513,12 @@ func init() {
operationHandlers
[
i
]
=
&
operationHandler
{
Name
:
fmt
.
Sprintf
(
"OPCODE-%d"
,
i
)}
operationHandlers
[
i
]
=
&
operationHandler
{
Name
:
fmt
.
Sprintf
(
"OPCODE-%d"
,
i
)}
}
}
fileOps
:=
[]
int32
{
_OP_READLINK
,
_OP_NOTIFY_INVAL_ENTRY
,
_OP_NOTIFY_DELETE
}
fileOps
:=
[]
u
int32
{
_OP_READLINK
,
_OP_NOTIFY_INVAL_ENTRY
,
_OP_NOTIFY_DELETE
}
for
_
,
op
:=
range
fileOps
{
for
_
,
op
:=
range
fileOps
{
operationHandlers
[
op
]
.
FileNameOut
=
true
operationHandlers
[
op
]
.
FileNameOut
=
true
}
}
for
op
,
sz
:=
range
map
[
int32
]
uintptr
{
for
op
,
sz
:=
range
map
[
u
int32
]
uintptr
{
_OP_FORGET
:
unsafe
.
Sizeof
(
ForgetIn
{}),
_OP_FORGET
:
unsafe
.
Sizeof
(
ForgetIn
{}),
_OP_BATCH_FORGET
:
unsafe
.
Sizeof
(
_BatchForgetIn
{}),
_OP_BATCH_FORGET
:
unsafe
.
Sizeof
(
_BatchForgetIn
{}),
_OP_GETATTR
:
unsafe
.
Sizeof
(
GetAttrIn
{}),
_OP_GETATTR
:
unsafe
.
Sizeof
(
GetAttrIn
{}),
...
@@ -560,7 +560,7 @@ func init() {
...
@@ -560,7 +560,7 @@ func init() {
operationHandlers
[
op
]
.
InputSize
=
sz
operationHandlers
[
op
]
.
InputSize
=
sz
}
}
for
op
,
sz
:=
range
map
[
int32
]
uintptr
{
for
op
,
sz
:=
range
map
[
u
int32
]
uintptr
{
_OP_LOOKUP
:
unsafe
.
Sizeof
(
EntryOut
{}),
_OP_LOOKUP
:
unsafe
.
Sizeof
(
EntryOut
{}),
_OP_GETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
_OP_GETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
_OP_SETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
_OP_SETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
...
@@ -591,7 +591,7 @@ func init() {
...
@@ -591,7 +591,7 @@ func init() {
operationHandlers
[
op
]
.
OutputSize
=
sz
operationHandlers
[
op
]
.
OutputSize
=
sz
}
}
for
op
,
v
:=
range
map
[
int32
]
string
{
for
op
,
v
:=
range
map
[
u
int32
]
string
{
_OP_LOOKUP
:
"LOOKUP"
,
_OP_LOOKUP
:
"LOOKUP"
,
_OP_FORGET
:
"FORGET"
,
_OP_FORGET
:
"FORGET"
,
_OP_BATCH_FORGET
:
"BATCH_FORGET"
,
_OP_BATCH_FORGET
:
"BATCH_FORGET"
,
...
@@ -646,7 +646,7 @@ func init() {
...
@@ -646,7 +646,7 @@ func init() {
operationHandlers
[
op
]
.
Name
=
v
operationHandlers
[
op
]
.
Name
=
v
}
}
for
op
,
v
:=
range
map
[
int32
]
operationFunc
{
for
op
,
v
:=
range
map
[
u
int32
]
operationFunc
{
_OP_OPEN
:
doOpen
,
_OP_OPEN
:
doOpen
,
_OP_READDIR
:
doReadDir
,
_OP_READDIR
:
doReadDir
,
_OP_WRITE
:
doWrite
,
_OP_WRITE
:
doWrite
,
...
@@ -695,7 +695,7 @@ func init() {
...
@@ -695,7 +695,7 @@ func init() {
}
}
// Outputs.
// Outputs.
for
op
,
f
:=
range
map
[
int32
]
castPointerFunc
{
for
op
,
f
:=
range
map
[
u
int32
]
castPointerFunc
{
_OP_LOOKUP
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
EntryOut
)(
ptr
)
},
_OP_LOOKUP
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
EntryOut
)(
ptr
)
},
_OP_OPEN
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
OpenOut
)(
ptr
)
},
_OP_OPEN
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
OpenOut
)(
ptr
)
},
_OP_OPENDIR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
OpenOut
)(
ptr
)
},
_OP_OPENDIR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
OpenOut
)(
ptr
)
},
...
@@ -720,7 +720,7 @@ func init() {
...
@@ -720,7 +720,7 @@ func init() {
}
}
// Inputs.
// Inputs.
for
op
,
f
:=
range
map
[
int32
]
castPointerFunc
{
for
op
,
f
:=
range
map
[
u
int32
]
castPointerFunc
{
_OP_FLUSH
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
FlushIn
)(
ptr
)
},
_OP_FLUSH
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
FlushIn
)(
ptr
)
},
_OP_GETATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
GetAttrIn
)(
ptr
)
},
_OP_GETATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
GetAttrIn
)(
ptr
)
},
_OP_SETXATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
SetXAttrIn
)(
ptr
)
},
_OP_SETXATTR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
SetXAttrIn
)(
ptr
)
},
...
@@ -757,7 +757,7 @@ func init() {
...
@@ -757,7 +757,7 @@ func init() {
}
}
// File name args.
// File name args.
for
op
,
count
:=
range
map
[
int32
]
int
{
for
op
,
count
:=
range
map
[
u
int32
]
int
{
_OP_CREATE
:
1
,
_OP_CREATE
:
1
,
_OP_SETXATTR
:
1
,
_OP_SETXATTR
:
1
,
_OP_GETXATTR
:
1
,
_OP_GETXATTR
:
1
,
...
...
fuse/types.go
View file @
cc423d1b
...
@@ -601,7 +601,7 @@ type Caller struct {
...
@@ -601,7 +601,7 @@ type Caller struct {
type
InHeader
struct
{
type
InHeader
struct
{
Length
uint32
Length
uint32
Opcode
int32
Opcode
u
int32
Unique
uint64
Unique
uint64
NodeId
uint64
NodeId
uint64
Caller
Caller
...
...
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