From: Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
Subject: [PATCH] fs/ufs: use flexible-array members in on-disk structs
Date: Wed, 7 Oct 2026 14:43:52 +0330 [thread overview]
Message-ID: <20261007111352.81417-1-ampr.mhd@gmail.com> (raw)
Replace one-element arrays with flexible-array members in the UFS
on-disk structures ufs_cylinder_group, ufs_old_cylinder_group, and
ufs_super_block_third.
Zero-length and one-element arrays are deprecated; the preferred
mechanism for such trailing arrays is an empty square bracket array.
All three fields are the last member of their struct, so their
offset within the struct is unchanged. The accessor macros in
ufs_fs.h and the field layout on disk continue to work identically.
No functional change.
Signed-off-by: Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
---
fs/ufs/ufs_fs.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ufs/ufs_fs.h b/fs/ufs/ufs_fs.h
index b8dc354ae..6c0493d69 100644
--- a/fs/ufs/ufs_fs.h
+++ b/fs/ufs/ufs_fs.h
@@ -571,7 +571,7 @@ struct ufs_cylinder_group {
} cg_u2;
__fs32 cg_sparecon[16]; /* reserved for future use */
} cg_u;
- __u8 cg_space[1]; /* space for cylinder group maps */
+ __u8 cg_space[]; /* space for cylinder group maps */
/* actually longer */
};
@@ -593,7 +593,7 @@ struct ufs_old_cylinder_group {
__fs16 cg_b[32][8]; /* positions of free blocks */
__u8 cg_iused[256]; /* used inode map */
__fs32 cg_magic; /* magic number */
- __u8 cg_free[1]; /* free block map */
+ __u8 cg_free[]; /* free block map */
/* actually longer */
};
@@ -952,7 +952,7 @@ struct ufs_super_block_third {
__fs32 fs_postbloff;
__fs32 fs_rotbloff;
__fs32 fs_magic;
- __u8 fs_space[1];
+ __u8 fs_space[];
};
#endif /* __LINUX_UFS_FS_H */
--
2.55.0
reply other threads:[~2026-10-07 11:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261007111352.81417-1-ampr.mhd@gmail.com \
--to=ampr.mhd@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®