Rename to fuse_session_new_versioned
authorBernd Schubert <bernd@bsbernd.com>
Sat, 8 Feb 2025 13:35:46 +0000 (14:35 +0100)
committerBernd Schubert <bernd@bsbernd.com>
Mon, 10 Feb 2025 15:56:45 +0000 (16:56 +0100)
Similar previous renames to fuse_main_real_versioned,
but here for the low level fuse_session_new.
Also remove symbol versioned as part of "fuse_session_new"
as that function is not part of the official API/ABI
and to allow easier access with dlopen/dlsym.
Also switch back to a macro fuse_session_new, just in
case some code has some expectations on that.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
include/fuse_lowlevel.h
lib/compat.c
lib/fuse.c
lib/fuse_lowlevel.c
lib/fuse_versionscript

index f8213cae13cddba9c673a4032e599e5a17c3f2a2..d0617ba35f5481c49a33c4c96e0dee5fda660a3f 100644 (file)
@@ -2047,18 +2047,6 @@ int fuse_parse_cmdline_312(struct fuse_args *args,
 #endif
 #endif
 
-/* Do not call this directly, but only through fuse_session_new() */
-#if (!defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS))
-struct fuse_session *
-_fuse_session_new_317(struct fuse_args *args,
-                     const struct fuse_lowlevel_ops *op,
-                     size_t op_size,
-                     struct libfuse_version *version,
-                     void *userdata);
-#define _fuse_session_new(args, op, op_size, version, userdata)        \
-       _fuse_session_new_317(args, op, op_size, version, userdata)
-#endif
-
 /**
  * Create a low level session.
  *
@@ -2088,10 +2076,8 @@ _fuse_session_new_317(struct fuse_args *args,
  * @return the fuse session on success, NULL on failure
  **/
 static inline struct fuse_session *
-fuse_session_new(struct fuse_args *args,
-                const struct fuse_lowlevel_ops *op,
-                size_t op_size,
-                void *userdata)
+fuse_session_new_fn(struct fuse_args *args, const struct fuse_lowlevel_ops *op,
+                   size_t op_size, void *userdata)
 {
        struct libfuse_version version = {
                .major = FUSE_MAJOR_VERSION,
@@ -2101,13 +2087,16 @@ fuse_session_new(struct fuse_args *args,
        };
 
        /* not declared globally, to restrict usage of this function */
-       struct fuse_session *_fuse_session_new(
+       struct fuse_session *fuse_session_new_versioned(
                struct fuse_args *args, const struct fuse_lowlevel_ops *op,
                size_t op_size, struct libfuse_version *version,
                void *userdata);
 
-       return _fuse_session_new(args, op, op_size, &version, userdata);
+       return fuse_session_new_versioned(args, op, op_size, &version,
+                                         userdata);
 }
+#define fuse_session_new(args, op, op_size, userdata) \
+       fuse_session_new_fn(args, op, op_size, userdata)
 
 /*
  * This should mostly not be called directly, but instead the
index 685229920265af9240098f79cf52daf38d46879e..b98ca4b04abab17d223353c2edc80f2466fb0412 100644 (file)
@@ -60,6 +60,18 @@ int fuse_session_custom_io(struct fuse_session *se,
        return fuse_session_custom_io_30(se, io, fd);
 }
 
+#endif /* LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS */
+
+int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op,
+                     size_t op_size, void *user_data);
+int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
+                  size_t op_size, void *user_data);
+int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
+                  size_t op_size, void *user_data)
+{
+       return fuse_main_real_30(argc, argv, op, op_size, user_data);
+}
+
 struct fuse_session *fuse_session_new_30(struct fuse_args *args,
                                         const struct fuse_lowlevel_ops *op,
                                         size_t op_size, void *userdata);
@@ -72,15 +84,3 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
 {
        return fuse_session_new_30(args, op, op_size, userdata);
 }
