jbd2: avoid dozens of -Wflex-array-member-not-at-end warnings
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 1 Nov 2024 20:45:23 +0000 (14:45 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Nov 2024 17:56:48 +0000 (12:56 -0500)
commit2bd9077b6261b8f1281d0fa74d51afe090319263
tree2286787b9fc503a7f752da9148ce4ef3ace5131a
parent6a0c5887a54318eaaafb00825ebb10d1f7c8f0cf
jbd2: avoid dozens of -Wflex-array-member-not-at-end warnings

-Wflex-array-member-not-at-end was introduced in GCC-14, and we
are getting ready to enable it, globally.

Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of
a flexible structure (`struct shash_desc`) where the size of the
flexible-array member (`__ctx`) is known at compile-time, and
refactor the rest of the code, accordingly.

So, with this, fix 77 of the following warnings:

include/linux/jbd2.h:1800:35: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/ZyU94w0IALVhc9Jy@kspp
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
include/linux/jbd2.h