Re: [PATCH v2 001/110] vfs: introduce kino_t typedef and PRIino format macro
Jan Kara <[email protected]> Tue, 3 Mar 2026 12:00:21 +0100
| Newsgroups | gmane.linux.file-systems.f2fs,gmane.comp.video.dri.devel,gmane.linux.hams,gmane.comp.file-systems.ceph.devel,gmane.linux.kernel,gmane.linux.kernel.perf.user,gmane.linux.drivers.video-input-infrastructure,gmane.linux.kernel.cifs,gmane.comp.file-systems.nilfs.user,gmane.comp.file-systems.coda.general,gmane.linux.can,gmane.linux.drivers.mtd,gmane.comp.freedesktop.amd-gfx,gmane.linux.kernel.autofs,gmane.linux.nfs,gmane.comp.file-systems.ext4,gmane.linux.kernel.mm,gmane.network.samba.internals,gmane.linux.network,gmane.linux.file-systems,gmane.linux.kernel.bpf,gmane.comp.file-systems.ecryptfs.general,gmane.linux.file-systems.union,gmane.linux.x25,gmane.linux.bluez.kernel,gmane.comp.security.apparmor,gmane.linux.kernel.lsm |
|---|---|
| Message-ID | <qgxgwukvxgqggl2gd4cb3jt54ocvu23p3qurzwyxhtewtsu2sh@darljhcli56k> |
On Mon 02-03-26 15:23:45, Jeff Layton wrote: > Introduce a kino_t typedef and PRIino format macro to enable a > bisect-clean transition of i_ino from unsigned long to u64. > > kino_t is initially defined as unsigned long (matching the original > i_ino type), and PRIino is "l" (the format length modifier for > unsigned long). A later patch will change these to u64 and "ll" > respectively once all format strings have been updated to use PRIino. > > The PRIino macro is a length modifier, not a complete format specifier. > It is used as: "%" PRIino "u" for decimal, "%" PRIino "x" for hex, etc. > This follows the pattern used by userspace PRIu64/PRIx64 macros. > > Format strings using i_ino should be updated to use PRIino instead of > a hard-coded length modifier to ensure warning-free compilation on > both 32-bit and 64-bit architectures throughout the transition. > > Signed-off-by: Jeff Layton <[email protected]> Yeah, as a temporary solution for bisectability this looks fine to me. Feel free to add: Reviewed-by: Jan Kara <[email protected]> Honza > --- > include/linux/fs.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index 8b3dd145b25ec12b00ac1df17a952d9116b88047..e38bc5ece1f360d679a8f30b8171292f7a65c218 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -758,6 +758,9 @@ struct inode_state_flags { > enum inode_state_flags_enum __state; > }; > > +typedef unsigned long kino_t; > +#define PRIino "l" > + > /* > * Keep mostly read-only and often accessed (especially for > * the RCU path lookup and 'stat' data) fields at the beginning > @@ -783,7 +786,7 @@ struct inode { > #endif > > /* Stat data, not accessed from path walking */ > - unsigned long i_ino; > + kino_t i_ino; > /* > * Filesystems may only read i_nlink directly. They shall use the > * following functions for modification: > > -- > 2.53.0 > -- Jan Kara <[email protected]> SUSE Labs, CR