aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBernd Schubert <bernd@bsbernd.com>2025-01-04 20:29:18 +0100
committerBernd Schubert <bernd@bsbernd.com>2025-01-06 13:40:18 +0100
commit1c58dc6c0e4001334b20290d24d20cec9f81e638 (patch)
treeec1b8405451a8d6189656d4b8dd5925b302441ba /include
parent0636f1fd5bf4c88f0fe04166c906a95a53837c35 (diff)
downloadlibfuse-1c58dc6c0e4001334b20290d24d20cec9f81e638.tar.gz
Avoid global declarion of internal functions that are new in 3.17
_fuse_new() is not supposed to be called by external users outside of internal functions or static inlined functions. This also removes several functions from lib/fuse_versionscript which where added and exported by commit 58f85bfa9b7d ("Add in the libfuse version a program...) as these are libfuse internal only. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h25
-rw-r--r--include/fuse_lowlevel.h26
2 files changed, 23 insertions, 28 deletions
diff --git a/include/fuse.h b/include/fuse.h
index dbfa439..c3add84 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -76,7 +76,7 @@ enum fuse_fill_dir_flags {
* stream. It does not need to be the actual physical position. A
* value of zero is reserved to indicate that seeking in directories
* is not supported.
- *
+ *
* @param buf the buffer passed to the readdir() operation
* @param name the file name of the directory entry
* @param stbuf file attributes, can be NULL
@@ -192,7 +192,7 @@ struct fuse_config {
* have to guarantee uniqueness, however some applications
* rely on this value being unique for the whole filesystem.
*
- * Note that this does *not* affect the inode that libfuse
+ * Note that this does *not* affect the inode that libfuse
* and the kernel use internally (also called the "nodeid").
*/
int32_t use_ino;
@@ -522,9 +522,9 @@ struct fuse_operations {
*
* Flush is called on each close() of a file descriptor, as opposed to
* release which is called on the close of the last file descriptor for
- * a file. Under Linux, errors returned by flush() will be passed to
+ * a file. Under Linux, errors returned by flush() will be passed to
* userspace as errors from close(), so flush() is a good place to write
- * back any cached dirty data. However, many applications ignore errors
+ * back any cached dirty data. However, many applications ignore errors
* on close(), and on non-Linux systems, close() may succeed even if flush()
* returns an error. For these reasons, filesystems should not assume
* that errors returned by flush will ever be noticed or even
@@ -978,11 +978,6 @@ fuse_main(int argc, char *argv[], const struct fuse_operations *op,
*/
void fuse_lib_help(struct fuse_args *args);
-struct fuse *_fuse_new(struct fuse_args *args,
- const struct fuse_operations *op,
- size_t op_size, struct libfuse_version *version,
- void *user_data);
-
/**
* Create a new FUSE filesystem.
*
@@ -1021,6 +1016,12 @@ fuse_new(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,
+ const struct fuse_operations *op, size_t op_size,
+ struct libfuse_version *version,
+ void *user_data);
+
struct libfuse_version version = {
.major = FUSE_MAJOR_VERSION,
.minor = FUSE_MINOR_VERSION,
@@ -1044,6 +1045,12 @@ fuse_new(struct fuse_args *args,
.padding = 0
};
+ /* 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);
}
#else /* LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS */
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 3d398de..0fa2039 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -2045,26 +2045,8 @@ int fuse_parse_cmdline_312(struct fuse_args *args,
#endif
#endif
-/*
- * This should mostly not be called directly, but instead the fuse_session_new()
- * macro should be used, which fills in the libfuse version compilation
- * is done against automatically.
- */
-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);
-
/* Do not call this directly, but only through fuse_session_new() */
-#if (defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS))
-struct fuse_session *
-_fuse_session_new(struct fuse_args *args,
- const struct fuse_lowlevel_ops *op,
- size_t op_size,
- struct libfuse_version *version,
- void *userdata);
-#else
+#if (!defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS))
struct fuse_session *
_fuse_session_new_317(struct fuse_args *args,
const struct fuse_lowlevel_ops *op,
@@ -2116,6 +2098,12 @@ fuse_session_new(struct fuse_args *args,
.padding = 0
};
+ /* not declared globally, to restrict usage of this function */
+ struct fuse_session *_fuse_session_new(
+ 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);
}