* kernel. (If this flag is not set, returning ENOSYS will be treated
* as an error and signaled to the caller).
*
- * Setting (or unsetting) this flag in the `want` field has *no
- * effect*.
+ * Setting this flag in the `want` field enables this behavior automatically
+ * within libfuse for low level API users. If non-low level users wish to have
+ * this behavior you must return `ENOSYS` from the open() handler on supporting
+ * kernels.
*/
#define FUSE_CAP_NO_OPEN_SUPPORT (1 << 17)
* flag is not set, returning ENOSYS will be treated as an error and signalled
* to the caller.)
*
- * Setting (or unsetting) this flag in the `want` field has *no effect*.
+ * Setting this flag in the `want` field enables this behavior automatically
+ * within libfuse for low level API users. If non-low level users with to have
+ * this behavior you must return `ENOSYS` from the opendir() handler on
+ * supporting kernels.
*/
#define FUSE_CAP_NO_OPENDIR_SUPPORT (1 << 24)
* future calls to open and release will also succeed without being
* sent to the filesystem process.
*
+ * To get this behavior without providing an opendir handler, you may
+ * set FUSE_CAP_NO_OPEN_SUPPORT in `fuse_conn_info.want` on supported
+ * kernels to automatically get the zero message open().
+ *
+ * If this callback is not provided and FUSE_CAP_NO_OPEN_SUPPORT is not
+ * set in `fuse_conn_info.want` then an empty reply will be sent.
+ *
* Valid replies:
* fuse_reply_open
* fuse_reply_err
* process. In addition, the kernel will cache readdir results
* as if opendir returned FOPEN_KEEP_CACHE | FOPEN_CACHE_DIR.
*
+ * To get this behavior without providing an opendir handler, you may
+ * set FUSE_CAP_NO_OPENDIR_SUPPORT in `fuse_conn_info.want` on supported
+ * kernels to automatically get the zero message opendir().
+ *
+ * If this callback is not provided and FUSE_CAP_NO_OPENDIR_SUPPORT is
+ * not set in `fuse_conn_info.want` then an empty reply will be sent.
+ *
* Valid replies:
* fuse_reply_open
* fuse_reply_err
if (req->se->op.open)
req->se->op.open(req, nodeid, &fi);
+ else if (req->se->conn.want & FUSE_CAP_NO_OPEN_SUPPORT)
+ fuse_reply_err(req, ENOSYS);
else
fuse_reply_open(req, &fi);
}
if (req->se->op.opendir)
req->se->op.opendir(req, nodeid, &fi);
+ else if (req->se->conn.want & FUSE_CAP_NO_OPENDIR_SUPPORT)
+ fuse_reply_err(req, ENOSYS);
else
fuse_reply_open(req, &fi);
}