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
224614e9
Commit
224614e9
authored
Mar 24, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gofmt.
parent
52ac4a21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
83 deletions
+84
-83
fuse/direntry.go
fuse/direntry.go
+4
-4
fuse/fuse.go
fuse/fuse.go
+1
-1
fuse/misc.go
fuse/misc.go
+79
-78
No files found.
fuse/direntry.go
View file @
224614e9
...
...
@@ -34,10 +34,10 @@ func (me *DirEntryList) Add(name []byte, inode uint64, mode uint32) bool {
me
.
offset
++
dirent
:=
Dirent
{
Off
:
me
.
offset
,
Ino
:
inode
,
NameLen
:
uint32
(
len
(
name
)),
Typ
:
ModeToType
(
mode
),
Off
:
me
.
offset
,
Ino
:
inode
,
NameLen
:
uint32
(
len
(
name
)),
Typ
:
ModeToType
(
mode
),
}
_
,
err
:=
me
.
buf
.
Write
(
asSlice
(
unsafe
.
Pointer
(
&
dirent
),
unsafe
.
Sizeof
(
Dirent
{})))
...
...
fuse/fuse.go
View file @
224614e9
...
...
@@ -531,7 +531,7 @@ func serialize(req *fuseRequest, debug bool) {
sizeOfOutHeader
:=
unsafe
.
Sizeof
(
OutHeader
{})
req
.
outHeaderBytes
=
make
([]
byte
,
sizeOfOutHeader
+
dataLength
)
req
.
outHeaderBytes
=
make
([]
byte
,
sizeOfOutHeader
+
dataLength
)
outHeader
:=
(
*
OutHeader
)(
unsafe
.
Pointer
(
&
req
.
outHeaderBytes
[
0
]))
outHeader
.
Unique
=
req
.
inHeader
.
Unique
outHeader
.
Status
=
-
req
.
status
...
...
fuse/misc.go
View file @
224614e9
...
...
@@ -258,87 +258,88 @@ func MyPID() string {
var
inputSizeMap
map
[
int
]
int
var
outputSizeMap
map
[
int
]
int
func
init
()
{
inputSizeMap
=
map
[
int
]
int
{
FUSE_LOOKUP
:
0
,
FUSE_FORGET
:
unsafe
.
Sizeof
(
ForgetIn
{}),
FUSE_GETATTR
:
unsafe
.
Sizeof
(
GetAttrIn
{}),
FUSE_SETATTR
:
unsafe
.
Sizeof
(
SetAttrIn
{}),
FUSE_READLINK
:
0
,
FUSE_SYMLINK
:
0
,
FUSE_MKNOD
:
unsafe
.
Sizeof
(
MknodIn
{}),
FUSE_MKDIR
:
unsafe
.
Sizeof
(
MkdirIn
{}),
FUSE_UNLINK
:
0
,
FUSE_RMDIR
:
0
,
FUSE_RENAME
:
unsafe
.
Sizeof
(
RenameIn
{}),
FUSE_LINK
:
unsafe
.
Sizeof
(
LinkIn
{}),
FUSE_OPEN
:
unsafe
.
Sizeof
(
OpenIn
{}),
FUSE_READ
:
unsafe
.
Sizeof
(
ReadIn
{}),
FUSE_WRITE
:
unsafe
.
Sizeof
(
WriteIn
{}),
FUSE_STATFS
:
0
,
FUSE_RELEASE
:
unsafe
.
Sizeof
(
ReleaseIn
{}),
FUSE_FSYNC
:
unsafe
.
Sizeof
(
FsyncIn
{}),
FUSE_SETXATTR
:
unsafe
.
Sizeof
(
SetXAttrIn
{}),
FUSE_GETXATTR
:
unsafe
.
Sizeof
(
GetXAttrIn
{}),
FUSE_LISTXATTR
:
0
,
FUSE_REMOVEXATTR
:
0
,
FUSE_FLUSH
:
unsafe
.
Sizeof
(
FlushIn
{}),
FUSE_INIT
:
unsafe
.
Sizeof
(
InitIn
{}),
FUSE_OPENDIR
:
unsafe
.
Sizeof
(
OpenIn
{}),
FUSE_READDIR
:
unsafe
.
Sizeof
(
ReadIn
{}),
FUSE_RELEASEDIR
:
unsafe
.
Sizeof
(
ReleaseIn
{}),
FUSE_FSYNCDIR
:
unsafe
.
Sizeof
(
FsyncIn
{}),
FUSE_GETLK
:
0
,
FUSE_SETLK
:
0
,
FUSE_SETLKW
:
0
,
FUSE_ACCESS
:
unsafe
.
Sizeof
(
AccessIn
{}),
FUSE_CREATE
:
unsafe
.
Sizeof
(
CreateIn
{}),
FUSE_INTERRUPT
:
unsafe
.
Sizeof
(
InterruptIn
{}),
FUSE_BMAP
:
unsafe
.
Sizeof
(
BmapIn
{}),
FUSE_DESTROY
:
0
,
FUSE_IOCTL
:
unsafe
.
Sizeof
(
IoctlIn
{}),
FUSE_POLL
:
unsafe
.
Sizeof
(
PollIn
{}),
FUSE_LOOKUP
:
0
,
FUSE_FORGET
:
unsafe
.
Sizeof
(
ForgetIn
{}),
FUSE_GETATTR
:
unsafe
.
Sizeof
(
GetAttrIn
{}),
FUSE_SETATTR
:
unsafe
.
Sizeof
(
SetAttrIn
{}),
FUSE_READLINK
:
0
,
FUSE_SYMLINK
:
0
,
FUSE_MKNOD
:
unsafe
.
Sizeof
(
MknodIn
{}),
FUSE_MKDIR
:
unsafe
.
Sizeof
(
MkdirIn
{}),
FUSE_UNLINK
:
0
,
FUSE_RMDIR
:
0
,
FUSE_RENAME
:
unsafe
.
Sizeof
(
RenameIn
{}),
FUSE_LINK
:
unsafe
.
Sizeof
(
LinkIn
{}),
FUSE_OPEN
:
unsafe
.
Sizeof
(
OpenIn
{}),
FUSE_READ
:
unsafe
.
Sizeof
(
ReadIn
{}),
FUSE_WRITE
:
unsafe
.
Sizeof
(
WriteIn
{}),
FUSE_STATFS
:
0
,
FUSE_RELEASE
:
unsafe
.
Sizeof
(
ReleaseIn
{}),
FUSE_FSYNC
:
unsafe
.
Sizeof
(
FsyncIn
{}),
FUSE_SETXATTR
:
unsafe
.
Sizeof
(
SetXAttrIn
{}),
FUSE_GETXATTR
:
unsafe
.
Sizeof
(
GetXAttrIn
{}),
FUSE_LISTXATTR
:
0
,
FUSE_REMOVEXATTR
:
0
,
FUSE_FLUSH
:
unsafe
.
Sizeof
(
FlushIn
{}),
FUSE_INIT
:
unsafe
.
Sizeof
(
InitIn
{}),
FUSE_OPENDIR
:
unsafe
.
Sizeof
(
OpenIn
{}),
FUSE_READDIR
:
unsafe
.
Sizeof
(
ReadIn
{}),
FUSE_RELEASEDIR
:
unsafe
.
Sizeof
(
ReleaseIn
{}),
FUSE_FSYNCDIR
:
unsafe
.
Sizeof
(
FsyncIn
{}),
FUSE_GETLK
:
0
,
FUSE_SETLK
:
0
,
FUSE_SETLKW
:
0
,
FUSE_ACCESS
:
unsafe
.
Sizeof
(
AccessIn
{}),
FUSE_CREATE
:
unsafe
.
Sizeof
(
CreateIn
{}),
FUSE_INTERRUPT
:
unsafe
.
Sizeof
(
InterruptIn
{}),
FUSE_BMAP
:
unsafe
.
Sizeof
(
BmapIn
{}),
FUSE_DESTROY
:
0
,
FUSE_IOCTL
:
unsafe
.
Sizeof
(
IoctlIn
{}),
FUSE_POLL
:
unsafe
.
Sizeof
(
PollIn
{}),
}
outputSizeMap
=
map
[
int
]
int
{
FUSE_LOOKUP
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_FORGET
:
0
,
FUSE_GETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
FUSE_SETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
FUSE_READLINK
:
0
,
FUSE_SYMLINK
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_MKNOD
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_MKDIR
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_UNLINK
:
0
,
FUSE_RMDIR
:
0
,
FUSE_RENAME
:
0
,
FUSE_LINK
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_OPEN
:
unsafe
.
Sizeof
(
OpenOut
{}),
FUSE_READ
:
0
,
FUSE_WRITE
:
unsafe
.
Sizeof
(
WriteOut
{}),
FUSE_STATFS
:
unsafe
.
Sizeof
(
StatfsOut
{}),
FUSE_RELEASE
:
0
,
FUSE_FSYNC
:
0
,
FUSE_SETXATTR
:
0
,
FUSE_GETXATTR
:
unsafe
.
Sizeof
(
GetXAttrOut
{}),
FUSE_LISTXATTR
:
0
,
FUSE_REMOVEXATTR
:
0
,
FUSE_FLUSH
:
0
,
FUSE_INIT
:
unsafe
.
Sizeof
(
InitOut
{}),
FUSE_OPENDIR
:
unsafe
.
Sizeof
(
OpenOut
{}),
FUSE_READDIR
:
0
,
FUSE_RELEASEDIR
:
0
,
FUSE_FSYNCDIR
:
0
,
// TODO
FUSE_GETLK
:
0
,
FUSE_SETLK
:
0
,
FUSE_SETLKW
:
0
,
FUSE_ACCESS
:
0
,
FUSE_CREATE
:
unsafe
.
Sizeof
(
CreateOut
{}),
FUSE_INTERRUPT
:
0
,
FUSE_BMAP
:
unsafe
.
Sizeof
(
BmapOut
{}),
FUSE_DESTROY
:
0
,
FUSE_IOCTL
:
unsafe
.
Sizeof
(
IoctlOut
{}),
FUSE_POLL
:
unsafe
.
Sizeof
(
PollOut
{}),
outputSizeMap
=
map
[
int
]
int
{
FUSE_LOOKUP
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_FORGET
:
0
,
FUSE_GETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
FUSE_SETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
FUSE_READLINK
:
0
,
FUSE_SYMLINK
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_MKNOD
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_MKDIR
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_UNLINK
:
0
,
FUSE_RMDIR
:
0
,
FUSE_RENAME
:
0
,
FUSE_LINK
:
unsafe
.
Sizeof
(
EntryOut
{}),
FUSE_OPEN
:
unsafe
.
Sizeof
(
OpenOut
{}),
FUSE_READ
:
0
,
FUSE_WRITE
:
unsafe
.
Sizeof
(
WriteOut
{}),
FUSE_STATFS
:
unsafe
.
Sizeof
(
StatfsOut
{}),
FUSE_RELEASE
:
0
,
FUSE_FSYNC
:
0
,
FUSE_SETXATTR
:
0
,
FUSE_GETXATTR
:
unsafe
.
Sizeof
(
GetXAttrOut
{}),
FUSE_LISTXATTR
:
0
,
FUSE_REMOVEXATTR
:
0
,
FUSE_FLUSH
:
0
,
FUSE_INIT
:
unsafe
.
Sizeof
(
InitOut
{}),
FUSE_OPENDIR
:
unsafe
.
Sizeof
(
OpenOut
{}),
FUSE_READDIR
:
0
,
FUSE_RELEASEDIR
:
0
,
FUSE_FSYNCDIR
:
0
,
// TODO
FUSE_GETLK
:
0
,
FUSE_SETLK
:
0
,
FUSE_SETLKW
:
0
,
FUSE_ACCESS
:
0
,
FUSE_CREATE
:
unsafe
.
Sizeof
(
CreateOut
{}),
FUSE_INTERRUPT
:
0
,
FUSE_BMAP
:
unsafe
.
Sizeof
(
BmapOut
{}),
FUSE_DESTROY
:
0
,
FUSE_IOCTL
:
unsafe
.
Sizeof
(
IoctlOut
{}),
FUSE_POLL
:
unsafe
.
Sizeof
(
PollOut
{}),
}
}
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