Re: [PATCH v2 007/110] ext4: use PRIino format for i_ino
Jan Kara <[email protected]> Tue, 3 Mar 2026 12:20:54 +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 | <eb56qw5rblcnlqupj5lftynq2vts2idha54xpegrfgx45znfuz@mdjzriuawmfn> |
On Mon 02-03-26 15:23:51, Jeff Layton wrote: > Convert ext4 i_ino format strings to use the PRIino format > macro in preparation for the widening of i_ino via kino_t. > > In trace events, change __field(ino_t, ...) to __field(u64, ...) > and update TP_printk format strings to %llu/%llx to match the > widened field type. > > Update local variables and function parameters that hold i_ino > values from unsigned long to kino_t. > > Signed-off-by: Jeff Layton <[email protected]> Two small comments. Otherwise feel free to add: Reviewed-by: Jan Kara <[email protected]> > diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c > index 96ab95167bd6e10ba86e61a60cb0be9fbafe157f..43103816b80ef4901858bcd789acb0ffb2612317 100644 > --- a/fs/ext4/migrate.c > +++ b/fs/ext4/migrate.c > @@ -455,7 +455,7 @@ int ext4_ext_migrate(struct inode *inode) > * log, so disable fast commits for this transaction. > */ > ext4_fc_mark_ineligible(inode->i_sb, EXT4_FC_REASON_MIGRATE, handle); > - goal = (((inode->i_ino - 1) / EXT4_INODES_PER_GROUP(inode->i_sb)) * > + goal = (div_u64(inode->i_ino - 1, EXT4_INODES_PER_GROUP(inode->i_sb)) * Ext4 doesn't support more than 2^32 inodes (due to on-disk format). Thus i_ino is always guaranteed to be a number that fits in 32-bits. Thus I'd here just type i_ino to (unsigned int) and be done with it like you've done it at other places. ... > @@ -1823,7 +1823,7 @@ TRACE_EVENT(ext4_journal_start_inode, > TP_ARGS(inode, blocks, rsv_blocks, revoke_creds, type, IP), > > TP_STRUCT__entry( > - __field( unsigned long, ino ) > + __field( u64, ino ) > __field( dev_t, dev ) > __field( unsigned long, ip ) > __field( int, blocks ) > @@ -1843,9 +1843,10 @@ TRACE_EVENT(ext4_journal_start_inode, > ), > > TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d," > - " type %d, ino %lu, caller %pS", MAJOR(__entry->dev), > + " type %d, ino %llu, caller %pS", MAJOR(__entry->dev), > MINOR(__entry->dev), __entry->blocks, __entry->rsv_blocks, > - __entry->revoke_creds, __entry->type, __entry->ino, > + __entry->revoke_creds, __entry->type, > + (unsigned long long) __entry->ino, Not point in the type cast? Honza -- Jan Kara <[email protected]> SUSE Labs, CR