From: Bernd Schubert Date: Mon, 10 Feb 2025 00:50:01 +0000 (+0100) Subject: fuse_new version fixes: Change to fuse_new_versioned X-Git-Tag: fuse-3.17.1-rc0~3 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5f748b316cae99d6f610b9b0c45d106219957ce1;p=qemu-gpiodev%2Flibfuse.git fuse_new version fixes: Change to fuse_new_versioned Another additon for https://github.com/libfuse/libfuse/issues/1092 Use _fuse_new_versioned() instead of _fuse_new_317 and actually also remove symbol versioning for it - we don't need it. Signed-off-by: Bernd Schubert --- diff --git a/include/fuse.h b/include/fuse.h index ab0c04a..c0857fd 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -1034,12 +1034,12 @@ struct fuse *_fuse_new_30(struct fuse_args *args, struct libfuse_version *version, void *user_data); static inline struct fuse * -fuse_new(struct fuse_args *args, +fuse_new_fn(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, void *user_data) { /* not declared globally, to restrict usage of this function */ - struct fuse *_fuse_new(struct fuse_args *args, + struct fuse *_fuse_new_30(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, struct libfuse_version *version, void *user_data); @@ -1053,10 +1053,9 @@ fuse_new(struct fuse_args *args, return _fuse_new_30(args, op, op_size, &version, user_data); } -#else -#if (defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS)) +#else /* FUSE_USE_VERSION */ static inline struct fuse * -fuse_new(struct fuse_args *args, +fuse_new_fn(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, void *user_data) { @@ -1068,36 +1067,14 @@ fuse_new(struct fuse_args *args, }; /* not declared globally, to restrict usage of this function */ - struct fuse *_fuse_new(struct fuse_args *args, - const struct fuse_operations *op, size_t op_size, - struct libfuse_version *version, - void *user_data); - - return _fuse_new(args, op, op_size, &version, user_data); + struct fuse *_fuse_new_31(struct fuse_args *args, + const struct fuse_operations *op, + size_t op_size, struct libfuse_version *version, + void *user_data); + return _fuse_new_31(args, op, op_size, &version, user_data); } -#else /* LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS */ -struct fuse *_fuse_new_317(struct fuse_args *args, - const struct fuse_operations *op, size_t op_size, - struct libfuse_version *version, - void *private_data); -#define _fuse_new(args, op, size, version, data) \ - _fuse_new_317(args, op, size, version, data) -static inline struct fuse * -fuse_new(struct fuse_args *args, - const struct fuse_operations *op, size_t op_size, - void *user_data) -{ - struct libfuse_version version = { - .major = FUSE_MAJOR_VERSION, - .minor = FUSE_MINOR_VERSION, - .hotfix = FUSE_HOTFIX_VERSION, - .padding = 0 - }; - - return _fuse_new_317(args, op, op_size, &version, user_data); -} -#endif /* LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS */ #endif +#define fuse_new(args, op, size, data) fuse_new_fn(args, op, size, data) /** * Mount a FUSE file system. diff --git a/lib/fuse.c b/lib/fuse.c index 0b04f47..6c69a68 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -4923,12 +4923,11 @@ void fuse_stop_cleanup_thread(struct fuse *f) * Not supposed to be called directly, but supposed to be called * through the fuse_new macro */ -struct fuse *_fuse_new_317(struct fuse_args *args, +struct fuse *_fuse_new_31(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, struct libfuse_version *version, void *user_data); -FUSE_SYMVER("_fuse_new_317", "_fuse_new@@FUSE_3.17") -struct fuse *_fuse_new_317(struct fuse_args *args, +struct fuse *_fuse_new_31(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, struct libfuse_version *version, void *user_data) @@ -5103,7 +5102,7 @@ struct fuse *_fuse_new_30(struct fuse_args *args, fuse_lib_help(args); return NULL; } else - return _fuse_new_317(args, op, op_size, version, user_data); + return _fuse_new_31(args, op, op_size, version, user_data); } /* ABI compat version */ @@ -5117,7 +5116,7 @@ struct fuse *fuse_new_31(struct fuse_args *args, /* unknown version */ struct libfuse_version version = { 0 }; - return _fuse_new_317(args, op, op_size, &version, user_data); + return _fuse_new_31(args, op, op_size, &version, user_data); } /* diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index 2d314c0..6c5fc83 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -191,9 +191,8 @@ FUSE_3.17 { global: fuse_main_real_versioned; fuse_session_new_versioned; -#if !defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS) - _fuse_new_317; -#endif + _fuse_new_30; + _fuse_new_31; fuse_passthrough_open; fuse_passthrough_close; fuse_session_custom_io_30; diff --git a/lib/helper.c b/lib/helper.c index cab5ada..a1cf98c 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -346,11 +346,11 @@ int fuse_main_real_versioned(int argc, char *argv[], goto out1; } - struct fuse *_fuse_new(struct fuse_args *args, + struct fuse *_fuse_new_31(struct fuse_args *args, const struct fuse_operations *op, size_t op_size, struct libfuse_version *version, void *user_data); - fuse = _fuse_new(&args, op, op_size, version, user_data); + fuse = _fuse_new_31(&args, op, op_size, version, user_data); if (fuse == NULL) { res = 3; goto out1;