diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-04 22:36:02 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:55 -0400 |
commit | 45dd05b3ecc371560f9e36e4b57295ee338ee879 (patch) | |
tree | b4b456bfb9d1928a673d8e888cfb375c7d8a5002 /fs/bcachefs/bcachefs.h | |
parent | 2f528663c5abf101aae90b2adcce715bda424bfc (diff) | |
download | linux-stable-45dd05b3ecc371560f9e36e4b57295ee338ee879.tar.gz linux-stable-45dd05b3ecc371560f9e36e4b57295ee338ee879.tar.bz2 linux-stable-45dd05b3ecc371560f9e36e4b57295ee338ee879.zip |
bcachefs: BKEY_PADDED_ONSTACK()
Rust bindgen doesn't do anonymous structs very nicely: BKEY_PADDED()
only needs the anonymous struct when it's used on the stack, to
guarantee layout, not when it's embedded in another struct.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r-- | fs/bcachefs/bcachefs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index 509a16469613..baaa4cd3caa7 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -1123,4 +1123,7 @@ static inline bool bch2_dev_exists2(const struct bch_fs *c, unsigned dev) return dev < c->sb.nr_devices && c->devs[dev]; } +#define BKEY_PADDED_ONSTACK(key, pad) \ + struct { struct bkey_i key; __u64 key ## _pad[pad]; } + #endif /* _BCACHEFS_H */ |