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
Kirill Smelkov
go-fuse
Commits
22637a49
Commit
22637a49
authored
Jul 08, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: hide Dirent type.
parent
1dc9cd8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
fuse/direntry.go
fuse/direntry.go
+3
-3
fuse/misc.go
fuse/misc.go
+0
-5
fuse/types.go
fuse/types.go
+3
-1
No files found.
fuse/direntry.go
View file @
22637a49
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
var
eightPadding
[
8
]
byte
var
eightPadding
[
8
]
byte
const
direntSize
=
int
(
unsafe
.
Sizeof
(
Dirent
{}))
const
direntSize
=
int
(
unsafe
.
Sizeof
(
_
Dirent
{}))
// DirEntry is a type for PathFileSystem and NodeFileSystem to return
// DirEntry is a type for PathFileSystem and NodeFileSystem to return
// directory contents in.
// directory contents in.
...
@@ -60,11 +60,11 @@ func (l *DirEntryList) Add(prefix []byte, name string, inode uint64, mode uint32
...
@@ -60,11 +60,11 @@ func (l *DirEntryList) Add(prefix []byte, name string, inode uint64, mode uint32
l
.
buf
=
l
.
buf
[
:
newLen
]
l
.
buf
=
l
.
buf
[
:
newLen
]
copy
(
l
.
buf
[
oldLen
:
],
prefix
)
copy
(
l
.
buf
[
oldLen
:
],
prefix
)
oldLen
+=
len
(
prefix
)
oldLen
+=
len
(
prefix
)
dirent
:=
(
*
Dirent
)(
unsafe
.
Pointer
(
&
l
.
buf
[
oldLen
]))
dirent
:=
(
*
_
Dirent
)(
unsafe
.
Pointer
(
&
l
.
buf
[
oldLen
]))
dirent
.
Off
=
l
.
offset
+
1
dirent
.
Off
=
l
.
offset
+
1
dirent
.
Ino
=
inode
dirent
.
Ino
=
inode
dirent
.
NameLen
=
uint32
(
len
(
name
))
dirent
.
NameLen
=
uint32
(
len
(
name
))
dirent
.
Typ
=
ModeToType
(
mode
)
dirent
.
Typ
=
(
mode
&
0170000
)
>>
12
oldLen
+=
direntSize
oldLen
+=
direntSize
copy
(
l
.
buf
[
oldLen
:
],
name
)
copy
(
l
.
buf
[
oldLen
:
],
name
)
oldLen
+=
len
(
name
)
oldLen
+=
len
(
name
)
...
...
fuse/misc.go
View file @
22637a49
...
@@ -59,11 +59,6 @@ func ToStatus(err error) Status {
...
@@ -59,11 +59,6 @@ func ToStatus(err error) Status {
return
ENOSYS
return
ENOSYS
}
}
func
ModeToType
(
mode
uint32
)
uint32
{
return
(
mode
&
0170000
)
>>
12
}
// Thanks to Andrew Gerrand for this hack.
func
toSlice
(
dest
*
[]
byte
,
ptr
unsafe
.
Pointer
,
byteCount
uintptr
)
{
func
toSlice
(
dest
*
[]
byte
,
ptr
unsafe
.
Pointer
,
byteCount
uintptr
)
{
h
:=
(
*
reflect
.
SliceHeader
)(
unsafe
.
Pointer
(
dest
))
h
:=
(
*
reflect
.
SliceHeader
)(
unsafe
.
Pointer
(
dest
))
*
h
=
reflect
.
SliceHeader
{
uintptr
(
ptr
),
int
(
byteCount
),
int
(
byteCount
)}
*
h
=
reflect
.
SliceHeader
{
uintptr
(
ptr
),
int
(
byteCount
),
int
(
byteCount
)}
...
...
fuse/types.go
View file @
22637a49
...
@@ -418,7 +418,9 @@ type StatfsOut struct {
...
@@ -418,7 +418,9 @@ type StatfsOut struct {
Spare
[
6
]
uint32
Spare
[
6
]
uint32
}
}
type
Dirent
struct
{
// _Dirent is what we send to the kernel, but we offer DirEntry and
// DirEntryList to the user.
type
_Dirent
struct
{
Ino
uint64
Ino
uint64
Off
uint64
Off
uint64
NameLen
uint32
NameLen
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