* [PATCH] fs/ufs: use flexible-array members in on-disk structs
@ 2026-10-07 11:13 Muhammad Mahdi Amirpour
0 siblings, 0 replies; only message in thread
From: Muhammad Mahdi Amirpour @ 2026-10-07 11:13 UTC (permalink / raw)
To: akpm; +Cc: linux-fsdevel, linux-kernel, Muhammad Mahdi Amirpour
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-07 11:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 11:13 [PATCH] fs/ufs: use flexible-array members in on-disk structs Muhammad Mahdi Amirpour
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®