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 @@
...
@@ -38,14 +38,18 @@
// tree. InodeOf can be used to get particular Inode associated with
// tree. InodeOf can be used to get particular Inode associated with
// a Operations.
// 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 describe how to mount.
//
//
// XXX node example with Lookup.
// XXX node example with Lookup.
//
//
// XXX describe how to pre-add nodes to tree.
//
package
nodefs
package
nodefs
import
(
import
(
...
...
nodefs/bridge.go
View file @
34f8ad4a
...
@@ -377,7 +377,6 @@ func (b *rawBridge) Rename(cancel <-chan struct{}, input *fuse.RenameIn, oldName
...
@@ -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
)
status
:=
p1
.
node
.
Rename
(
&
fuse
.
Context
{
Caller
:
input
.
Caller
,
Cancel
:
cancel
},
oldName
,
p2
.
node
,
newName
,
input
.
Flags
)
if
status
.
Ok
()
{
if
status
.
Ok
()
{
if
input
.
Flags
&
unix
.
RENAME_EXCHANGE
!=
0
{
if
input
.
Flags
&
unix
.
RENAME_EXCHANGE
!=
0
{
// XXX - test coverage.
p1
.
ExchangeChild
(
oldName
,
p2
,
newName
)
p1
.
ExchangeChild
(
oldName
,
p2
,
newName
)
}
else
{
}
else
{
p1
.
MvChild
(
oldName
,
p2
,
newName
,
true
)
p1
.
MvChild
(
oldName
,
p2
,
newName
,
true
)
...
@@ -609,7 +608,6 @@ func (b *rawBridge) ReadDir(cancel <-chan struct{}, input *fuse.ReadIn, out *fus
...
@@ -609,7 +608,6 @@ func (b *rawBridge) ReadDir(cancel <-chan struct{}, input *fuse.ReadIn, out *fus
f
.
hasOverflow
=
false
f
.
hasOverflow
=
false
}
}
// TODO - should post '..' and '.' ?
for
f
.
dirStream
.
HasNext
()
{
for
f
.
dirStream
.
HasNext
()
{
e
,
status
:=
f
.
dirStream
.
Next
()
e
,
status
:=
f
.
dirStream
.
Next
()
...
@@ -663,7 +661,7 @@ func (b *rawBridge) ReadDirPlus(cancel <-chan struct{}, input *fuse.ReadIn, out
...
@@ -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
.
addNewChild
(
n
,
e
.
Name
,
child
,
nil
,
0
,
entryOut
)
b
.
setEntryOutTimeout
(
entryOut
)
b
.
setEntryOutTimeout
(
entryOut
)
if
(
e
.
Mode
&^
07777
)
!=
(
child
.
mode
&^
07777
)
{
if
(
e
.
Mode
&^
07777
)
!=
(
child
.
mode
&^
07777
)
{
//
XXX
should go back and change the
// should go back and change the
// already serialized entry
// already serialized entry
log
.
Panicf
(
"mode mismatch between readdir %o and lookup %o"
,
e
.
Mode
,
child
.
mode
)
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 (
...
@@ -11,8 +11,6 @@ import (
"github.com/hanwen/go-fuse/fuse"
"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
{
func
(
f
*
loopbackFile
)
Allocate
(
ctx
context
.
Context
,
off
uint64
,
sz
uint64
,
mode
uint32
)
fuse
.
Status
{
return
fuse
.
ENOSYS
return
fuse
.
ENOSYS
}
}
...
...
nodefs/inode.go
View file @
34f8ad4a
...
@@ -333,7 +333,8 @@ retry:
...
@@ -333,7 +333,8 @@ retry:
lockNodes
(
lockme
...
)
lockNodes
(
lockme
...
)
if
n
.
changeCounter
!=
nChange
{
if
n
.
changeCounter
!=
nChange
{
unlockNodes
(
lockme
...
)
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
continue
retry
}
}
...
@@ -391,7 +392,8 @@ retry:
...
@@ -391,7 +392,8 @@ retry:
lockNodes
(
lockme
...
)
lockNodes
(
lockme
...
)
if
n
.
changeCounter
!=
nChange
{
if
n
.
changeCounter
!=
nChange
{
unlockNodes
(
lockme
...
)
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
continue
retry
}
}
...
@@ -467,7 +469,6 @@ retry:
...
@@ -467,7 +469,6 @@ retry:
unlockNodes
(
n
,
newParent
,
oldChild
,
destChild
)
unlockNodes
(
n
,
newParent
,
oldChild
,
destChild
)
if
destChild
!=
nil
{
if
destChild
!=
nil
{
// XXX would be better to do this under lock above too.
destChild
.
removeRef
(
0
,
false
)
destChild
.
removeRef
(
0
,
false
)
}
}
return
true
return
true
...
@@ -539,7 +540,7 @@ func (n *Inode) NotifyEntry(name string) fuse.Status {
...
@@ -539,7 +540,7 @@ func (n *Inode) NotifyEntry(name string) fuse.Status {
return
n
.
bridge
.
server
.
EntryNotify
(
n
.
nodeID
.
Ino
,
name
)
return
n
.
bridge
.
server
.
EntryNotify
(
n
.
nodeID
.
Ino
,
name
)
}
}
// XXX DeleteNotify ?
// XXX
naming:
DeleteNotify ?
func
(
n
*
Inode
)
NotifyDelete
(
name
string
,
child
*
Inode
)
fuse
.
Status
{
func
(
n
*
Inode
)
NotifyDelete
(
name
string
,
child
*
Inode
)
fuse
.
Status
{
// XXX arg ordering?
// XXX arg ordering?
return
n
.
bridge
.
server
.
DeleteNotify
(
n
.
nodeID
.
Ino
,
child
.
nodeID
.
Ino
,
name
)
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) {
...
@@ -550,8 +550,6 @@ func TestReadDir(t *testing.T) {
defer
f
.
Close
()
defer
f
.
Close
()
// add entries after opening the directory
// add entries after opening the directory
// XXX what about ".." and "." ?
want
:=
map
[
string
]
bool
{}
want
:=
map
[
string
]
bool
{}
for
i
:=
0
;
i
<
110
;
i
++
{
for
i
:=
0
;
i
<
110
;
i
++
{
// 40 bytes of filename, so 110 entries overflows a
// 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