From 36d7193638ab5086b80cf87fc16f3926a47135aa Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Mon, 30 Mar 2015 16:35:17 +1100 Subject: [PATCH] Added a note about nlookup for the root inode. For #7. --- fuseops/ops.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/fuseops/ops.go b/fuseops/ops.go index d197e01..20664f5 100644 --- a/fuseops/ops.go +++ b/fuseops/ops.go @@ -220,10 +220,11 @@ func (o *SetInodeAttributesOp) Respond(err error) { // Decrement the reference count for an inode ID previously issued by the file // system. // -// The comments for the ops that implicitly increment the reference -// count contain a note of this. For example, LookUpInodeOp and MkDirOp. The -// authoritative source is the libfuse documentation, which states that any op -// that returns fuse_reply_entry fuse_reply_create implicitly increments (cf. +// The comments for the ops that implicitly increment the reference count +// contain a note of this (but see also the note about the root inode below). +// For example, LookUpInodeOp and MkDirOp. The authoritative source is the +// libfuse documentation, which states that any op that returns +// fuse_reply_entry fuse_reply_create implicitly increments (cf. // http://goo.gl/o5C7Dx). // // If the reference count hits zero, the file system can forget about that ID @@ -239,6 +240,16 @@ func (o *SetInodeAttributesOp) Respond(err error) { // * (http://goo.gl/VQMQul) fuse_dentry_revalidate increments after // revalidating. // +// In contrast to all other inodes, RootInodeID begins with an implicit +// reference count of one, without a corresponding op to increase it: +// +// * (http://goo.gl/gWAheU) fuse_fill_super calls fuse_get_root_inode. +// +// * (http://goo.gl/AoLsbb) fuse_get_root_inode calls fuse_iget without +// sending any particular request. +// +// * (http://goo.gl/vPD9Oh) fuse_iget increments nlookup. +// type ForgetInodeOp struct { commonOp