aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsumFace <asumface@gmail.com>2019-08-23 21:58:06 +0200
committerNikolaus Rath <Nikolaus@rath.org>2019-08-23 20:58:06 +0100
commit1d8e8ca94a3faa635afd1a3bd8d7d26472063a3f (patch)
tree97817a6d7b696afeb5f0a27314973eb11d21fd05
parentf0e08cc700d629da2d46def8b620b0ed858cc0d9 (diff)
downloadlibfuse-1d8e8ca94a3faa635afd1a3bd8d7d26472063a3f.tar.gz
Clarify bitfield padding issue (#445)
* Clarify bitfield padding issue * Add a more elaborate note to fuse_file_info
-rw-r--r--include/fuse_common.h10
1 files changed, 8 insertions, 2 deletions
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.
*