diff options
author | Bernd Schubert <bernd@bsbernd.com> | 2024-12-28 15:10:03 +0100 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2024-12-30 23:04:11 +0100 |
commit | 24f5b129c4e1b03ebbd05ac0c7673f306facea1a (patch) | |
tree | e16f5b02a829457efab3f98ebbe54271e581a7f6 /include | |
parent | 3d90402f9084edb90ddb00d6ccd8c2183e6df140 (diff) | |
download | libfuse-24f5b129c4e1b03ebbd05ac0c7673f306facea1a.tar.gz |
Add 64-bit conn::{capable,want}_ext fields
The previous fields are left for ABI compatibility, although
it is not beautiful to add that complexity when we have to increase
the so-version as we had ABI breakage anyway.
example/printcap is simplified to use an array, as every line would
have needed to be modified anyway. Missing 'FUSE_CAP_PASSTHROUGH'
was added.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse_common.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h index 2c866c4..fbf16ba 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -540,6 +540,10 @@ struct fuse_loop_config_v1 { * Some of the elements are read-write, these can be changed to * indicate the value requested by the filesystem. The requested * value must usually be smaller than the indicated value. + * + * Note: The `capable` and `want` fields are limited to 32 bits for + * ABI compatibility. For full 64-bit capability support, use the + * `capable_ext` and `want_ext` fields instead. */ struct fuse_conn_info { /** @@ -578,6 +582,8 @@ struct fuse_conn_info { /** * Capability flags that the kernel supports (read-only) + * + * Deprecated left over for ABI compatibility, use capable_ext */ uint32_t capable; @@ -586,6 +592,10 @@ struct fuse_conn_info { * * libfuse attempts to initialize this field with * reasonable default values before calling the init() handler. + * + * Deprecated left over for ABI compatibility. + * Use want_ext with the helper functions + * fuse_set_feature_flag() / fuse_unset_feature_flag() */ uint32_t want; @@ -680,9 +690,25 @@ struct fuse_conn_info { uint32_t padding : 31; /** + * Extended capability flags that the kernel supports (read-only) + * This field provides full 64-bit capability support. + */ + uint64_t capable_ext; + + /** + * Extended capability flags that the filesystem wants to enable. + * This field provides full 64-bit capability support. + * + * Don't set this field directly, but use the helper functions + * fuse_set_feature_flag() / fuse_unset_feature_flag() + * + */ + uint64_t want_ext; + + /** * For future use. */ - uint32_t reserved[20]; + uint32_t reserved[16]; }; fuse_static_assert(sizeof(struct fuse_conn_info) == 128, "Size of struct fuse_conn_info must be 128 bytes"); @@ -1076,8 +1102,8 @@ void fuse_loop_cfg_convert(struct fuse_loop_config *config, static inline bool fuse_set_feature_flag(struct fuse_conn_info *conn, uint64_t flag) { - if (conn->capable & flag) { - conn->want |= flag; + if (conn->capable_ext & flag) { + conn->want_ext |= flag; return true; } return false; @@ -1086,7 +1112,13 @@ static inline bool fuse_set_feature_flag(struct fuse_conn_info *conn, static inline void fuse_unset_feature_flag(struct fuse_conn_info *conn, uint64_t flag) { - conn->want &= ~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; } /* ----------------------------------------------------------- * |