Re: [PATCH v2 060/110] vfs: change kino_t from unsigned long to u64
From: Jan Kara <jack@suse.cz>
Date: 2026-03-03 11:29:50
Also in:
amd-gfx, autofs, bpf, ceph-devel, dri-devel, linux-bluetooth, linux-can, linux-cifs, linux-ext4, linux-f2fs-devel, linux-fscrypt, linux-fsdevel, linux-hams, linux-integrity, linux-media, linux-mm, linux-nfs, linux-perf-users, linux-sctp, linux-security-module, linux-unionfs, linux-xfs, lkml, netdev, netfs, ntfs3, nvdimm, ocfs2-devel, selinux, v9fs
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 <jlayton@kernel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
quoted hunk ↗ jump to hunk
---
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 [off-list ref]
SUSE Labs, CR