Improve documentation of FUSE_CAP_AUTO_INVAL_DATA
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 15 Nov 2016 03:29:59 +0000 (19:29 -0800)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 15 Nov 2016 03:29:59 +0000 (19:29 -0800)
Fixes #84.

include/fuse_common.h

index b6613a87b85b3466642dc62df4d528f7b765614f..4363e405b437e1ff5434566c868c07962202a16f 100644 (file)
@@ -149,8 +149,22 @@ struct fuse_file_info {
 #define FUSE_CAP_IOCTL_DIR             (1 << 11)
 
 /**
- * Indicates that the filesystem supports automatic invalidation of
- * cached pages.
+ * Traditionally, while a file is open the FUSE kernel module only
+ * asks the filesystem for an update of the file's attributes when a
+ * client attempts to read beyond EOF. This is unsuitable for
+ * e.g. network filesystems, where the file contents may change
+ * without the kernel knowing about it.
+ *
+ * If this flag is set, FUSE will check the validity of the attributes
+ * on every read. If the attributes are no longer valid (i.e., if the
+ * *attr_timeout* passed to fuse_reply_attr() or set in `struct
+ * fuse_entry_param` has passed), it will first issue a `getattr`
+ * request. If the new mtime differs from the previous value, any
+ * cached file *contents* will be invalidated as well.
+ *
+ * This flag should always be set when available. If all file changes
+ * go through the kernel, *attr_timeout* should be set to zero to
+ * avoid unneccessary getattr() calls.
  */
 #define FUSE_CAP_AUTO_INVAL_DATA       (1 << 12)