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
279e23da
Commit
279e23da
authored
Mar 25, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt.
parent
2d84dd32
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
26 deletions
+23
-26
fuse/default.go
fuse/default.go
+5
-6
fuse/loopback.go
fuse/loopback.go
+1
-1
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+5
-5
fuse/timingfs.go
fuse/timingfs.go
+1
-2
fuse/timingrawfs.go
fuse/timingrawfs.go
+1
-2
fuse/types.go
fuse/types.go
+3
-3
fuse/wrappedfs.go
fuse/wrappedfs.go
+2
-2
fuse/xattr_test.go
fuse/xattr_test.go
+5
-5
No files found.
fuse/default.go
View file @
279e23da
...
@@ -69,15 +69,15 @@ func (me *DefaultRawFuseFileSystem) GetXAttr(header *InHeader, attr string) (dat
...
@@ -69,15 +69,15 @@ func (me *DefaultRawFuseFileSystem) GetXAttr(header *InHeader, attr string) (dat
return
nil
,
ENOSYS
return
nil
,
ENOSYS
}
}
func
(
me
*
DefaultRawFuseFileSystem
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
(
Status
)
{
func
(
me
*
DefaultRawFuseFileSystem
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
return
ENOSYS
return
ENOSYS
}
}
func
(
me
*
DefaultRawFuseFileSystem
)
ListXAttr
(
header
*
InHeader
)
(
data
[]
byte
,
code
Status
)
{
func
(
me
*
DefaultRawFuseFileSystem
)
ListXAttr
(
header
*
InHeader
)
(
data
[]
byte
,
code
Status
)
{
return
nil
,
ENOSYS
return
nil
,
ENOSYS
}
}
func
(
me
*
DefaultRawFuseFileSystem
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
Status
)
{
func
(
me
*
DefaultRawFuseFileSystem
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
Status
{
return
ENOSYS
return
ENOSYS
}
}
...
@@ -112,7 +112,6 @@ func (me *DefaultRawFuseFileSystem) ReleaseDir(header *InHeader, f RawFuseDir) {
...
@@ -112,7 +112,6 @@ func (me *DefaultRawFuseFileSystem) ReleaseDir(header *InHeader, f RawFuseDir) {
}
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// DefaultRawFuseFile
// DefaultRawFuseFile
...
@@ -162,7 +161,7 @@ func (me *DefaultPathFilesystem) GetXAttr(name string, attr string) ([]byte, Sta
...
@@ -162,7 +161,7 @@ func (me *DefaultPathFilesystem) GetXAttr(name string, attr string) ([]byte, Sta
return
nil
,
ENOSYS
return
nil
,
ENOSYS
}
}
func
(
me
*
DefaultPathFilesystem
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
(
Status
)
{
func
(
me
*
DefaultPathFilesystem
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
{
return
ENOSYS
return
ENOSYS
}
}
...
@@ -170,7 +169,7 @@ func (me *DefaultPathFilesystem) ListXAttr(name string) ([]string, Status) {
...
@@ -170,7 +169,7 @@ func (me *DefaultPathFilesystem) ListXAttr(name string) ([]string, Status) {
return
nil
,
ENOSYS
return
nil
,
ENOSYS
}
}
func
(
me
*
DefaultPathFilesystem
)
RemoveXAttr
(
name
string
,
attr
string
)
(
Status
)
{
func
(
me
*
DefaultPathFilesystem
)
RemoveXAttr
(
name
string
,
attr
string
)
Status
{
return
ENOSYS
return
ENOSYS
}
}
...
...
fuse/loopback.go
View file @
279e23da
...
@@ -158,7 +158,7 @@ func (me *LoopbackFileSystem) ListXAttr(name string) ([]string, Status) {
...
@@ -158,7 +158,7 @@ func (me *LoopbackFileSystem) ListXAttr(name string) ([]string, Status) {
return
data
,
Status
(
errNo
)
return
data
,
Status
(
errNo
)
}
}
func
(
me
*
LoopbackFileSystem
)
RemoveXAttr
(
name
string
,
attr
string
)
(
Status
)
{
func
(
me
*
LoopbackFileSystem
)
RemoveXAttr
(
name
string
,
attr
string
)
Status
{
return
Status
(
Removexattr
(
me
.
GetPath
(
name
),
attr
))
return
Status
(
Removexattr
(
me
.
GetPath
(
name
),
attr
))
}
}
...
...
fuse/pathfilesystem.go
View file @
279e23da
...
@@ -726,16 +726,16 @@ func (me *PathFileSystemConnector) GetXAttr(header *InHeader, attribute string)
...
@@ -726,16 +726,16 @@ func (me *PathFileSystemConnector) GetXAttr(header *InHeader, attribute string)
return
data
,
code
return
data
,
code
}
}
func
(
me
*
PathFileSystemConnector
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
Status
)
{
func
(
me
*
PathFileSystemConnector
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
Status
{
path
,
mount
:=
me
.
GetPath
(
header
.
NodeId
)
path
,
mount
:=
me
.
GetPath
(
header
.
NodeId
)
if
mount
==
nil
{
if
mount
==
nil
{
return
ENOENT
return
ENOENT
}
}
return
mount
.
fs
.
RemoveXAttr
(
path
,
attr
)
return
mount
.
fs
.
RemoveXAttr
(
path
,
attr
)
}
}
func
(
me
*
PathFileSystemConnector
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
(
Status
)
{
func
(
me
*
PathFileSystemConnector
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
{
path
,
mount
:=
me
.
GetPath
(
header
.
NodeId
)
path
,
mount
:=
me
.
GetPath
(
header
.
NodeId
)
if
mount
==
nil
{
if
mount
==
nil
{
return
ENOENT
return
ENOENT
...
@@ -743,7 +743,7 @@ func (me *PathFileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn,
...
@@ -743,7 +743,7 @@ func (me *PathFileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn,
return
mount
.
fs
.
SetXAttr
(
path
,
attr
,
data
,
int
(
input
.
Flags
))
return
mount
.
fs
.
SetXAttr
(
path
,
attr
,
data
,
int
(
input
.
Flags
))
}
}
func
(
me
*
PathFileSystemConnector
)
ListXAttr
(
header
*
InHeader
)
(
data
[]
byte
,
code
Status
)
{
func
(
me
*
PathFileSystemConnector
)
ListXAttr
(
header
*
InHeader
)
(
data
[]
byte
,
code
Status
)
{
path
,
mount
:=
me
.
GetPath
(
header
.
NodeId
)
path
,
mount
:=
me
.
GetPath
(
header
.
NodeId
)
if
mount
==
nil
{
if
mount
==
nil
{
...
@@ -760,7 +760,7 @@ func (me *PathFileSystemConnector) ListXAttr(header *InHeader) (data []byte, cod
...
@@ -760,7 +760,7 @@ func (me *PathFileSystemConnector) ListXAttr(header *InHeader) (data []byte, cod
b
.
Write
([]
byte
(
v
))
b
.
Write
([]
byte
(
v
))
b
.
WriteByte
(
0
)
b
.
WriteByte
(
0
)
}
}
return
b
.
Bytes
(),
code
return
b
.
Bytes
(),
code
}
}
...
...
fuse/timingfs.go
View file @
279e23da
...
@@ -106,7 +106,7 @@ func (me *TimingPathFilesystem) ListXAttr(name string) ([]string, Status) {
...
@@ -106,7 +106,7 @@ func (me *TimingPathFilesystem) ListXAttr(name string) ([]string, Status) {
return
me
.
original
.
ListXAttr
(
name
)
return
me
.
original
.
ListXAttr
(
name
)
}
}
func
(
me
*
TimingPathFilesystem
)
RemoveXAttr
(
name
string
,
attr
string
)
(
Status
)
{
func
(
me
*
TimingPathFilesystem
)
RemoveXAttr
(
name
string
,
attr
string
)
Status
{
defer
me
.
startTimer
(
"RemoveXAttr"
,
name
)()
defer
me
.
startTimer
(
"RemoveXAttr"
,
name
)()
return
me
.
original
.
RemoveXAttr
(
name
,
attr
)
return
me
.
original
.
RemoveXAttr
(
name
,
attr
)
}
}
...
@@ -200,4 +200,3 @@ func (me *TimingPathFilesystem) Utimens(name string, AtimeNs uint64, CtimeNs uin
...
@@ -200,4 +200,3 @@ func (me *TimingPathFilesystem) Utimens(name string, AtimeNs uint64, CtimeNs uin
defer
me
.
startTimer
(
"Utimens"
,
name
)()
defer
me
.
startTimer
(
"Utimens"
,
name
)()
return
me
.
original
.
Utimens
(
name
,
AtimeNs
,
CtimeNs
)
return
me
.
original
.
Utimens
(
name
,
AtimeNs
,
CtimeNs
)
}
}
fuse/timingrawfs.go
View file @
279e23da
...
@@ -136,7 +136,7 @@ func (me *TimingRawFilesystem) ListXAttr(header *InHeader) (data []byte, code St
...
@@ -136,7 +136,7 @@ func (me *TimingRawFilesystem) ListXAttr(header *InHeader) (data []byte, code St
return
me
.
original
.
ListXAttr
(
header
)
return
me
.
original
.
ListXAttr
(
header
)
}
}
func
(
me
*
TimingRawFilesystem
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
Status
)
{
func
(
me
*
TimingRawFilesystem
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
Status
{
defer
me
.
startTimer
(
"RemoveXAttr"
)()
defer
me
.
startTimer
(
"RemoveXAttr"
)()
return
me
.
original
.
RemoveXAttr
(
header
,
attr
)
return
me
.
original
.
RemoveXAttr
(
header
,
attr
)
}
}
...
@@ -180,4 +180,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
...
@@ -180,4 +180,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
defer
me
.
startTimer
(
"ReleaseDir"
)()
defer
me
.
startTimer
(
"ReleaseDir"
)()
me
.
original
.
ReleaseDir
(
header
,
f
)
me
.
original
.
ReleaseDir
(
header
,
f
)
}
}
fuse/types.go
View file @
279e23da
...
@@ -518,7 +518,7 @@ type RawFileSystem interface {
...
@@ -518,7 +518,7 @@ type RawFileSystem interface {
GetXAttr
(
header
*
InHeader
,
attr
string
)
(
data
[]
byte
,
code
Status
)
GetXAttr
(
header
*
InHeader
,
attr
string
)
(
data
[]
byte
,
code
Status
)
ListXAttr
(
header
*
InHeader
)
(
attributes
[]
byte
,
code
Status
)
ListXAttr
(
header
*
InHeader
)
(
attributes
[]
byte
,
code
Status
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
(
Status
)
SetXAttr
(
header
*
InHeader
,
input
*
SetXAttrIn
,
attr
string
,
data
[]
byte
)
Status
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
code
Status
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
code
Status
)
Access
(
header
*
InHeader
,
input
*
AccessIn
)
(
code
Status
)
Access
(
header
*
InHeader
,
input
*
AccessIn
)
(
code
Status
)
Create
(
header
*
InHeader
,
input
*
CreateIn
,
name
string
)
(
flags
uint32
,
fuseFile
RawFuseFile
,
out
*
EntryOut
,
code
Status
)
Create
(
header
*
InHeader
,
input
*
CreateIn
,
name
string
)
(
flags
uint32
,
fuseFile
RawFuseFile
,
out
*
EntryOut
,
code
Status
)
...
@@ -567,10 +567,10 @@ type PathFilesystem interface {
...
@@ -567,10 +567,10 @@ type PathFilesystem interface {
GetXAttr
(
name
string
,
attribute
string
)
(
data
[]
byte
,
code
Status
)
GetXAttr
(
name
string
,
attribute
string
)
(
data
[]
byte
,
code
Status
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
ListXAttr
(
name
string
)
(
attributes
[]
string
,
code
Status
)
ListXAttr
(
name
string
)
(
attributes
[]
string
,
code
Status
)
RemoveXAttr
(
name
string
,
attr
string
)
(
Status
)
RemoveXAttr
(
name
string
,
attr
string
)
Status
// Where to hook up statfs?
// Where to hook up statfs?
OpenDir
(
name
string
)
(
stream
chan
DirEntry
,
code
Status
)
OpenDir
(
name
string
)
(
stream
chan
DirEntry
,
code
Status
)
// TODO - what is a good interface?
// TODO - what is a good interface?
...
...
fuse/wrappedfs.go
View file @
279e23da
...
@@ -88,7 +88,7 @@ func (me *WrappingPathFilesystem) ListXAttr(name string) ([]string, Status) {
...
@@ -88,7 +88,7 @@ func (me *WrappingPathFilesystem) ListXAttr(name string) ([]string, Status) {
return
me
.
original
.
ListXAttr
(
name
)
return
me
.
original
.
ListXAttr
(
name
)
}
}
func
(
me
*
WrappingPathFilesystem
)
RemoveXAttr
(
name
string
,
attr
string
)
(
Status
)
{
func
(
me
*
WrappingPathFilesystem
)
RemoveXAttr
(
name
string
,
attr
string
)
Status
{
return
me
.
original
.
RemoveXAttr
(
name
,
attr
)
return
me
.
original
.
RemoveXAttr
(
name
,
attr
)
}
}
...
@@ -172,7 +172,7 @@ func (me *WrappingRawFilesystem) ListXAttr(header *InHeader) (data []byte, code
...
@@ -172,7 +172,7 @@ func (me *WrappingRawFilesystem) ListXAttr(header *InHeader) (data []byte, code
return
me
.
original
.
ListXAttr
(
header
)
return
me
.
original
.
ListXAttr
(
header
)
}
}
func
(
me
*
WrappingRawFilesystem
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
(
Status
)
{
func
(
me
*
WrappingRawFilesystem
)
RemoveXAttr
(
header
*
InHeader
,
attr
string
)
Status
{
return
me
.
original
.
RemoveXAttr
(
header
,
attr
)
return
me
.
original
.
RemoveXAttr
(
header
,
attr
)
}
}
...
...
fuse/xattr_test.go
View file @
279e23da
...
@@ -8,11 +8,12 @@ import (
...
@@ -8,11 +8,12 @@ import (
"os"
"os"
"syscall"
"syscall"
)
)
var
_
=
log
.
Print
var
_
=
log
.
Print
type
XAttrTestFs
struct
{
type
XAttrTestFs
struct
{
filename
string
filename
string
attrs
map
[
string
][]
byte
attrs
map
[
string
][]
byte
DefaultPathFilesystem
DefaultPathFilesystem
}
}
...
@@ -37,7 +38,7 @@ func (me *XAttrTestFs) GetAttr(name string) (*Attr, Status) {
...
@@ -37,7 +38,7 @@ func (me *XAttrTestFs) GetAttr(name string) (*Attr, Status) {
return
nil
,
ENOENT
return
nil
,
ENOENT
}
}
func
(
me
*
XAttrTestFs
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
(
Status
)
{
func
(
me
*
XAttrTestFs
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
{
if
name
!=
me
.
filename
{
if
name
!=
me
.
filename
{
return
ENOENT
return
ENOENT
}
}
...
@@ -68,7 +69,7 @@ func (me *XAttrTestFs) ListXAttr(name string) (data []string, code Status) {
...
@@ -68,7 +69,7 @@ func (me *XAttrTestFs) ListXAttr(name string) (data []string, code Status) {
return
data
,
OK
return
data
,
OK
}
}
func
(
me
*
XAttrTestFs
)
RemoveXAttr
(
name
string
,
attr
string
)
(
Status
)
{
func
(
me
*
XAttrTestFs
)
RemoveXAttr
(
name
string
,
attr
string
)
Status
{
if
name
!=
me
.
filename
{
if
name
!=
me
.
filename
{
return
ENOENT
return
ENOENT
}
}
...
@@ -128,7 +129,7 @@ func TestXAttrRead(t *testing.T) {
...
@@ -128,7 +129,7 @@ func TestXAttrRead(t *testing.T) {
if
len
(
readback
)
!=
len
(
golden
)
{
if
len
(
readback
)
!=
len
(
golden
)
{
t
.
Error
(
"length mismatch"
,
golden
,
readback
)
t
.
Error
(
"length mismatch"
,
golden
,
readback
)
}
else
{
}
else
{
for
k
,
v
:=
range
(
readback
)
{
for
k
,
v
:=
range
readback
{
if
bytes
.
Compare
(
golden
[
k
],
v
)
!=
0
{
if
bytes
.
Compare
(
golden
[
k
],
v
)
!=
0
{
t
.
Error
(
"val mismatch"
,
k
,
v
,
golden
[
k
])
t
.
Error
(
"val mismatch"
,
k
,
v
,
golden
[
k
])
}
}
...
@@ -147,4 +148,3 @@ func TestXAttrRead(t *testing.T) {
...
@@ -147,4 +148,3 @@ func TestXAttrRead(t *testing.T) {
t
.
Error
(
"Data not removed?"
,
errno
,
val
)
t
.
Error
(
"Data not removed?"
,
errno
,
val
)
}
}
}
}
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