aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryangyun <yangyun50@huawei.com>2024-08-20 16:41:20 +0800
committerBernd Schubert <bernd.schubert@fastmail.fm>2024-09-23 18:13:41 +0200
commite338c523633daa4f16403d23762c30be4fab068a (patch)
tree8938d3116d6075528aa1c61ffe50fa745f8ad424
parent00c0e9a45bb6fb78e1f13a5604cd70507b4f1e56 (diff)
downloadlibfuse-e338c523633daa4f16403d23762c30be4fab068a.tar.gz
add version check for the fuse_loop_cfg* operations
fuse_loop_cfg* operations are introduced in fuse version 312 and can not be used in an early version. Also fix some typo.
-rw-r--r--include/fuse_common.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 6de2640..38bac4e 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -121,11 +121,15 @@ struct fuse_file_info {
/**
* Configuration parameters passed to fuse_session_loop_mt() and
* fuse_loop_mt().
+ * For FUSE API versions less than 312, use a public struct
+ * fuse_loop_config in applications and struct fuse_loop_config_v1
+ * is used in library (i.e., libfuse.so). These two structs are binary
+ * compatible in earlier API versions and can be linked.
* Deprecated and replaced by a newer private struct in FUSE API
- * version 312 (FUSE_MAKE_VERSION(3, 12)
+ * 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_v1; /* forward declaration */
struct fuse_loop_config {
#else
struct fuse_loop_config_v1 {
@@ -985,6 +989,12 @@ int fuse_set_fail_signal_handlers(struct fuse_session *se);
void fuse_remove_signal_handlers(struct fuse_session *se);
/**
+ * Config operations.
+ * These APIs are introduced in version 312 (FUSE_MAKE_VERSION(3, 12)).
+ * Using them in earlier versions will result in errors.
+ */
+#if FUSE_USE_VERSION >= FUSE_MAKE_VERSION(3, 12)
+/**
* Create and set default config for fuse_session_loop_mt and fuse_loop_mt.
*
* @return anonymous config struct
@@ -1022,6 +1032,7 @@ void fuse_loop_cfg_set_clone_fd(struct fuse_loop_config *config,
*/
void fuse_loop_cfg_convert(struct fuse_loop_config *config,
struct fuse_loop_config_v1 *v1_conf);
+#endif
/* ----------------------------------------------------------- *
* Compatibility stuff *