From 2bdec0bc22ce39b307e299ee9ec19d1c58b640de Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 10 May 2024 11:52:20 -0400 Subject: Handle NO_OPEN/NO_OPENDIR support automatically (#949) If the file system doesn't provide a ->open or an ->opendir, and the kernel supports FUSE_CAP_NO_OPEN_SUPPORT or FUSE_CAP_NO_OPENDIR_SUPPORT, allow the implementation to set FUSE_CAP_NO_OPEN*_SUPPORT on conn->want in order to automatically get this behavior. Expand the documentation to be more explicit about the behavior of libfuse in the different cases WRT this capability. Signed-off-by: Josef Bacik --- include/fuse_common.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/fuse_common.h') diff --git a/include/fuse_common.h b/include/fuse_common.h index bafcda0..8803b68 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -325,8 +325,10 @@ struct fuse_loop_config_v1 { * 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) @@ -404,7 +406,10 @@ struct fuse_loop_config_v1 { * 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) -- cgit v1.2.3