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
17f8f123
Commit
17f8f123
authored
Mar 14, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: more comments
parent
4f60fdad
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
18 deletions
+10
-18
nodefs/README.md
nodefs/README.md
+4
-5
nodefs/api.go
nodefs/api.go
+5
-12
nodefs/default.go
nodefs/default.go
+1
-1
No files found.
nodefs/README.md
View file @
17f8f123
...
@@ -12,6 +12,10 @@ Decisions
...
@@ -12,6 +12,10 @@ Decisions
because most filesystems will need to construct tree-like
because most filesystems will need to construct tree-like
structures.
structures.
*
Nodes contain references to their parents. As a result, we can
derive the path for each Inode, and there is no need for a
separate PathFS.
*
Nodes can be "persistent", meaning their lifetime is not under
*
Nodes can be "persistent", meaning their lifetime is not under
control of the kernel. This is useful for constructing FS trees
control of the kernel. This is useful for constructing FS trees
in advance, rather than driven by LOOKUP.
in advance, rather than driven by LOOKUP.
...
@@ -52,9 +56,6 @@ To decide
...
@@ -52,9 +56,6 @@ To decide
*
Should we provide automatic fileID numbering?
*
Should we provide automatic fileID numbering?
*
One giant interface with many methods, or many one-method
interfaces? Or some interface (file, dir, symlink, etc).
*
function signatures, or types? The latter is easier to remember?
*
function signatures, or types? The latter is easier to remember?
Easier to extend? The latter less efficient (indirections/copies)
Easier to extend? The latter less efficient (indirections/copies)
...
@@ -84,5 +85,3 @@ or
...
@@ -84,5 +85,3 @@ or
*
Merge Fsync/FsyncDir?
*
Merge Fsync/FsyncDir?
*
Merge Release/ReleaseDir? (others?)
nodefs/api.go
View file @
17f8f123
...
@@ -83,15 +83,6 @@ type DirStream interface {
...
@@ -83,15 +83,6 @@ type DirStream interface {
Close
()
Close
()
}
}
/*
NOSUBMIT: how to structure?
- one interface per method?
- one interface for files (getattr, read/write), one for dirs (lookup, opendir), one shared?
- one giant interface?
- use raw types as args rather than mimicking Golang signatures?
*/
// Operations is the interface that implements the filesystem. Each
// Operations is the interface that implements the filesystem. Each
// Operations instance must embed DefaultNode.
// Operations instance must embed DefaultNode.
type
Operations
interface
{
type
Operations
interface
{
...
@@ -112,7 +103,7 @@ type Operations interface {
...
@@ -112,7 +103,7 @@ type Operations interface {
// Access should return if the caller can access the file with
// Access should return if the caller can access the file with
// the given mode. In this case, the context has data about
// the given mode. In this case, the context has data about
// the real UID. For example a root-SUID binary called by user
// the real UID. For example a root-SUID binary called by user
//
`susan` gets the UID and GID for `susan`
here.
//
susan gets the UID and GID for susan
here.
Access
(
ctx
context
.
Context
,
mask
uint32
)
fuse
.
Status
Access
(
ctx
context
.
Context
,
mask
uint32
)
fuse
.
Status
// Extended attributes
// Extended attributes
...
@@ -122,8 +113,8 @@ type Operations interface {
...
@@ -122,8 +113,8 @@ type Operations interface {
// small, it should return ERANGE and the size of the attribute.
// small, it should return ERANGE and the size of the attribute.
GetXAttr
(
ctx
context
.
Context
,
attr
string
,
dest
[]
byte
)
(
uint32
,
fuse
.
Status
)
GetXAttr
(
ctx
context
.
Context
,
attr
string
,
dest
[]
byte
)
(
uint32
,
fuse
.
Status
)
// SetXAttr should store data for the given attribute.
// SetXAttr should store data for the given attribute.
See
//
XXX
flags.
//
setxattr(2) for information about
flags.
SetXAttr
(
ctx
context
.
Context
,
attr
string
,
data
[]
byte
,
flags
uint32
)
fuse
.
Status
SetXAttr
(
ctx
context
.
Context
,
attr
string
,
data
[]
byte
,
flags
uint32
)
fuse
.
Status
// RemoveXAttr should delete the given attribute.
// RemoveXAttr should delete the given attribute.
...
@@ -134,8 +125,10 @@ type Operations interface {
...
@@ -134,8 +125,10 @@ type Operations interface {
// ERANGE and the correct size.
// ERANGE and the correct size.
ListXAttr
(
ctx
context
.
Context
,
dest
[]
byte
)
(
uint32
,
fuse
.
Status
)
ListXAttr
(
ctx
context
.
Context
,
dest
[]
byte
)
(
uint32
,
fuse
.
Status
)
// GetAttr reads attributes for an Inode
GetAttr
(
ctx
context
.
Context
,
out
*
fuse
.
AttrOut
)
fuse
.
Status
GetAttr
(
ctx
context
.
Context
,
out
*
fuse
.
AttrOut
)
fuse
.
Status
// SetAttr sets attributes for an Inode
SetAttr
(
ctx
context
.
Context
,
in
*
fuse
.
SetAttrIn
,
out
*
fuse
.
AttrOut
)
fuse
.
Status
SetAttr
(
ctx
context
.
Context
,
in
*
fuse
.
SetAttrIn
,
out
*
fuse
.
AttrOut
)
fuse
.
Status
}
}
...
...
nodefs/default.go
View file @
17f8f123
...
@@ -14,7 +14,7 @@ import (
...
@@ -14,7 +14,7 @@ import (
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse"
)
)
// DefaultOperations provides
common base Node functionality.
// DefaultOperations provides
stubs that return ENOSYS for all functions
//
//
// It must be embedded in any Node implementation.
// It must be embedded in any Node implementation.
type
DefaultOperations
struct
{
type
DefaultOperations
struct
{
...
...
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