libfuse: fix readdirplus doc
authorNikolaus Rath <Nikolaus@rath.org>
Mon, 20 May 2013 12:44:59 +0000 (14:44 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 20 May 2013 12:44:59 +0000 (14:44 +0200)
Returning entry in readdir does not result in bump of lookup count.

Returning entry in readdirplus DOES result in increase of lookup count by
1. You need to provide valid nodeid and valid stat structure (with at least
valid type) for each entry.

include/fuse_lowlevel.h

index 0a1d5f5c1fe54de44de239396e61b8b6abe65da6..d46ef867477631599fd1f97c038a1817bc1d992d 100644 (file)
@@ -600,6 +600,9 @@ struct fuse_lowlevel_ops {
         *
         * fi->fh will contain the value set by the opendir method, or
         * will be undefined if the opendir method didn't set any value.
+         *
+        * Returning a directory entry from readdir() does not affect
+        * its lookup count.
         *
         * Valid replies:
         *   fuse_reply_buf
@@ -1026,6 +1029,10 @@ struct fuse_lowlevel_ops {
         *
         * fi->fh will contain the value set by the opendir method, or
         * will be undefined if the opendir method didn't set any value.
+         *
+        * In contrast to readdir() (which does not affect the lookup
+        * counts), the lookup count of every entry returned by
+        * readdirplus() is increased by one.
         *
         * Introduced in version 3.0
         *
@@ -1176,6 +1183,11 @@ int fuse_reply_buf(fuse_req_t req, const char *buf, size_t size);
  * Possible requests:
  *   read, readdir, getxattr, listxattr
  *
+ * Side effects:
+ *   when used to return data from a readdirplus() (but not readdir())
+ *   call, increments the lookup count of each returned entry by one
+ *   on success.
+ *
  * @param req request handle
  * @param bufv buffer vector
  * @param flags flags controlling the copy