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
1ee3533f
Commit
1ee3533f
authored
Mar 27, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: rename DefaultOperations to OperationStubs
parent
0c3074f5
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
78 deletions
+71
-78
nodefs/README.md
nodefs/README.md
+0
-6
nodefs/api.go
nodefs/api.go
+3
-4
nodefs/cache_test.go
nodefs/cache_test.go
+2
-2
nodefs/default.go
nodefs/default.go
+57
-57
nodefs/directio_test.go
nodefs/directio_test.go
+3
-3
nodefs/interrupt_test.go
nodefs/interrupt_test.go
+2
-2
nodefs/loopback.go
nodefs/loopback.go
+1
-1
nodefs/zip_test.go
nodefs/zip_test.go
+3
-3
No files found.
nodefs/README.md
View file @
1ee3533f
...
...
@@ -53,10 +53,4 @@ Decisions
To decide
=========
*
A better name for DefaultOperations.
*
InodeLink
*
ReadonlyOperations
*
BaseOperations
*
implement remaining file types (exercise Mknod)
nodefs/api.go
View file @
1ee3533f
...
...
@@ -65,7 +65,7 @@ import (
)
// Operations is the interface that implements the filesystem inode.
// Each Operations instance must embed
DefaultNode
. All error
// Each Operations instance must embed
OperationStubs
. All error
// reporting must use the syscall.Errno type. The value 0 (`OK`)
// should be used to indicate success.
type
Operations
interface
{
...
...
@@ -79,12 +79,11 @@ type Operations interface {
// Inode returns the *Inode associated with this Operations
// instance. The identity of the Inode does not change over
// the lifetime of the node object. Inode() is provided by
//
DefaultOperation
s, and should not be reimplemented.
//
OperationStub
s, and should not be reimplemented.
Inode
()
*
Inode
// StatFs implements statistics for the filesystem that holds
// this Inode. DefaultNode implements this, because OSX
// filesystem must have a valid StatFs implementation.
// this Inode.
StatFs
(
ctx
context
.
Context
,
out
*
fuse
.
StatfsOut
)
syscall
.
Errno
// Access should return if the caller can access the file with
...
...
nodefs/cache_test.go
View file @
1ee3533f
...
...
@@ -19,7 +19,7 @@ import (
)
type
keepCacheFile
struct
{
DefaultOperation
s
OperationStub
s
keepCache
bool
mu
sync
.
Mutex
...
...
@@ -62,7 +62,7 @@ func (f *keepCacheFile) Read(ctx context.Context, fh FileHandle, dest []byte, of
}
type
keepCacheRoot
struct
{
DefaultOperation
s
OperationStub
s
keep
,
nokeep
*
keepCacheFile
}
...
...
nodefs/default.go
View file @
1ee3533f
This diff is collapsed.
Click to expand it.
nodefs/directio_test.go
View file @
1ee3533f
...
...
@@ -17,7 +17,7 @@ import (
)
type
dioRoot
struct
{
DefaultOperation
s
OperationStub
s
}
func
(
r
*
dioRoot
)
OnAdd
(
ctx
context
.
Context
)
{
...
...
@@ -27,7 +27,7 @@ func (r *dioRoot) OnAdd(ctx context.Context) {
// A file handle that pretends that every hole/data starts at
// multiples of 1024
type
dioFH
struct
{
DefaultFileHandle
FileHandleStubs
}
func
(
f
*
dioFH
)
Lseek
(
ctx
context
.
Context
,
off
uint64
,
whence
uint32
)
(
uint64
,
syscall
.
Errno
)
{
...
...
@@ -42,7 +42,7 @@ func (fh *dioFH) Read(ctx context.Context, data []byte, off int64) (fuse.ReadRes
// overrides Open so it can return a dioFH file handle
type
dioFile
struct
{
DefaultOperation
s
OperationStub
s
}
func
(
f
*
dioFile
)
Open
(
ctx
context
.
Context
,
flags
uint32
)
(
fh
FileHandle
,
fuseFlags
uint32
,
errno
syscall
.
Errno
)
{
...
...
nodefs/interrupt_test.go
View file @
1ee3533f
...
...
@@ -17,12 +17,12 @@ import (
)
type
interruptRoot
struct
{
DefaultOperation
s
OperationStub
s
child
interruptOps
}
type
interruptOps
struct
{
DefaultOperation
s
OperationStub
s
interrupted
bool
}
...
...
nodefs/loopback.go
View file @
1ee3533f
...
...
@@ -41,7 +41,7 @@ func (n *loopbackRoot) GetAttr(ctx context.Context, out *fuse.AttrOut) syscall.E
}
type
loopbackNode
struct
{
DefaultOperation
s
OperationStub
s
}
func
(
n
*
loopbackNode
)
root
()
*
loopbackRoot
{
...
...
nodefs/zip_test.go
View file @
1ee3533f
...
...
@@ -106,7 +106,7 @@ func TestZipFS(t *testing.T) {
// zipFile is a file read from a zip archive.
type
zipFile
struct
{
DefaultOperation
s
OperationStub
s
file
*
zip
.
File
mu
sync
.
Mutex
...
...
@@ -157,7 +157,7 @@ func (zf *zipFile) Read(ctx context.Context, f FileHandle, dest []byte, off int6
// zipRoot is the root of the Zip filesystem. Its only functionality
// is populating the filesystem.
type
zipRoot
struct
{
DefaultOperation
s
OperationStub
s
r
*
zip
.
Reader
}
...
...
@@ -177,7 +177,7 @@ func (zr *zipRoot) OnAdd(ctx context.Context) {
}
ch
:=
p
.
GetChild
(
component
)
if
ch
==
nil
{
ch
=
p
.
NewPersistentInode
(
ctx
,
&
DefaultOperation
s
{},
ch
=
p
.
NewPersistentInode
(
ctx
,
&
OperationStub
s
{},
NodeAttr
{
Mode
:
fuse
.
S_IFDIR
})
p
.
AddChild
(
component
,
ch
,
true
)
}
...
...
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