From ac2ccddc2689d5889fd1520383738b60dbafc1d0 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 4 Mar 2023 23:05:55 -0500 Subject: 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 --- fs/bcachefs/reflink.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fs/bcachefs/reflink.c') diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index 87446f7bad4f..d2e6adc13fb1 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.c @@ -233,7 +233,13 @@ static int bch2_make_extent_indirect(struct btree_trans *trans, orig->k.type = KEY_TYPE_reflink_p; r_p = bkey_i_to_reflink_p(orig); set_bkey_val_bytes(&r_p->k, sizeof(r_p->v)); + + /* FORTIFY_SOURCE is broken here, and doesn't provide unsafe_memset() */ +#if !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE) + __underlying_memset(&r_p->v, 0, sizeof(r_p->v)); +#else memset(&r_p->v, 0, sizeof(r_p->v)); +#endif r_p->v.idx = cpu_to_le64(bkey_start_offset(&r_v->k)); -- cgit v1.2.3