From 1d8e8ca94a3faa635afd1a3bd8d7d26472063a3f Mon Sep 17 00:00:00 2001 From: AsumFace Date: Fri, 23 Aug 2019 21:58:06 +0200 Subject: Clarify bitfield padding issue (#445) * Clarify bitfield padding issue * Add a more elaborate note to fuse_file_info --- include/fuse_common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/fuse_common.h b/include/fuse_common.h index 0481aac..efee194 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -83,7 +83,13 @@ struct fuse_file_info { unsigned int cache_readdir : 1; /** Padding. Reserved for future use*/ - unsigned int padding : 26; + unsigned int padding : 25; + /* The following int was once allocated by accident, it is kept for + backwards compatibility. `padding2` may be used to implement additional + flags in the future just like `padding`. For the sake of compatibility + make sure that the bitfields fit into blocks of 32 bits exactly so that + no hidden padding exists in between. */ + unsigned int padding2 : 32; /** File handle id. May be filled in by filesystem in create, * open, and opendir(). Available in most other file operations on the @@ -246,7 +252,7 @@ struct fuse_loop_config { #define FUSE_CAP_READDIRPLUS (1 << 13) /** - * Indicates that the filesystem supports adaptive readdirplus. + * Indicates that the filesystem supports adaptive readdirplus. * * If FUSE_CAP_READDIRPLUS is not set, this flag has no effect. * -- cgit v1.2.3