From 621ea837fa3ba8131ddfe7a492e7fce996132af7 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Wed, 8 Apr 2020 12:05:24 +0200 Subject: [PATCH] vhost_user_fs: Add the ZERO_MESSAGE_OPENDIR capability flag Add ZERO_MESSAGE_OPENDIR capability flag, corresponding to FUSE_NO_OPENDIR_SUPPORT introduced in FUSE 7.29. Signed-off-by: Sergio Lopez --- vhost_user_fs/src/fuse.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vhost_user_fs/src/fuse.rs b/vhost_user_fs/src/fuse.rs index 088458c87..88e9c7a75 100644 --- a/vhost_user_fs/src/fuse.rs +++ b/vhost_user_fs/src/fuse.rs @@ -143,6 +143,9 @@ const MAX_PAGES: u32 = 4_194_304; /// Cache READLINK responses const CACHE_SYMLINKS: u32 = 8_388_608; +/// Kernel supports zero-message opendir +const NO_OPENDIR_SUPPORT: u32 = 16_777_216; + bitflags! { /// A bitfield passed in as a parameter to and returned from the `init` method of the /// `FileSystem` trait. @@ -328,6 +331,16 @@ bitflags! { /// /// This feature is not currently supported. const CACHE_SYMLINKS = CACHE_SYMLINKS; + + /// Indicates support for zero-message opens. If this flag is set in the `capable` parameter + /// of the `init` trait method, then the file system may return `ENOSYS` from the opendir() handler + /// to indicate success. Further attempts to open directories will be handled in the kernel. (If + /// this flag is not set, returning ENOSYS will be treated as an error and signaled to the + /// caller). + /// + /// Setting (or not setting) the field in the `FsOptions` returned from the `init` method + /// has no effect. + const ZERO_MESSAGE_OPENDIR = NO_OPENDIR_SUPPORT; } }