summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bkey.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-05 07:05:55 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:55 +0300
commitac2ccddc2689d5889fd1520383738b60dbafc1d0 (patch)
treec090c0f7749633a7d03ba3790fc2f9ec1b396318 /fs/bcachefs/bkey.h
parent45dd05b3ecc371560f9e36e4b57295ee338ee879 (diff)
downloadlinux-ac2ccddc2689d5889fd1520383738b60dbafc1d0.tar.xz
bcachefs: Drop some anonymous structs, unions
Rust bindgen doesn't cope well with anonymous structs and unions. This patch drops the fancy anonymous structs & unions in bkey_i that let us use the same helpers for bkey_i and bkey_packed; since bkey_packed is an internal type that's never exposed to outside code, it's only a minor inconvenienc. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey.h')
-rw-r--r--fs/bcachefs/bkey.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/bkey.h b/fs/bcachefs/bkey.h
index 28a70ad5a25d..dbe4873cad02 100644
--- a/fs/bcachefs/bkey.h
+++ b/fs/bcachefs/bkey.h
@@ -42,7 +42,12 @@ struct bkey_s {
};
};
-#define bkey_next(_k) vstruct_next(_k)
+#define bkey_p_next(_k) vstruct_next(_k)
+
+static inline struct bkey_i *bkey_next(struct bkey_i *k)
+{
+ return (struct bkey_i *) (k->_data + k->k.u64s);
+}
#define bkey_val_u64s(_k) ((_k)->u64s - BKEY_U64s)