-
-#endif /* LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS */
-
-int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op,
-                     size_t op_size, void *user_data);
-int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
-                  size_t op_size, void *user_data);
-int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
-                  size_t op_size, void *user_data)
-{
-       return fuse_main_real_30(argc, argv, op, op_size, user_data);
-}
index 5d57d2428d9175e883b591d6076fd5db3978e108..0b04f47d3a201cceed24932ccc3187b609f17a99 100644 (file)
@@ -5014,12 +5014,12 @@ struct fuse *_fuse_new_317(struct fuse_args *args,
 #endif
 
        /* not declared globally, to restrict usage of this function */
-       struct fuse_session *_fuse_session_new(
+       struct fuse_session *fuse_session_new_versioned(
                struct fuse_args *args, const struct fuse_lowlevel_ops *op,
                size_t op_size, struct libfuse_version *version,
                void *userdata);
-
-       f->se = _fuse_session_new(args, &llop, sizeof(llop), version, f);
+       f->se = fuse_session_new_versioned(args, &llop, sizeof(llop), version,
+                                          f);
        if (f->se == NULL)
                goto out_free_fs;
 
index 840142b27720a7d50efe44ddb69e8912015103ad..e3e79d5284e34e717fd939821fe35e455ab8f0b9 100644 (file)
@@ -3244,17 +3244,14 @@ int fuse_session_receive_buf_internal(struct fuse_session *se,
        return _fuse_session_receive_buf(se, buf, ch, true);
 }
 
-FUSE_SYMVER("_fuse_session_new_317", "_fuse_session_new@@FUSE_3.17")
-struct fuse_session *_fuse_session_new_317(struct fuse_args *args,
-                                          const struct fuse_lowlevel_ops *op,
-                                          size_t op_size,
-                                          struct libfuse_version *version,
-                                          void *userdata);
-struct fuse_session *_fuse_session_new_317(struct fuse_args *args,
-                                          const struct fuse_lowlevel_ops *op,
-                                          size_t op_size,
-                                          struct libfuse_version *version,
-                                          void *userdata)
+struct fuse_session *
+fuse_session_new_versioned(struct fuse_args *args,
+                          const struct fuse_lowlevel_ops *op, size_t op_size,
+                          struct libfuse_version *version, void *userdata);
+struct fuse_session *
+fuse_session_new_versioned(struct fuse_args *args,
+                          const struct fuse_lowlevel_ops *op, size_t op_size,
+                          struct libfuse_version *version, void *userdata)
 {
        int err;
        struct fuse_session *se;
@@ -3355,10 +3352,8 @@ out1:
 }
 
 struct fuse_session *fuse_session_new_30(struct fuse_args *args,
-                                         const struct fuse_lowlevel_ops *op,
-                                         size_t op_size,
-                                         void *userdata);
-FUSE_SYMVER("fuse_session_new_30", "fuse_session_new@FUSE_3.0")
+                                        const struct fuse_lowlevel_ops *op,
+                                        size_t op_size, void *userdata);
 struct fuse_session *fuse_session_new_30(struct fuse_args *args,
                                          const struct fuse_lowlevel_ops *op,
                                          size_t op_size,
@@ -3367,7 +3362,8 @@ struct fuse_session *fuse_session_new_30(struct fuse_args *args,
        /* unknown version */
        struct libfuse_version version = { 0 };
 
-       return _fuse_session_new_317(args, op, op_size, &version, userdata);
+       return fuse_session_new_versioned(args, op, op_size, &version,
+                                         userdata);
 }
 
 FUSE_SYMVER("fuse_session_custom_io_317", "fuse_session_custom_io@@FUSE_3.17")
index b31453b28a953d1f9664f3146360fac2b8a9ac0a..2d314c05117336996ed4c61a3a5058b0f1246966 100644 (file)
@@ -190,8 +190,8 @@ FUSE_3.12 {
 FUSE_3.17 {
        global:
                fuse_main_real_versioned;
+               fuse_session_new_versioned;
 #if !defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS)
-               _fuse_session_new_317;
                _fuse_new_317;
 #endif
                fuse_passthrough_open;