aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBernd Schubert <bschubert@ddn.com>2025-05-18 00:24:07 +0200
committerBernd Schubert <bernd@bsbernd.com>2025-05-20 18:14:44 +0200
commitbaadab0492a495fda98216b351976d2e5d6d0866 (patch)
tree61017d2976439c6b7453b402aad5ecd3816b72ef /include
parenteadd6a5454373c7c404463c81be652275da5e07b (diff)
downloadlibfuse-baadab0492a495fda98216b351976d2e5d6d0866.tar.gz
conn->want conversion: Fix fuse_apply_conn_info_opts()
fuse_apply_conn_info_opts() was applying to 'want_ext', which would cause conflicts with 'want' if the application applied its own flags to 'conn->want'. Solution is: - to move fuse_{set,unset,get}_feature_flag and convert_to_conn_want_ext() to fuse_lowlevel.c and to define them as part of the public API, although convert_to_conn_want_ext() should not be used - it is currently needed to be a public function due as it needs to be defined for the tests. Related to https://github.com/libfuse/libfuse/issues/1171 and https://github.com/libfuse/libfuse/pull/1172. Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Diffstat (limited to 'include')
-rw-r--r--include/fuse_common.h50
1 files changed, 31 insertions, 19 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 0b0ea4c..054c618 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -1107,28 +1107,40 @@ void fuse_loop_cfg_convert(struct fuse_loop_config *config,
struct fuse_loop_config_v1 *v1_conf);
#endif
+/**
+ * Set a feature flag in the want_ext field of fuse_conn_info.
+ *
+ * @param conn connection information
+ * @param flag feature flag to be set
+ * @return true if the flag was set, false if the flag is not supported
+ */
+bool fuse_set_feature_flag(struct fuse_conn_info *conn, uint64_t flag);
-static inline bool fuse_set_feature_flag(struct fuse_conn_info *conn,
- uint64_t flag)
-{
- if (conn->capable_ext & flag) {
- conn->want_ext |= flag;
- return true;
- }
- return false;
-}
+/**
+ * Unset a feature flag in the want_ext field of fuse_conn_info.
+ *
+ * @param conn connection information
+ * @param flag feature flag to be unset
+ */
+void fuse_unset_feature_flag(struct fuse_conn_info *conn, uint64_t flag);
+
+/**
+ * Get the value of a feature flag in the want_ext field of fuse_conn_info.
+ *
+ * @param conn connection information
+ * @param flag feature flag to be checked
+ * @return true if the flag is set, false otherwise
+ */
+bool fuse_get_feature_flag(struct fuse_conn_info *conn, uint64_t flag);
+
+/*
+ * DO NOT USE: Not part of public API, for internal test use only.
+ * The function signature or any use of it is not guaranteeed to
+ * remain stable. And neither are results of what this function does.
+ */
+int fuse_convert_to_conn_want_ext(struct fuse_conn_info *conn);
-static inline void fuse_unset_feature_flag(struct fuse_conn_info *conn,
- uint64_t flag)
-{
- conn->want_ext &= ~flag;
-}
-static inline bool fuse_get_feature_flag(struct fuse_conn_info *conn,
- uint64_t flag)
-{
- return conn->capable_ext & flag ? true : false;
-}
/* ----------------------------------------------------------- *
* Compatibility stuff *