From 9581e214b8967bcdd3d0c45db3da14f2e1151220 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Tue, 25 Jun 2024 05:42:21 +0200 Subject: [PATCH] Annotate ABI sensitivness for some data structures These are not all ABI sensitive data structures yet. Also some space vs tab indentation issues are corrected. --- include/fuse.h | 6 +++++- include/fuse_common.h | 8 ++++++-- include/fuse_lowlevel.h | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/fuse.h b/include/fuse.h index ad50d7f..396358d 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -94,6 +94,9 @@ typedef int (*fuse_fill_dir_t) (void *buf, const char *name, * fuse_new(), and then passed to the file system's init() handler * which should ensure that the configuration is compatible with the * file system implementation. + * + * Note: this data structure is ABI sensitive, new options have to be + * appended at the end of the structure */ struct fuse_config { /** @@ -276,6 +279,7 @@ struct fuse_config { * fuse_file_info argument is NULL. */ int nullpath_ok; + /** * Allow parallel direct-io writes to operate on the same file. * @@ -292,7 +296,7 @@ struct fuse_config { int parallel_direct_writes; /** - * The remaining options are used by libfuse internally and + * These 3 options are used by libfuse internally and * should not be touched. */ int show_help; diff --git a/include/fuse_common.h b/include/fuse_common.h index c583af3..04ecb95 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -40,6 +40,10 @@ extern "C" { * concurrently open for the same file. Generally, a client will create one * file handle per file descriptor, though in some cases multiple file * descriptors can share a single file handle. + * + * Note: This data structure is ABI sensitive, new parameters have to be + * added within padding/padding2 bits and always below existing + * parameters. */ struct fuse_file_info { /** Open flags. Available in open(), release() and create() */ @@ -63,8 +67,8 @@ struct fuse_file_info { unsigned int keep_cache : 1; /** Can be filled by open/create, to allow parallel direct writes on this - * file */ - unsigned int parallel_direct_writes : 1; + file */ + unsigned int parallel_direct_writes : 1; /** Indicates a flush operation. Set in flush operation, also maybe set in highlevel lock operation and lowlevel release diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index e849617..e62e24c 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -199,6 +199,9 @@ enum fuse_notify_entry_flags { * interrupted, and the reply discarded. For example if * fuse_reply_open() return -ENOENT means, that the release method for * this file will not be called. + * + * This data structure is ABI sensitive, on adding new functions these need to + * be appended at the end of the struct */ struct fuse_lowlevel_ops { /** @@ -509,7 +512,7 @@ struct fuse_lowlevel_ops { * expected to properly handle the O_APPEND flag and ensure * that each write is appending to the end of the file. * - * - When writeback caching is enabled, the kernel will + * - When writeback caching is enabled, the kernel will * handle O_APPEND. However, unless all changes to the file * come through the kernel this will not work reliably. The * filesystem should thus either ignore the O_APPEND flag @@ -744,7 +747,7 @@ struct fuse_lowlevel_ops { * Returning a directory entry from readdir() does not affect * its lookup count. * - * If off_t is non-zero, then it will correspond to one of the off_t + * If off_t is non-zero, then it will correspond to one of the off_t * values that was previously returned by readdir() for the same * directory handle. In this case, readdir() should skip over entries * coming before the position defined by the off_t value. If entries -- 2.30.2