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
34f8ad4a
Commit
34f8ad4a
authored
Mar 12, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: update some comments
parent
1070358b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
14 deletions
+13
-14
nodefs/api.go
nodefs/api.go
+7
-3
nodefs/bridge.go
nodefs/bridge.go
+1
-3
nodefs/files_darwin.go
nodefs/files_darwin.go
+0
-2
nodefs/inode.go
nodefs/inode.go
+5
-4
nodefs/simple_test.go
nodefs/simple_test.go
+0
-2
No files found.
nodefs/api.go
View file @
34f8ad4a
...
...
@@ -38,14 +38,18 @@
// tree. InodeOf can be used to get particular Inode associated with
// a Operations.
//
// XXX ^^^ inodes cleaned on cache clean (FORGET).
// The kernel can evict inode data to free up memory. It does so by
// issuing FORGET calls. When a node has no children, and no kernel
// references, it is removed from the file system trees.
//
// File system trees can also be constructed in advance. This is done
// by instantiating "persistent" inodes. Persistent inodes remain in
// memory even if the kernel has forgotten them.
//
// XXX describe how to mount.
//
// XXX node example with Lookup.
//
// XXX describe how to pre-add nodes to tree.
//
package
nodefs
import
(
...
...
nodefs/bridge.go
View file @
34f8ad4a
...
...
@@ -377,7 +377,6 @@ func (b *rawBridge) Rename(cancel <-chan struct{}, input *fuse.RenameIn, oldName
status
:=
p1
.
node
.
Rename
(
&
fuse
.
Context
{
Caller
:
input
.
Caller
,
Cancel
:
cancel
},
oldName
,
p2
.
node
,
newName
,
input
.
Flags
)
if
status
.
Ok
()
{
if
input
.
Flags
&
unix
.
RENAME_EXCHANGE
!=
0
{
// XXX - test coverage.
p1
.
ExchangeChild
(
oldName
,
p2
,
newName
)
}
else
{
p1
.
MvChild
(
oldName
,
p2
,
newName
,
true
)
...
...
@@ -609,7 +608,6 @@ func (b *rawBridge) ReadDir(cancel <-chan struct{}, input *fuse.ReadIn, out *fus
f
.
hasOverflow
=
false
}
// TODO - should post '..' and '.' ?
for
f
.
dirStream
.
HasNext
()
{
e
,
status
:=
f
.
dirStream
.
Next
()
...
...
@@ -663,7 +661,7 @@ func (b *rawBridge) ReadDirPlus(cancel <-chan struct{}, input *fuse.ReadIn, out
b
.
addNewChild
(
n
,
e
.
Name
,
child
,
nil
,
0
,
entryOut
)
b
.
setEntryOutTimeout
(
entryOut
)
if
(
e
.
Mode
&^
07777
)
!=
(
child
.
mode
&^
07777
)
{
//
XXX
should go back and change the
// should go back and change the
// already serialized entry
log
.
Panicf
(
"mode mismatch between readdir %o and lookup %o"
,
e
.
Mode
,
child
.
mode
)
}
...
...
nodefs/files_darwin.go
View file @
34f8ad4a
...
...
@@ -11,8 +11,6 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
// XXX fill out here.
func
(
f
*
loopbackFile
)
Allocate
(
ctx
context
.
Context
,
off
uint64
,
sz
uint64
,
mode
uint32
)
fuse
.
Status
{
return
fuse
.
ENOSYS
}
...
...
nodefs/inode.go
View file @
34f8ad4a
...
...
@@ -333,7 +333,8 @@ retry:
lockNodes
(
lockme
...
)
if
n
.
changeCounter
!=
nChange
{
unlockNodes
(
lockme
...
)
n
.
mu
.
Lock
()
// TODO could avoid unlocking and relocking n here.
// could avoid unlocking and relocking n here.
n
.
mu
.
Lock
()
continue
retry
}
...
...
@@ -391,7 +392,8 @@ retry:
lockNodes
(
lockme
...
)
if
n
.
changeCounter
!=
nChange
{
unlockNodes
(
lockme
...
)
n
.
mu
.
Lock
()
// TODO could avoid unlocking and relocking n here.
// could avoid unlocking and relocking n here.
n
.
mu
.
Lock
()
continue
retry
}
...
...
@@ -467,7 +469,6 @@ retry:
unlockNodes
(
n
,
newParent
,
oldChild
,
destChild
)
if
destChild
!=
nil
{
// XXX would be better to do this under lock above too.
destChild
.
removeRef
(
0
,
false
)
}
return
true
...
...
@@ -539,7 +540,7 @@ func (n *Inode) NotifyEntry(name string) fuse.Status {
return
n
.
bridge
.
server
.
EntryNotify
(
n
.
nodeID
.
Ino
,
name
)
}
// XXX DeleteNotify ?
// XXX
naming:
DeleteNotify ?
func
(
n
*
Inode
)
NotifyDelete
(
name
string
,
child
*
Inode
)
fuse
.
Status
{
// XXX arg ordering?
return
n
.
bridge
.
server
.
DeleteNotify
(
n
.
nodeID
.
Ino
,
child
.
nodeID
.
Ino
,
name
)
...
...
nodefs/simple_test.go
View file @
34f8ad4a
...
...
@@ -550,8 +550,6 @@ func TestReadDir(t *testing.T) {
defer
f
.
Close
()
// add entries after opening the directory
// XXX what about ".." and "." ?
want
:=
map
[
string
]
bool
{}
for
i
:=
0
;
i
<
110
;
i
++
{
// 40 bytes of filename, so 110 entries overflows a
...
...
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