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
18e0e322
Commit
18e0e322
authored
Mar 15, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: more method documentation
parent
2f9c4b1d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
66 deletions
+74
-66
nodefs/README.md
nodefs/README.md
+1
-0
nodefs/api.go
nodefs/api.go
+2
-3
nodefs/default.go
nodefs/default.go
+65
-58
nodefs/dirstream_linux.go
nodefs/dirstream_linux.go
+1
-0
nodefs/files.go
nodefs/files.go
+3
-2
nodefs/loopback.go
nodefs/loopback.go
+2
-3
No files found.
nodefs/README.md
View file @
18e0e322
...
...
@@ -85,3 +85,4 @@ or
*
Merge Fsync/FsyncDir?
*
OnMount in Operations or in Options? Or argument to NewNodeFS ?
nodefs/api.go
View file @
18e0e322
...
...
@@ -67,8 +67,8 @@ func InodeOf(node Operations) *Inode {
return
node
.
inode
()
}
// Operations is the interface that implements the filesystem
. Each
// Operations instance must embed DefaultNode.
// Operations is the interface that implements the filesystem
inode.
//
Each
Operations instance must embed DefaultNode.
type
Operations
interface
{
// setInode and inode are used by nodefs internally to link Inode to a Node.
//
...
...
@@ -293,7 +293,6 @@ type FileHandle interface {
// Options sets options for the entire filesystem
type
Options
struct
{
// Debug toggles debug output
Debug
bool
...
...
nodefs/default.go
View file @
18e0e322
This diff is collapsed.
Click to expand it.
nodefs/dirstream_linux.go
View file @
18e0e322
...
...
@@ -17,6 +17,7 @@ type loopbackDirStream struct {
fd
int
}
// NewLoopbackDirStream open a directory for reading as a DirStream
func
NewLoopbackDirStream
(
name
string
)
(
DirStream
,
fuse
.
Status
)
{
fd
,
err
:=
syscall
.
Open
(
name
,
syscall
.
O_DIRECTORY
,
0755
)
if
err
!=
nil
{
...
...
nodefs/files.go
View file @
18e0e322
...
...
@@ -14,11 +14,12 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
func
newLoopbackFile
(
fd
int
)
*
loopbackFile
{
// NewLoopbackFile creates a FileHandle out of a file descriptor. All
// operations are implemented.
func
NewLoopbackFile
(
fd
int
)
FileHandle
{
return
&
loopbackFile
{
fd
:
fd
}
}
// loopbackFile delegates all operations back to an underlying file.
type
loopbackFile
struct
{
fd
int
...
...
nodefs/loopback.go
View file @
18e0e322
...
...
@@ -95,7 +95,6 @@ func (n *loopbackNode) Mknod(ctx context.Context, name string, mode, rdev uint32
}
func
(
n
*
loopbackNode
)
Mkdir
(
ctx
context
.
Context
,
name
string
,
mode
uint32
,
out
*
fuse
.
EntryOut
)
(
*
Inode
,
fuse
.
Status
)
{
// NOSUBMIT what about umask
p
:=
filepath
.
Join
(
n
.
path
(),
name
)
err
:=
os
.
Mkdir
(
p
,
os
.
FileMode
(
mode
))
if
err
!=
nil
{
...
...
@@ -172,7 +171,7 @@ func (n *loopbackNode) Create(ctx context.Context, name string, flags uint32, mo
node
:=
n
.
rootNode
.
newLoopbackNode
()
ch
:=
n
.
inode
()
.
NewInode
(
node
,
uint32
(
st
.
Mode
),
idFromStat
(
&
st
))
lf
:=
n
ewLoopbackFile
(
fd
)
lf
:=
N
ewLoopbackFile
(
fd
)
return
ch
,
lf
,
0
,
fuse
.
OK
}
...
...
@@ -236,7 +235,7 @@ func (n *loopbackNode) Open(ctx context.Context, flags uint32) (fh FileHandle, f
if
err
!=
nil
{
return
nil
,
0
,
fuse
.
ToStatus
(
err
)
}
lf
:=
n
ewLoopbackFile
(
f
)
lf
:=
N
ewLoopbackFile
(
f
)
return
lf
,
0
,
fuse
.
OK
}
...
...
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