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
ed37744c
Commit
ed37744c
authored
Mar 29, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Access type.
parent
1ee2df8c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
31 deletions
+31
-31
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
+3
-3
fuse/typeprint.go
fuse/typeprint.go
+0
-10
fuse/types.go
fuse/types.go
+0
-14
raw/print.go
raw/print.go
+11
-0
raw/types.go
raw/types.go
+13
-0
No files found.
fuse/api.go
View file @
ed37744c
...
@@ -266,7 +266,7 @@ type RawFileSystem interface {
...
@@ -266,7 +266,7 @@ type RawFileSystem interface {
Symlink
(
header
*
InHeader
,
pointedTo
string
,
linkName
string
)
(
out
*
EntryOut
,
code
Status
)
Symlink
(
header
*
InHeader
,
pointedTo
string
,
linkName
string
)
(
out
*
EntryOut
,
code
Status
)
Readlink
(
header
*
InHeader
)
(
out
[]
byte
,
code
Status
)
Readlink
(
header
*
InHeader
)
(
out
[]
byte
,
code
Status
)
Access
(
header
*
InHeader
,
input
*
AccessIn
)
(
code
Status
)
Access
(
header
*
InHeader
,
input
*
raw
.
AccessIn
)
(
code
Status
)
// Extended attributes.
// Extended attributes.
GetXAttrSize
(
header
*
InHeader
,
attr
string
)
(
sz
int
,
code
Status
)
GetXAttrSize
(
header
*
InHeader
,
attr
string
)
(
sz
int
,
code
Status
)
...
...
fuse/defaultraw.go
View file @
ed37744c
...
@@ -82,7 +82,7 @@ func (me *DefaultRawFileSystem) RemoveXAttr(header *InHeader, attr string) Statu
...
@@ -82,7 +82,7 @@ func (me *DefaultRawFileSystem) RemoveXAttr(header *InHeader, attr string) Statu
return
ENOSYS
return
ENOSYS
}
}
func
(
me
*
DefaultRawFileSystem
)
Access
(
header
*
InHeader
,
input
*
AccessIn
)
(
code
Status
)
{
func
(
me
*
DefaultRawFileSystem
)
Access
(
header
*
InHeader
,
input
*
raw
.
AccessIn
)
(
code
Status
)
{
return
ENOSYS
return
ENOSYS
}
}
...
...
fuse/fsops.go
View file @
ed37744c
...
@@ -262,7 +262,7 @@ func (me *FileSystemConnector) Link(header *InHeader, input *raw.LinkIn, name st
...
@@ -262,7 +262,7 @@ func (me *FileSystemConnector) Link(header *InHeader, input *raw.LinkIn, name st
return
out
,
code
return
out
,
code
}
}
func
(
me
*
FileSystemConnector
)
Access
(
header
*
InHeader
,
input
*
AccessIn
)
(
code
Status
)
{
func
(
me
*
FileSystemConnector
)
Access
(
header
*
InHeader
,
input
*
raw
.
AccessIn
)
(
code
Status
)
{
n
:=
me
.
toInode
(
header
.
NodeId
)
n
:=
me
.
toInode
(
header
.
NodeId
)
return
n
.
fsInode
.
Access
(
input
.
Mask
,
&
header
.
Context
)
return
n
.
fsInode
.
Access
(
input
.
Mask
,
&
header
.
Context
)
}
}
...
...
fuse/lockingfs.go
View file @
ed37744c
...
@@ -250,7 +250,7 @@ func (me *LockingRawFileSystem) RemoveXAttr(header *InHeader, attr string) Statu
...
@@ -250,7 +250,7 @@ func (me *LockingRawFileSystem) RemoveXAttr(header *InHeader, attr string) Statu
return
me
.
RawFileSystem
.
RemoveXAttr
(
header
,
attr
)
return
me
.
RawFileSystem
.
RemoveXAttr
(
header
,
attr
)
}
}
func
(
me
*
LockingRawFileSystem
)
Access
(
header
*
InHeader
,
input
*
AccessIn
)
(
code
Status
)
{
func
(
me
*
LockingRawFileSystem
)
Access
(
header
*
InHeader
,
input
*
raw
.
AccessIn
)
(
code
Status
)
{
defer
me
.
locked
()()
defer
me
.
locked
()()
return
me
.
RawFileSystem
.
Access
(
header
,
input
)
return
me
.
RawFileSystem
.
Access
(
header
,
input
)
}
}
...
...
fuse/opcode.go
View file @
ed37744c
...
@@ -309,7 +309,7 @@ func doRemoveXAttr(state *MountState, req *request) {
...
@@ -309,7 +309,7 @@ func doRemoveXAttr(state *MountState, req *request) {
}
}
func
doAccess
(
state
*
MountState
,
req
*
request
)
{
func
doAccess
(
state
*
MountState
,
req
*
request
)
{
req
.
status
=
state
.
fileSystem
.
Access
(
req
.
inHeader
,
(
*
AccessIn
)(
req
.
inData
))
req
.
status
=
state
.
fileSystem
.
Access
(
req
.
inHeader
,
(
*
raw
.
AccessIn
)(
req
.
inData
))
}
}
func
doSymlink
(
state
*
MountState
,
req
*
request
)
{
func
doSymlink
(
state
*
MountState
,
req
*
request
)
{
...
@@ -410,7 +410,7 @@ func init() {
...
@@ -410,7 +410,7 @@ func init() {
_OP_READDIR
:
unsafe
.
Sizeof
(
ReadIn
{}),
_OP_READDIR
:
unsafe
.
Sizeof
(
ReadIn
{}),
_OP_RELEASEDIR
:
unsafe
.
Sizeof
(
raw
.
ReleaseIn
{}),
_OP_RELEASEDIR
:
unsafe
.
Sizeof
(
raw
.
ReleaseIn
{}),
_OP_FSYNCDIR
:
unsafe
.
Sizeof
(
FsyncIn
{}),
_OP_FSYNCDIR
:
unsafe
.
Sizeof
(
FsyncIn
{}),
_OP_ACCESS
:
unsafe
.
Sizeof
(
AccessIn
{}),
_OP_ACCESS
:
unsafe
.
Sizeof
(
raw
.
AccessIn
{}),
_OP_CREATE
:
unsafe
.
Sizeof
(
CreateIn
{}),
_OP_CREATE
:
unsafe
.
Sizeof
(
CreateIn
{}),
_OP_INTERRUPT
:
unsafe
.
Sizeof
(
raw
.
InterruptIn
{}),
_OP_INTERRUPT
:
unsafe
.
Sizeof
(
raw
.
InterruptIn
{}),
_OP_BMAP
:
unsafe
.
Sizeof
(
raw
.
BmapIn
{}),
_OP_BMAP
:
unsafe
.
Sizeof
(
raw
.
BmapIn
{}),
...
@@ -558,7 +558,7 @@ func init() {
...
@@ -558,7 +558,7 @@ func init() {
_OP_CREATE
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
CreateIn
)(
ptr
)
},
_OP_CREATE
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
CreateIn
)(
ptr
)
},
_OP_READ
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
ReadIn
)(
ptr
)
},
_OP_READ
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
ReadIn
)(
ptr
)
},
_OP_READDIR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
ReadIn
)(
ptr
)
},
_OP_READDIR
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
ReadIn
)(
ptr
)
},
_OP_ACCESS
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
AccessIn
)(
ptr
)
},
_OP_ACCESS
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
AccessIn
)(
ptr
)
},
_OP_FORGET
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
ForgetIn
)(
ptr
)
},
_OP_FORGET
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
ForgetIn
)(
ptr
)
},
_OP_BATCH_FORGET
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
BatchForgetIn
)(
ptr
)
},
_OP_BATCH_FORGET
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
BatchForgetIn
)(
ptr
)
},
_OP_LINK
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
LinkIn
)(
ptr
)
},
_OP_LINK
:
func
(
ptr
unsafe
.
Pointer
)
interface
{}
{
return
(
*
raw
.
LinkIn
)(
ptr
)
},
...
...
fuse/typeprint.go
View file @
ed37744c
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
var
writeFlagNames
map
[
int
]
string
var
writeFlagNames
map
[
int
]
string
var
readFlagNames
map
[
int
]
string
var
readFlagNames
map
[
int
]
string
var
accessFlagName
map
[
int
]
string
func
init
()
{
func
init
()
{
writeFlagNames
=
map
[
int
]
string
{
writeFlagNames
=
map
[
int
]
string
{
...
@@ -17,11 +16,6 @@ func init() {
...
@@ -17,11 +16,6 @@ func init() {
readFlagNames
=
map
[
int
]
string
{
readFlagNames
=
map
[
int
]
string
{
READ_LOCKOWNER
:
"LOCKOWNER"
,
READ_LOCKOWNER
:
"LOCKOWNER"
,
}
}
accessFlagName
=
map
[
int
]
string
{
X_OK
:
"x"
,
W_OK
:
"w"
,
R_OK
:
"r"
,
}
}
}
func
(
me
*
Attr
)
String
()
string
{
func
(
me
*
Attr
)
String
()
string
{
...
@@ -75,10 +69,6 @@ func (me *FlushIn) String() string {
...
@@ -75,10 +69,6 @@ func (me *FlushIn) String() string {
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh
)
return
fmt
.
Sprintf
(
"{Fh %d}"
,
me
.
Fh
)
}
}
func
(
me
*
AccessIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{%s}"
,
raw
.
FlagString
(
accessFlagName
,
int
(
me
.
Mask
),
""
))
}
func
(
me
*
Kstatfs
)
String
()
string
{
func
(
me
*
Kstatfs
)
String
()
string
{
return
fmt
.
Sprintf
(
return
fmt
.
Sprintf
(
"{b%d f%d fs%d ff%d bs%d nl%d frs%d}"
,
"{b%d f%d fs%d ff%d bs%d nl%d frs%d}"
,
...
...
fuse/types.go
View file @
ed37744c
...
@@ -182,20 +182,6 @@ type FsyncIn struct {
...
@@ -182,20 +182,6 @@ type FsyncIn struct {
Padding
uint32
Padding
uint32
}
}
// For AccessIn.Mask.
const
(
X_OK
=
1
W_OK
=
2
R_OK
=
4
F_OK
=
0
)
type
AccessIn
struct
{
Mask
uint32
Padding
uint32
}
type
InHeader
struct
{
type
InHeader
struct
{
Length
uint32
Length
uint32
opcode
opcode
...
...
raw/print.go
View file @
ed37744c
...
@@ -10,6 +10,7 @@ var initFlagNames map[int]string
...
@@ -10,6 +10,7 @@ var initFlagNames map[int]string
var
releaseFlagNames
map
[
int
]
string
var
releaseFlagNames
map
[
int
]
string
var
OpenFlagNames
map
[
int
]
string
var
OpenFlagNames
map
[
int
]
string
var
FuseOpenFlagNames
map
[
int
]
string
var
FuseOpenFlagNames
map
[
int
]
string
var
accessFlagName
map
[
int
]
string
func
init
()
{
func
init
()
{
initFlagNames
=
map
[
int
]
string
{
initFlagNames
=
map
[
int
]
string
{
...
@@ -50,6 +51,12 @@ func init() {
...
@@ -50,6 +51,12 @@ func init() {
FOPEN_KEEP_CACHE
:
"CACHE"
,
FOPEN_KEEP_CACHE
:
"CACHE"
,
FOPEN_NONSEEKABLE
:
"NONSEEK"
,
FOPEN_NONSEEKABLE
:
"NONSEEK"
,
}
}
accessFlagName
=
map
[
int
]
string
{
X_OK
:
"x"
,
W_OK
:
"w"
,
R_OK
:
"r"
,
}
}
}
func
FlagString
(
names
map
[
int
]
string
,
fl
int
,
def
string
)
string
{
func
FlagString
(
names
map
[
int
]
string
,
fl
int
,
def
string
)
string
{
...
@@ -159,3 +166,7 @@ func (me *GetXAttrIn) String() string {
...
@@ -159,3 +166,7 @@ func (me *GetXAttrIn) String() string {
func
(
me
*
GetXAttrOut
)
String
()
string
{
func
(
me
*
GetXAttrOut
)
String
()
string
{
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
return
fmt
.
Sprintf
(
"{sz %d}"
,
me
.
Size
)
}
}
func
(
me
*
AccessIn
)
String
()
string
{
return
fmt
.
Sprintf
(
"{%s}"
,
FlagString
(
accessFlagName
,
int
(
me
.
Mask
),
""
))
}
raw/types.go
View file @
ed37744c
...
@@ -251,3 +251,16 @@ type LkIn struct {
...
@@ -251,3 +251,16 @@ type LkIn struct {
type
LkOut
struct
{
type
LkOut
struct
{
Lk
FileLock
Lk
FileLock
}
}
// For AccessIn.Mask.
const
(
X_OK
=
1
W_OK
=
2
R_OK
=
4
F_OK
=
0
)
type
AccessIn
struct
{
Mask
uint32
Padding
uint32
}
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