Re: [PATCH v2 060/110] vfs: change kino_t from unsigned long to u64
Jan Kara <[email protected]> Tue, 3 Mar 2026 12:29:48 +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 | <yfjlanmzvvyuea5qeqnozxtb4ubpkdev3o7ibwmmoo3oczthtu@27zcimxovqjh> |
On Mon 02-03-26 15:24:44, Jeff Layton wrote: > Change kino_t from unsigned long to u64, and update PRIino from "l" > to "ll" accordingly. This is the actual type widening of i_ino. > > All format strings have already been converted to use PRIino, so this > change compiles warning-free on both 32-bit and 64-bit architectures. > > On 64-bit architectures, unsigned long is already 64 bits, so this is > effectively a type alias change with no runtime impact. On 32-bit > architectures, this widens i_ino from 32 to 64 bits, allowing > filesystems like NFS, CIFS, XFS, Ceph, and FUSE to store their native > 64-bit inode numbers without folding/hashing. > > The VFS already handles 64-bit inode numbers in kstat.ino (u64) and > statx.stx_ino (__u64). The existing overflow checks in cp_new_stat(), > cp_old_stat(), and cp_compat_stat() handle narrowing to 32-bit st_ino > with -EOVERFLOW, so userspace ABI is preserved. > > struct inode will grow by 4 bytes on 32-bit architectures. > > Signed-off-by: Jeff Layton <[email protected]> Looks good. Feel free to add: Reviewed-by: Jan Kara <[email protected]> Honza > --- > include/linux/fs.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index d0c4789838b5852111583a3e4cced88999496e68..4193817e02e8bf94f29514ca43379af21f37ac61 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -758,8 +758,8 @@ struct inode_state_flags { > enum inode_state_flags_enum __state; > }; > > -typedef unsigned long kino_t; > -#define PRIino "l" > +typedef u64 kino_t; > +#define PRIino "ll" > > /* > * Keep mostly read-only and often accessed (especially for > > -- > 2.53.0 > -- Jan Kara <[email protected]> SUSE Labs, CR