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
374671a4
Commit
374671a4
authored
Aug 12, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetAttr works. GetXAttr fails.
parent
8bfe84d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
22 deletions
+45
-22
fuse/fuse.go
fuse/fuse.go
+16
-0
fuse/fuse_test.go
fuse/fuse_test.go
+7
-0
fuse/types.go
fuse/types.go
+22
-22
No files found.
fuse/fuse.go
View file @
374671a4
...
...
@@ -19,6 +19,7 @@ const (
type
FileSystem
interface
{
Init
(
in
*
InitIn
)
(
out
*
InitOut
,
code
Error
)
GetAttr
(
h
*
InHeader
,
in
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Error
)
}
type
MountPoint
struct
{
...
...
@@ -124,6 +125,21 @@ func handle(fs FileSystem, in_data []byte, toW chan [][]byte, errors chan os.Err
case
FUSE_FORGET
:
return
case
FUSE_GETATTR
:
in
:=
new
(
GetAttrIn
)
err
=
binary
.
Read
(
r
,
binary
.
LittleEndian
,
in
)
if
err
!=
nil
{
break
}
fmt
.
Printf
(
"FUSE_GETATTR: %v
\n
"
,
in
)
var
attr_out
*
AttrOut
attr_out
,
result
=
fs
.
GetAttr
(
h
,
in
)
if
attr_out
!=
nil
{
out
=
attr_out
}
case
FUSE_GETXATTR
:
result
=
ENODATA
default
:
errors
<-
os
.
NewError
(
fmt
.
Sprintf
(
"Unsupported OpCode: %d"
,
h
.
Opcode
))
result
=
EIO
...
...
fuse/fuse_test.go
View file @
374671a4
...
...
@@ -32,6 +32,13 @@ func (fs *testFuse) Init(in *InitIn) (out *InitOut, code Error) {
return
}
func
(
fs
*
testFuse
)
GetAttr
(
h
*
InHeader
,
in
*
GetAttrIn
)
(
out
*
AttrOut
,
code
Error
)
{
out
=
new
(
AttrOut
)
out
.
Ino
=
h
.
NodeId
out
.
Mode
=
S_IFDIR
return
}
func
errorHandler
(
errors
chan
os
.
Error
)
{
for
err
:=
range
errors
{
log
.
Stderr
(
"MountPoint.errorHandler: "
,
err
)
...
...
fuse/types.go
View file @
374671a4
...
...
@@ -67,7 +67,7 @@ const (
FUSE_RELEASE_FLUSH
=
(
1
<<
0
)
/**
* Get
a
ttr flags
* Get
A
ttr flags
*/
FUSE_GETATTR_FH
=
(
1
<<
0
)
...
...
@@ -126,6 +126,8 @@ const (
FUSE_COMPAT_STATFS_SIZE
=
48
CUSE_INIT_INFO_MAX
=
4096
S_IFDIR
=
syscall
.
S_IFDIR
)
type
Error
int32
...
...
@@ -134,6 +136,7 @@ const (
OK
=
Error
(
0
)
EIO
=
Error
(
syscall
.
EIO
)
ENOSYS
=
Error
(
syscall
.
ENOSYS
)
ENODATA
=
Error
(
syscall
.
ENODATA
)
)
type
Opcode
int
...
...
@@ -233,15 +236,14 @@ type FileLock struct {
Pid
uint32
/* tgid */
}
type
EntryOut
struct
{
Node
i
d
uint64
/* Inode ID */
Node
I
d
uint64
/* Inode ID */
Generation
uint64
/* Inode generation: nodeid:gen must
be unique for the fs's lifetime */
Entry
_valid
uint64
/* Cache timeout for the name */
Attr
_valid
uint64
/* Cache timeout for the attributes */
Entry
_valid_n
sec
uint32
Attr
_valid_n
sec
uint32
Entry
Valid
uint64
/* Cache timeout for the name */
Attr
Valid
uint64
/* Cache timeout for the attributes */
Entry
ValidN
sec
uint32
Attr
ValidN
sec
uint32
Attr
Attr
}
...
...
@@ -249,21 +251,19 @@ type ForgetIn struct {
Nlookup
uint64
}
type
Get
a
ttrIn
struct
{
Get
attr_f
lags
uint32
type
Get
A
ttrIn
struct
{
Get
AttrF
lags
uint32
Dummy
uint32
Fh
uint64
}
type
AttrOut
struct
{
Attr
_valid
uint64
/* Cache timeout for the attributes */
Attr
_valid_n
sec
uint32
Attr
Valid
uint64
/* Cache timeout for the attributes */
Attr
ValidN
sec
uint32
Dummy
uint32
Attr
Attr
Attr
}
type
MknodIn
struct
{
Mode
uint32
Rdev
uint32
...
...
@@ -490,7 +490,7 @@ type InHeader struct {
Length
uint32
Opcode
uint32
Unique
uint64
Node
i
d
uint64
Node
I
d
uint64
Uid
uint32
Gid
uint32
Pid
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