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
1ee2df8c
Commit
1ee2df8c
authored
Mar 29, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Xattr/lock/writeout types.
parent
7dd16a5e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
64 deletions
+65
-64
fuse/api.go
fuse/api.go
+1
-1
fuse/defaultraw.go
fuse/defaultraw.go
+1
-1
fuse/fsops.go
fuse/fsops.go
+1
-1
fuse/lockingfs.go
fuse/lockingfs.go
+1
-1
fuse/opcode.go
fuse/opcode.go
+10
-10
fuse/typeprint.go
fuse/typeprint.go
+0
-12
fuse/types.go
fuse/types.go
+0
-38
raw/print.go
raw/print.go
+12
-0
raw/types.go
raw/types.go
+39
-0
No files found.
fuse/api.go
View file @
1ee2df8c
...
...
@@ -272,7 +272,7 @@ type RawFileSystem interface {
GetXAttrSize
(
header
*
InHeader
,
attr
string
)
(
sz
int
,
code
Status
)
GetXAttrData
(
header
*
InHeader
,
attr
string
)
(
data
[]
byte
,
code
Status
)
ListXAttr
(
header
*
InHeader
)
(
attributes
[]
byte
,
code
Status
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
SetXAttr
(
header
*
InHeader
,
input
*
raw
.
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
code
Status
)
// File handling.
...
...
fuse/defaultraw.go
View file @
1ee2df8c
...
...
@@ -70,7 +70,7 @@ func (me *DefaultRawFileSystem) GetXAttrData(header *InHeader, attr string) (dat
return
nil
,
ENOSYS
}
func
(
me
*
DefaultRawFileSystem
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
func
(
me
*
DefaultRawFileSystem
)
SetXAttr
(
header
*
InHeader
,
input
*
raw
.
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
return
ENOSYS
}
...
...
fuse/fsops.go
View file @
1ee2df8c
...
...
@@ -307,7 +307,7 @@ func (me *FileSystemConnector) RemoveXAttr(header *InHeader, attr string) Status
return
node
.
fsInode
.
RemoveXAttr
(
attr
,
&
header
.
Context
)
}
func
(
me
*
FileSystemConnector
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
func
(
me
*
FileSystemConnector
)
SetXAttr
(
header
*
InHeader
,
input
*
raw
.
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
node
:=
me
.
toInode
(
header
.
NodeId
)
return
node
.
fsInode
.
SetXAttr
(
attr
,
data
,
int
(
input
.
Flags
),
&
header
.
Context
)
}
...
...
fuse/lockingfs.go
View file @
1ee2df8c
...
...
@@ -225,7 +225,7 @@ func (me *LockingRawFileSystem) Link(header *InHeader, input *raw.LinkIn, name s
return
me
.
RawFileSystem
.
Link
(
header
,
input
,
name
)
}
func
(
me
*
LockingRawFileSystem
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
func
(
me
*
LockingRawFileSystem
)
SetXAttr
(
header
*
InHeader
,
input
*
raw
.
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
defer
me
.
locked
()()
return
me
.
RawFileSystem
.
SetXAttr
(
header
,
input
,
attr
,
data
)
}
...
...
fuse/opcode.go
View file @
1ee2df8c
...
...
@@ -160,7 +160,7 @@ func doSetattr(state *MountState, req *request) {
func
doWrite
(
state
*
MountState
,
req
*
request
)
{
n
,
status
:=
state
.
fileSystem
.
Write
(
req
.
inHeader
,
(
*
WriteIn
)(
req
.
inData
),
req
.
arg
)
o
:=
&
WriteOut
{
o
:=
&
raw
.
WriteOut
{
Size
:
n
,
}
req
.
outData
=
unsafe
.
Pointer
(
o
)
...
...
@@ -181,13 +181,13 @@ func doGetXAttr(state *MountState, req *request) {
}
}
input
:=
(
*
GetXAttrIn
)(
req
.
inData
)
input
:=
(
*
raw
.
GetXAttrIn
)(
req
.
inData
)
var
data
[]
byte
switch
{
case
req
.
inHeader
.
opcode
==
_OP_GETXATTR
&&
input
.
Size
==
0
:
sz
,
code
:=
state
.
fileSystem
.
GetXAttrSize
(
req
.
inHeader
,
req
.
filenames
[
0
])
if
code
.
Ok
()
{
out
:=
&
GetXAttrOut
{
out
:=
&
raw
.
GetXAttrOut
{
Size
:
uint32
(
sz
),
}
req
.
outData
=
unsafe
.
Pointer
(
out
)
...
...
@@ -301,7 +301,7 @@ func doFsyncDir(state *MountState, req *request) {
func
doSetXAttr
(
state
*
MountState
,
req
*
request
)
{
splits
:=
bytes
.
SplitN
(
req
.
arg
,
[]
byte
{
0
},
2
)
req
.
status
=
state
.
fileSystem
.
SetXAttr
(
req
.
inHeader
,
(
*
SetXAttrIn
)(
req
.
inData
),
string
(
splits
[
0
]),
splits
[
1
])
req
.
status
=
state
.
fileSystem
.
SetXAttr
(
req
.
inHeader
,
(
*
raw
.
SetXAttrIn
)(
req
.
inData
),
string
(
splits
[
0
]),
splits
[
1
])
}
func
doRemoveXAttr
(
state
*
MountState
,
req
*
request
)
{
...
...
@@ -401,9 +401,9 @@ func init() {
_OP_WRITE
:
unsafe
.
Sizeof
(
WriteIn
{}),
_OP_RELEASE
:
unsafe
.
Sizeof
(
raw
.
ReleaseIn
{}),
_OP_FSYNC
:
unsafe
.
Sizeof
(
FsyncIn
{}),
_OP_SETXATTR
:
unsafe
.
Sizeof
(
SetXAttrIn
{}),
_OP_GETXATTR
:
unsafe
.
Sizeof
(
GetXAttrIn
{}),
_OP_LISTXATTR
:
unsafe
.
Sizeof
(
GetXAttrIn
{}),
_OP_SETXATTR
:
unsafe
.
Sizeof
(
raw
.
SetXAttrIn
{}),
_OP_GETXATTR
:
unsafe
.
Sizeof
(
raw
.
GetXAttrIn
{}),
_OP_LISTXATTR
:
unsafe
.
Sizeof
(
raw
.
GetXAttrIn
{}),
_OP_FLUSH
:
unsafe
.
Sizeof
(
FlushIn
{}),
_OP_INIT
:
unsafe
.
Sizeof
(
raw
.
InitIn
{}),
_OP_OPENDIR
:
unsafe
.
Sizeof
(
raw
.
OpenIn
{}),
...
...
@@ -429,10 +429,10 @@ func init() {
_OP_MKDIR
:
unsafe
.
Sizeof
(
EntryOut
{}),
_OP_LINK
:
unsafe
.
Sizeof
(
EntryOut
{}),
_OP_OPEN
:
unsafe
.
Sizeof
(
raw
.
OpenOut
{}),
_OP_WRITE
:
unsafe
.
Sizeof
(
WriteOut
{}),
_OP_WRITE
:
unsafe
.
Sizeof
(
raw
.
WriteOut
{}),
_OP_STATFS
:
unsafe
.
Sizeof
(
StatfsOut
{}),
_OP_GETXATTR
:
unsafe
.
Sizeof
(
GetXAttrOut
{}),
_OP_LISTXATTR
:
unsafe
.
Sizeof
(
GetXAttrOut
{}),
_OP_GETXATTR
:
unsafe
.
Sizeof
(
raw
.
GetXAttrOut
{}),
_OP_LISTXATTR
:
unsafe
.
Sizeof
(
raw
.
GetXAttrOut
{}),
_OP_INIT
:
unsafe
.
Sizeof
(
raw
.
InitOut
{}),
_OP_OPENDIR
:
unsafe
.
Sizeof
(
raw
.
OpenOut
{}),
_OP_CREATE
:
unsafe
.
Sizeof
(
CreateOut
{}),
...
...
fuse/typeprint.go
View file @
1ee2df8c
...
...
@@ -79,18 +79,6 @@ func (me *AccessIn) String() string {
return
fmt
.
Sprintf
(
"{%s}"
,
raw
.
FlagString
(
accessFlagName
,
int
(
me
.
Mask
),
""
))
}
func
(
me
*
SetXAttrIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d f%o}"
,
me
.
Size
,
me
.
Flags
)
}
func
(
me
*
GetXAttrIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
func
(
me
*
GetXAttrOut
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
func
(
me
*
Kstatfs
)
String
()
string
{
return
fmt
.
Sprintf
(
"{b%d f%d fs%d ff%d bs%d nl%d frs%d}"
,
...
...
fuse/types.go
View file @
1ee2df8c
...
...
@@ -107,13 +107,6 @@ type Kstatfs struct {
Spare
[
6
]
uint32
}
type
FileLock
struct
{
Start
uint64
End
uint64
Typ
uint32
Pid
uint32
}
type
EntryOut
struct
{
NodeId
uint64
Generation
uint64
...
...
@@ -179,11 +172,6 @@ type WriteIn struct {
Padding
uint32
}
type
WriteOut
struct
{
Size
uint32
Padding
uint32
}
type
StatfsOut
struct
{
Kstatfs
}
...
...
@@ -194,32 +182,6 @@ type FsyncIn struct {
Padding
uint32
}
type
SetXAttrIn
struct
{
Size
uint32
Flags
uint32
}
type
GetXAttrIn
struct
{
Size
uint32
Padding
uint32
}
type
GetXAttrOut
struct
{
Size
uint32
Padding
uint32
}
type
LkIn
struct
{
Fh
uint64
Owner
uint64
Lk
FileLock
LkFlags
uint32
Padding
uint32
}
type
LkOut
struct
{
Lk
FileLock
}
// For AccessIn.Mask.
const
(
...
...
raw/print.go
View file @
1ee2df8c
...
...
@@ -147,3 +147,15 @@ func (me *InitOut) String() string {
FlagString
(
initFlagNames
,
int
(
me
.
Flags
),
""
),
me
.
CongestionThreshold
,
me
.
MaxBackground
,
me
.
MaxWrite
)
}
func
(
me
*
SetXAttrIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d f%o}"
,
me
.
Size
,
me
.
Flags
)
}
func
(
me
*
GetXAttrIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
func
(
me
*
GetXAttrOut
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
raw/types.go
View file @
1ee2df8c
...
...
@@ -212,3 +212,42 @@ type PollOut struct {
type
NotifyPollWakeupOut
struct
{
Kh
uint64
}
type
WriteOut
struct
{
Size
uint32
Padding
uint32
}
type
SetXAttrIn
struct
{
Size
uint32
Flags
uint32
}
type
GetXAttrIn
struct
{
Size
uint32
Padding
uint32
}
type
GetXAttrOut
struct
{
Size
uint32
Padding
uint32
}
type
FileLock
struct
{
Start
uint64
End
uint64
Typ
uint32
Pid
uint32
}
type
LkIn
struct
{
Fh
uint64
Owner
uint64
Lk
FileLock
LkFlags
uint32
Padding
uint32
}
type
LkOut
struct
{
Lk
FileLock
}
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