Commit 34f8ad4a authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

nodefs: update some comments

parent 1070358b
......@@ -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 (
......
......@@ -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)
}
......
......@@ -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
}
......
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment