diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse.h | 3 | ||||
-rw-r--r-- | include/fuse_common.h | 45 | ||||
-rw-r--r-- | include/fuse_lowlevel.h | 41 |
3 files changed, 69 insertions, 20 deletions
diff --git a/include/fuse.h b/include/fuse.h index 1a2f841..917a91c 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -1011,6 +1011,9 @@ void fuse_exit(struct fuse *f); #if FUSE_USE_VERSION < 32 int fuse_loop_mt_31(struct fuse *f, int clone_fd); #define fuse_loop_mt(f, clone_fd) fuse_loop_mt_31(f, clone_fd) +#elif FUSE_USE_VERSION < FUSE_MAKE_VERSION(3, 12) +int fuse_loop_mt_32(struct fuse *f, struct fuse_loop_config *config); +#define fuse_loop_mt(f, config) fuse_loop_mt_32(f, config) #else /** * FUSE event loop with multiple threads diff --git a/include/fuse_common.h b/include/fuse_common.h index 3f7260c..b40814f 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -23,7 +23,7 @@ #define FUSE_MAJOR_VERSION 3 /** Minor version of FUSE library interface */ -#define FUSE_MINOR_VERSION 11 +#define FUSE_MINOR_VERSION 12 #define FUSE_MAKE_VERSION(maj, min) ((maj) * 100 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION) @@ -104,11 +104,20 @@ struct fuse_file_info { uint32_t poll_events; }; + + /** * Configuration parameters passed to fuse_session_loop_mt() and * fuse_loop_mt(). + * Deprecated and replaced by a newer private struct in FUSE API + * version 312 (FUSE_MAKE_VERSION(3, 12) */ +#if FUSE_USE_VERSION < FUSE_MAKE_VERSION(3, 12) +struct fuse_loop_config_v1; /* forward declarition */ struct fuse_loop_config { +#else +struct fuse_loop_config_v1 { +#endif /** * whether to use separate device fds for each thread * (may increase performance) @@ -128,6 +137,7 @@ struct fuse_loop_config { unsigned int max_idle_threads; }; + /************************************************************************** * Capability bits for 'fuse_conn_info.capable' and 'fuse_conn_info.want' * **************************************************************************/ @@ -834,6 +844,39 @@ int fuse_set_signal_handlers(struct fuse_session *se); */ void fuse_remove_signal_handlers(struct fuse_session *se); +/** + * Create and set default config for fuse_session_loop_mt and fuse_loop_mt. + * + * @return anonymous config struct + */ +struct fuse_loop_config *fuse_loop_cfg_create(void); + +/** + * Free the config data structure + */ +void fuse_loop_cfg_destroy(struct fuse_loop_config *config); + +/** + * fuse_loop_config2 setter to set the number of max idle threads. + */ +void fuse_loop_cfg_set_idle_threads(struct fuse_loop_config *config, + unsigned int value); + +/** + * fuse_loop_config2 setter to enable the clone_fd feature + */ +void fuse_loop_cfg_set_clone_fd(struct fuse_loop_config *config, + unsigned int value); + +/** + * Convert old config to more recernt fuse_loop_config2 + * + * @param config current config2 type + * @param v1_conf older config1 type (below FUSE API 312) + */ +void fuse_loop_cfg_convert(struct fuse_loop_config *config, + struct fuse_loop_config_v1 *v1_conf); + /* ----------------------------------------------------------- * * Compatibility stuff * * ----------------------------------------------------------- */ diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index d73e9fa..378742d 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -1968,26 +1968,29 @@ int fuse_session_mount(struct fuse_session *se, const char *mountpoint); int fuse_session_loop(struct fuse_session *se); #if FUSE_USE_VERSION < 32 -int fuse_session_loop_mt_31(struct fuse_session *se, int clone_fd); -#define fuse_session_loop_mt(se, clone_fd) fuse_session_loop_mt_31(se, clone_fd) + int fuse_session_loop_mt_31(struct fuse_session *se, int clone_fd); + #define fuse_session_loop_mt(se, clone_fd) fuse_session_loop_mt_31(se, clone_fd) +#elif FUSE_USE_VERSION < FUSE_MAKE_VERSION(3, 12) + int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *config); + #define fuse_session_loop_mt(se, config) fuse_session_loop_mt_32(se, config) #else -#if (!defined(__UCLIBC__) && !defined(__APPLE__)) -/** - * Enter a multi-threaded event loop. - * - * For a description of the return value and the conditions when the - * event loop exits, refer to the documentation of - * fuse_session_loop(). - * - * @param se the session - * @param config session loop configuration - * @return see fuse_session_loop() - */ -int fuse_session_loop_mt(struct fuse_session *se, struct fuse_loop_config *config); -#else -int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *config); -#define fuse_session_loop_mt(se, config) fuse_session_loop_mt_32(se, config) -#endif + #if (!defined(__UCLIBC__) && !defined(__APPLE__)) + /** + * Enter a multi-threaded event loop. + * + * For a description of the return value and the conditions when the + * event loop exits, refer to the documentation of + * fuse_session_loop(). + * + * @param se the session + * @param config session loop configuration + * @return see fuse_session_loop() + */ + int fuse_session_loop_mt(struct fuse_session *se, struct fuse_loop_config *config); + #else + int fuse_session_loop_mt_312(struct fuse_session *se, struct fuse_loop_config *config); + #define fuse_session_loop_mt(se, config) fuse_session_loop_mt_312(se, config) + #endif #endif /** |