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
37690195
Commit
37690195
authored
Jul 07, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: rename state -> server in opcode.go.
parent
4275c93d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
79 deletions
+79
-79
fuse/opcode.go
fuse/opcode.go
+79
-79
No files found.
fuse/opcode.go
View file @
37690195
...
@@ -67,7 +67,7 @@ const (
...
@@ -67,7 +67,7 @@ const (
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
func
doInit
(
s
tate
*
Server
,
req
*
request
)
{
func
doInit
(
s
erver
*
Server
,
req
*
request
)
{
input
:=
(
*
raw
.
InitIn
)(
req
.
inData
)
input
:=
(
*
raw
.
InitIn
)(
req
.
inData
)
if
input
.
Major
!=
_FUSE_KERNEL_VERSION
{
if
input
.
Major
!=
_FUSE_KERNEL_VERSION
{
log
.
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
)
...
@@ -80,24 +80,24 @@ func doInit(state *Server, req *request) {
...
@@ -80,24 +80,24 @@ func doInit(state *Server, req *request) {
return
return
}
}
s
tate
.
reqMu
.
Lock
()
s
erver
.
reqMu
.
Lock
()
s
tate
.
kernelSettings
=
*
input
s
erver
.
kernelSettings
=
*
input
s
tate
.
kernelSettings
.
Flags
=
input
.
Flags
&
(
raw
.
CAP_ASYNC_READ
|
raw
.
CAP_BIG_WRITES
|
raw
.
CAP_FILE_OPS
|
s
erver
.
kernelSettings
.
Flags
=
input
.
Flags
&
(
raw
.
CAP_ASYNC_READ
|
raw
.
CAP_BIG_WRITES
|
raw
.
CAP_FILE_OPS
|
raw
.
CAP_AUTO_INVAL_DATA
|
raw
.
CAP_READDIRPLUS
)
raw
.
CAP_AUTO_INVAL_DATA
|
raw
.
CAP_READDIRPLUS
)
if
input
.
Minor
>=
13
{
if
input
.
Minor
>=
13
{
s
tate
.
setSplice
()
s
erver
.
setSplice
()
}
}
s
tate
.
reqMu
.
Unlock
()
s
erver
.
reqMu
.
Unlock
()
out
:=
&
raw
.
InitOut
{
out
:=
&
raw
.
InitOut
{
Major
:
_FUSE_KERNEL_VERSION
,
Major
:
_FUSE_KERNEL_VERSION
,
Minor
:
_OUR_MINOR_VERSION
,
Minor
:
_OUR_MINOR_VERSION
,
MaxReadAhead
:
input
.
MaxReadAhead
,
MaxReadAhead
:
input
.
MaxReadAhead
,
Flags
:
s
tate
.
kernelSettings
.
Flags
,
Flags
:
s
erver
.
kernelSettings
.
Flags
,
MaxWrite
:
uint32
(
s
tate
.
opts
.
MaxWrite
),
MaxWrite
:
uint32
(
s
erver
.
opts
.
MaxWrite
),
CongestionThreshold
:
uint16
(
s
tate
.
opts
.
MaxBackground
*
3
/
4
),
CongestionThreshold
:
uint16
(
s
erver
.
opts
.
MaxBackground
*
3
/
4
),
MaxBackground
:
uint16
(
s
tate
.
opts
.
MaxBackground
),
MaxBackground
:
uint16
(
s
erver
.
opts
.
MaxBackground
),
}
}
if
out
.
Minor
>
input
.
Minor
{
if
out
.
Minor
>
input
.
Minor
{
out
.
Minor
=
input
.
Minor
out
.
Minor
=
input
.
Minor
...
@@ -107,27 +107,27 @@ func doInit(state *Server, req *request) {
...
@@ -107,27 +107,27 @@ func doInit(state *Server, req *request) {
req
.
status
=
OK
req
.
status
=
OK
}
}
func
doOpen
(
s
tate
*
Server
,
req
*
request
)
{
func
doOpen
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
OpenOut
)(
req
.
outData
)
out
:=
(
*
raw
.
OpenOut
)(
req
.
outData
)
status
:=
s
tate
.
fileSystem
.
Open
(
out
,
&
req
.
context
,
(
*
raw
.
OpenIn
)(
req
.
inData
))
status
:=
s
erver
.
fileSystem
.
Open
(
out
,
&
req
.
context
,
(
*
raw
.
OpenIn
)(
req
.
inData
))
req
.
status
=
status
req
.
status
=
status
if
status
!=
OK
{
if
status
!=
OK
{
return
return
}
}
}
}
func
doCreate
(
s
tate
*
Server
,
req
*
request
)
{
func
doCreate
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
CreateOut
)(
req
.
outData
)
out
:=
(
*
raw
.
CreateOut
)(
req
.
outData
)
status
:=
s
tate
.
fileSystem
.
Create
(
out
,
&
req
.
context
,
(
*
raw
.
CreateIn
)(
req
.
inData
),
req
.
filenames
[
0
])
status
:=
s
erver
.
fileSystem
.
Create
(
out
,
&
req
.
context
,
(
*
raw
.
CreateIn
)(
req
.
inData
),
req
.
filenames
[
0
])
req
.
status
=
status
req
.
status
=
status
}
}
func
doReadDir
(
s
tate
*
Server
,
req
*
request
)
{
func
doReadDir
(
s
erver
*
Server
,
req
*
request
)
{
in
:=
(
*
raw
.
ReadIn
)(
req
.
inData
)
in
:=
(
*
raw
.
ReadIn
)(
req
.
inData
)
buf
:=
s
tate
.
allocOut
(
req
,
in
.
Size
)
buf
:=
s
erver
.
allocOut
(
req
,
in
.
Size
)
entries
:=
NewDirEntryList
(
buf
,
uint64
(
in
.
Offset
))
entries
:=
NewDirEntryList
(
buf
,
uint64
(
in
.
Offset
))
code
:=
s
tate
.
fileSystem
.
ReadDir
(
entries
,
&
req
.
context
,
in
)
code
:=
s
erver
.
fileSystem
.
ReadDir
(
entries
,
&
req
.
context
,
in
)
req
.
flatData
=
entries
.
bytes
()
req
.
flatData
=
entries
.
bytes
()
req
.
status
=
code
req
.
status
=
code
}
}
...
@@ -142,19 +142,19 @@ func doReadDirPlus(server *Server, req *request) {
...
@@ -142,19 +142,19 @@ func doReadDirPlus(server *Server, req *request) {
req
.
status
=
code
req
.
status
=
code
}
}
func
doOpenDir
(
s
tate
*
Server
,
req
*
request
)
{
func
doOpenDir
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
OpenOut
)(
req
.
outData
)
out
:=
(
*
raw
.
OpenOut
)(
req
.
outData
)
status
:=
s
tate
.
fileSystem
.
OpenDir
(
out
,
&
req
.
context
,
(
*
raw
.
OpenIn
)(
req
.
inData
))
status
:=
s
erver
.
fileSystem
.
OpenDir
(
out
,
&
req
.
context
,
(
*
raw
.
OpenIn
)(
req
.
inData
))
req
.
status
=
status
req
.
status
=
status
}
}
func
doSetattr
(
s
tate
*
Server
,
req
*
request
)
{
func
doSetattr
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
AttrOut
)(
req
.
outData
)
out
:=
(
*
raw
.
AttrOut
)(
req
.
outData
)
req
.
status
=
s
tate
.
fileSystem
.
SetAttr
(
out
,
&
req
.
context
,
(
*
raw
.
SetAttrIn
)(
req
.
inData
))
req
.
status
=
s
erver
.
fileSystem
.
SetAttr
(
out
,
&
req
.
context
,
(
*
raw
.
SetAttrIn
)(
req
.
inData
))
}
}
func
doWrite
(
s
tate
*
Server
,
req
*
request
)
{
func
doWrite
(
s
erver
*
Server
,
req
*
request
)
{
n
,
status
:=
s
tate
.
fileSystem
.
Write
(
&
req
.
context
,
(
*
raw
.
WriteIn
)(
req
.
inData
),
req
.
arg
)
n
,
status
:=
s
erver
.
fileSystem
.
Write
(
&
req
.
context
,
(
*
raw
.
WriteIn
)(
req
.
inData
),
req
.
arg
)
o
:=
(
*
raw
.
WriteOut
)(
req
.
outData
)
o
:=
(
*
raw
.
WriteOut
)(
req
.
outData
)
o
.
Size
=
n
o
.
Size
=
n
req
.
status
=
status
req
.
status
=
status
...
@@ -164,8 +164,8 @@ const _SECURITY_CAPABILITY = "security.capability"
...
@@ -164,8 +164,8 @@ const _SECURITY_CAPABILITY = "security.capability"
const
_SECURITY_ACL
=
"system.posix_acl_access"
const
_SECURITY_ACL
=
"system.posix_acl_access"
const
_SECURITY_ACL_DEFAULT
=
"system.posix_acl_default"
const
_SECURITY_ACL_DEFAULT
=
"system.posix_acl_default"
func
doGetXAttr
(
s
tate
*
Server
,
req
*
request
)
{
func
doGetXAttr
(
s
erver
*
Server
,
req
*
request
)
{
if
s
tate
.
opts
.
IgnoreSecurityLabels
&&
req
.
inHeader
.
Opcode
==
_OP_GETXATTR
{
if
s
erver
.
opts
.
IgnoreSecurityLabels
&&
req
.
inHeader
.
Opcode
==
_OP_GETXATTR
{
fn
:=
req
.
filenames
[
0
]
fn
:=
req
.
filenames
[
0
]
if
fn
==
_SECURITY_CAPABILITY
||
fn
==
_SECURITY_ACL_DEFAULT
||
if
fn
==
_SECURITY_CAPABILITY
||
fn
==
_SECURITY_ACL_DEFAULT
||
fn
==
_SECURITY_ACL
{
fn
==
_SECURITY_ACL
{
...
@@ -180,14 +180,14 @@ func doGetXAttr(state *Server, req *request) {
...
@@ -180,14 +180,14 @@ func doGetXAttr(state *Server, req *request) {
out
:=
(
*
raw
.
GetXAttrOut
)(
req
.
outData
)
out
:=
(
*
raw
.
GetXAttrOut
)(
req
.
outData
)
switch
req
.
inHeader
.
Opcode
{
switch
req
.
inHeader
.
Opcode
{
case
_OP_GETXATTR
:
case
_OP_GETXATTR
:
sz
,
code
:=
s
tate
.
fileSystem
.
GetXAttrSize
(
&
req
.
context
,
req
.
filenames
[
0
])
sz
,
code
:=
s
erver
.
fileSystem
.
GetXAttrSize
(
&
req
.
context
,
req
.
filenames
[
0
])
if
code
.
Ok
()
{
if
code
.
Ok
()
{
out
.
Size
=
uint32
(
sz
)
out
.
Size
=
uint32
(
sz
)
}
}
req
.
status
=
code
req
.
status
=
code
return
return
case
_OP_LISTXATTR
:
case
_OP_LISTXATTR
:
data
,
code
:=
s
tate
.
fileSystem
.
ListXAttr
(
&
req
.
context
)
data
,
code
:=
s
erver
.
fileSystem
.
ListXAttr
(
&
req
.
context
)
if
code
.
Ok
()
{
if
code
.
Ok
()
{
out
.
Size
=
uint32
(
len
(
data
))
out
.
Size
=
uint32
(
len
(
data
))
}
}
...
@@ -200,9 +200,9 @@ func doGetXAttr(state *Server, req *request) {
...
@@ -200,9 +200,9 @@ func doGetXAttr(state *Server, req *request) {
var
data
[]
byte
var
data
[]
byte
switch
req
.
inHeader
.
Opcode
{
switch
req
.
inHeader
.
Opcode
{
case
_OP_GETXATTR
:
case
_OP_GETXATTR
:
data
,
req
.
status
=
s
tate
.
fileSystem
.
GetXAttrData
(
&
req
.
context
,
req
.
filenames
[
0
])
data
,
req
.
status
=
s
erver
.
fileSystem
.
GetXAttrData
(
&
req
.
context
,
req
.
filenames
[
0
])
case
_OP_LISTXATTR
:
case
_OP_LISTXATTR
:
data
,
req
.
status
=
s
tate
.
fileSystem
.
ListXAttr
(
&
req
.
context
)
data
,
req
.
status
=
s
erver
.
fileSystem
.
ListXAttr
(
&
req
.
context
)
default
:
default
:
log
.
Panicf
(
"xattr opcode %v"
,
req
.
inHeader
.
Opcode
)
log
.
Panicf
(
"xattr opcode %v"
,
req
.
inHeader
.
Opcode
)
req
.
status
=
ENOSYS
req
.
status
=
ENOSYS
...
@@ -219,19 +219,19 @@ func doGetXAttr(state *Server, req *request) {
...
@@ -219,19 +219,19 @@ func doGetXAttr(state *Server, req *request) {
req
.
flatData
=
data
req
.
flatData
=
data
}
}
func
doGetAttr
(
s
tate
*
Server
,
req
*
request
)
{
func
doGetAttr
(
s
erver
*
Server
,
req
*
request
)
{
attrOut
:=
(
*
raw
.
AttrOut
)(
req
.
outData
)
attrOut
:=
(
*
raw
.
AttrOut
)(
req
.
outData
)
s
:=
s
tate
.
fileSystem
.
GetAttr
(
attrOut
,
&
req
.
context
,
(
*
raw
.
GetAttrIn
)(
req
.
inData
))
s
:=
s
erver
.
fileSystem
.
GetAttr
(
attrOut
,
&
req
.
context
,
(
*
raw
.
GetAttrIn
)(
req
.
inData
))
req
.
status
=
s
req
.
status
=
s
}
}
func
doForget
(
s
tate
*
Server
,
req
*
request
)
{
func
doForget
(
s
erver
*
Server
,
req
*
request
)
{
if
!
s
tate
.
opts
.
RememberInodes
{
if
!
s
erver
.
opts
.
RememberInodes
{
s
tate
.
fileSystem
.
Forget
(
req
.
inHeader
.
NodeId
,
(
*
raw
.
ForgetIn
)(
req
.
inData
)
.
Nlookup
)
s
erver
.
fileSystem
.
Forget
(
req
.
inHeader
.
NodeId
,
(
*
raw
.
ForgetIn
)(
req
.
inData
)
.
Nlookup
)
}
}
}
}
func
doBatchForget
(
s
tate
*
Server
,
req
*
request
)
{
func
doBatchForget
(
s
erver
*
Server
,
req
*
request
)
{
in
:=
(
*
raw
.
BatchForgetIn
)(
req
.
inData
)
in
:=
(
*
raw
.
BatchForgetIn
)(
req
.
inData
)
wantBytes
:=
uintptr
(
in
.
Count
)
*
unsafe
.
Sizeof
(
raw
.
BatchForgetIn
{})
wantBytes
:=
uintptr
(
in
.
Count
)
*
unsafe
.
Sizeof
(
raw
.
BatchForgetIn
{})
if
uintptr
(
len
(
req
.
arg
))
<
wantBytes
{
if
uintptr
(
len
(
req
.
arg
))
<
wantBytes
{
...
@@ -244,50 +244,50 @@ func doBatchForget(state *Server, req *request) {
...
@@ -244,50 +244,50 @@ func doBatchForget(state *Server, req *request) {
forgets
:=
*
(
*
[]
raw
.
ForgetOne
)(
unsafe
.
Pointer
(
h
))
forgets
:=
*
(
*
[]
raw
.
ForgetOne
)(
unsafe
.
Pointer
(
h
))
for
_
,
f
:=
range
forgets
{
for
_
,
f
:=
range
forgets
{
s
tate
.
fileSystem
.
Forget
(
f
.
NodeId
,
f
.
Nlookup
)
s
erver
.
fileSystem
.
Forget
(
f
.
NodeId
,
f
.
Nlookup
)
}
}
}
}
func
doReadlink
(
s
tate
*
Server
,
req
*
request
)
{
func
doReadlink
(
s
erver
*
Server
,
req
*
request
)
{
req
.
flatData
,
req
.
status
=
s
tate
.
fileSystem
.
Readlink
(
&
req
.
context
)
req
.
flatData
,
req
.
status
=
s
erver
.
fileSystem
.
Readlink
(
&
req
.
context
)
}
}
func
doLookup
(
s
tate
*
Server
,
req
*
request
)
{
func
doLookup
(
s
erver
*
Server
,
req
*
request
)
{
lookupOut
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
lookupOut
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
s
:=
s
tate
.
fileSystem
.
Lookup
(
lookupOut
,
&
req
.
context
,
req
.
filenames
[
0
])
s
:=
s
erver
.
fileSystem
.
Lookup
(
lookupOut
,
&
req
.
context
,
req
.
filenames
[
0
])
req
.
status
=
s
req
.
status
=
s
req
.
outData
=
unsafe
.
Pointer
(
lookupOut
)
req
.
outData
=
unsafe
.
Pointer
(
lookupOut
)
}
}
func
doMknod
(
s
tate
*
Server
,
req
*
request
)
{
func
doMknod
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
req
.
status
=
s
tate
.
fileSystem
.
Mknod
(
out
,
&
req
.
context
,
(
*
raw
.
MknodIn
)(
req
.
inData
),
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
Mknod
(
out
,
&
req
.
context
,
(
*
raw
.
MknodIn
)(
req
.
inData
),
req
.
filenames
[
0
])
}
}
func
doMkdir
(
s
tate
*
Server
,
req
*
request
)
{
func
doMkdir
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
req
.
status
=
s
tate
.
fileSystem
.
Mkdir
(
out
,
&
req
.
context
,
(
*
raw
.
MkdirIn
)(
req
.
inData
),
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
Mkdir
(
out
,
&
req
.
context
,
(
*
raw
.
MkdirIn
)(
req
.
inData
),
req
.
filenames
[
0
])
}
}
func
doUnlink
(
s
tate
*
Server
,
req
*
request
)
{
func
doUnlink
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Unlink
(
&
req
.
context
,
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
Unlink
(
&
req
.
context
,
req
.
filenames
[
0
])
}
}
func
doRmdir
(
s
tate
*
Server
,
req
*
request
)
{
func
doRmdir
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Rmdir
(
&
req
.
context
,
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
Rmdir
(
&
req
.
context
,
req
.
filenames
[
0
])
}
}
func
doLink
(
s
tate
*
Server
,
req
*
request
)
{
func
doLink
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
req
.
status
=
s
tate
.
fileSystem
.
Link
(
out
,
&
req
.
context
,
(
*
raw
.
LinkIn
)(
req
.
inData
),
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
Link
(
out
,
&
req
.
context
,
(
*
raw
.
LinkIn
)(
req
.
inData
),
req
.
filenames
[
0
])
}
}
func
doRead
(
s
tate
*
Server
,
req
*
request
)
{
func
doRead
(
s
erver
*
Server
,
req
*
request
)
{
in
:=
(
*
raw
.
ReadIn
)(
req
.
inData
)
in
:=
(
*
raw
.
ReadIn
)(
req
.
inData
)
buf
:=
s
tate
.
allocOut
(
req
,
in
.
Size
)
buf
:=
s
erver
.
allocOut
(
req
,
in
.
Size
)
req
.
readResult
,
req
.
status
=
s
tate
.
fileSystem
.
Read
(
&
req
.
context
,
in
,
buf
)
req
.
readResult
,
req
.
status
=
s
erver
.
fileSystem
.
Read
(
&
req
.
context
,
in
,
buf
)
if
fd
,
ok
:=
req
.
readResult
.
(
*
readResultFd
);
ok
{
if
fd
,
ok
:=
req
.
readResult
.
(
*
readResultFd
);
ok
{
req
.
fdData
=
fd
req
.
fdData
=
fd
req
.
flatData
=
nil
req
.
flatData
=
nil
...
@@ -296,63 +296,63 @@ func doRead(state *Server, req *request) {
...
@@ -296,63 +296,63 @@ func doRead(state *Server, req *request) {
}
}
}
}
func
doFlush
(
s
tate
*
Server
,
req
*
request
)
{
func
doFlush
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Flush
(
&
req
.
context
,
(
*
raw
.
FlushIn
)(
req
.
inData
))
req
.
status
=
s
erver
.
fileSystem
.
Flush
(
&
req
.
context
,
(
*
raw
.
FlushIn
)(
req
.
inData
))
}
}
func
doRelease
(
s
tate
*
Server
,
req
*
request
)
{
func
doRelease
(
s
erver
*
Server
,
req
*
request
)
{
s
tate
.
fileSystem
.
Release
(
&
req
.
context
,
(
*
raw
.
ReleaseIn
)(
req
.
inData
))
s
erver
.
fileSystem
.
Release
(
&
req
.
context
,
(
*
raw
.
ReleaseIn
)(
req
.
inData
))
}
}
func
doFsync
(
s
tate
*
Server
,
req
*
request
)
{
func
doFsync
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Fsync
(
&
req
.
context
,
(
*
raw
.
FsyncIn
)(
req
.
inData
))
req
.
status
=
s
erver
.
fileSystem
.
Fsync
(
&
req
.
context
,
(
*
raw
.
FsyncIn
)(
req
.
inData
))
}
}
func
doReleaseDir
(
s
tate
*
Server
,
req
*
request
)
{
func
doReleaseDir
(
s
erver
*
Server
,
req
*
request
)
{
s
tate
.
fileSystem
.
ReleaseDir
(
&
req
.
context
,
(
*
raw
.
ReleaseIn
)(
req
.
inData
))
s
erver
.
fileSystem
.
ReleaseDir
(
&
req
.
context
,
(
*
raw
.
ReleaseIn
)(
req
.
inData
))
}
}
func
doFsyncDir
(
s
tate
*
Server
,
req
*
request
)
{
func
doFsyncDir
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
FsyncDir
(
&
req
.
context
,
(
*
raw
.
FsyncIn
)(
req
.
inData
))
req
.
status
=
s
erver
.
fileSystem
.
FsyncDir
(
&
req
.
context
,
(
*
raw
.
FsyncIn
)(
req
.
inData
))
}
}
func
doSetXAttr
(
s
tate
*
Server
,
req
*
request
)
{
func
doSetXAttr
(
s
erver
*
Server
,
req
*
request
)
{
splits
:=
bytes
.
SplitN
(
req
.
arg
,
[]
byte
{
0
},
2
)
splits
:=
bytes
.
SplitN
(
req
.
arg
,
[]
byte
{
0
},
2
)
req
.
status
=
s
tate
.
fileSystem
.
SetXAttr
(
&
req
.
context
,
(
*
raw
.
SetXAttrIn
)(
req
.
inData
),
string
(
splits
[
0
]),
splits
[
1
])
req
.
status
=
s
erver
.
fileSystem
.
SetXAttr
(
&
req
.
context
,
(
*
raw
.
SetXAttrIn
)(
req
.
inData
),
string
(
splits
[
0
]),
splits
[
1
])
}
}
func
doRemoveXAttr
(
s
tate
*
Server
,
req
*
request
)
{
func
doRemoveXAttr
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
RemoveXAttr
(
&
req
.
context
,
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
RemoveXAttr
(
&
req
.
context
,
req
.
filenames
[
0
])
}
}
func
doAccess
(
s
tate
*
Server
,
req
*
request
)
{
func
doAccess
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Access
(
&
req
.
context
,
(
*
raw
.
AccessIn
)(
req
.
inData
))
req
.
status
=
s
erver
.
fileSystem
.
Access
(
&
req
.
context
,
(
*
raw
.
AccessIn
)(
req
.
inData
))
}
}
func
doSymlink
(
s
tate
*
Server
,
req
*
request
)
{
func
doSymlink
(
s
erver
*
Server
,
req
*
request
)
{
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
out
:=
(
*
raw
.
EntryOut
)(
req
.
outData
)
req
.
status
=
s
tate
.
fileSystem
.
Symlink
(
out
,
&
req
.
context
,
req
.
filenames
[
1
],
req
.
filenames
[
0
])
req
.
status
=
s
erver
.
fileSystem
.
Symlink
(
out
,
&
req
.
context
,
req
.
filenames
[
1
],
req
.
filenames
[
0
])
}
}
func
doRename
(
s
tate
*
Server
,
req
*
request
)
{
func
doRename
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Rename
(
&
req
.
context
,
(
*
raw
.
RenameIn
)(
req
.
inData
),
req
.
filenames
[
0
],
req
.
filenames
[
1
])
req
.
status
=
s
erver
.
fileSystem
.
Rename
(
&
req
.
context
,
(
*
raw
.
RenameIn
)(
req
.
inData
),
req
.
filenames
[
0
],
req
.
filenames
[
1
])
}
}
func
doStatFs
(
s
tate
*
Server
,
req
*
request
)
{
func
doStatFs
(
s
erver
*
Server
,
req
*
request
)
{
stat
:=
(
*
raw
.
StatfsOut
)(
req
.
outData
)
stat
:=
(
*
raw
.
StatfsOut
)(
req
.
outData
)
req
.
status
=
s
tate
.
fileSystem
.
StatFs
(
stat
,
&
req
.
context
)
req
.
status
=
s
erver
.
fileSystem
.
StatFs
(
stat
,
&
req
.
context
)
}
}
func
doIoctl
(
s
tate
*
Server
,
req
*
request
)
{
func
doIoctl
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
ENOSYS
req
.
status
=
ENOSYS
}
}
func
doDestroy
(
s
tate
*
Server
,
req
*
request
)
{
func
doDestroy
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
OK
req
.
status
=
OK
}
}
func
doFallocate
(
s
tate
*
Server
,
req
*
request
)
{
func
doFallocate
(
s
erver
*
Server
,
req
*
request
)
{
req
.
status
=
s
tate
.
fileSystem
.
Fallocate
(
&
req
.
context
,
(
*
raw
.
FallocateIn
)(
req
.
inData
))
req
.
status
=
s
erver
.
fileSystem
.
Fallocate
(
&
req
.
context
,
(
*
raw
.
FallocateIn
)(
req
.
inData
))
}
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
...
...
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