Skip to content

Commit b7d74ea

Browse files
committed
Merge tag 'vfs-7.1-rc1.kino' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs i_ino updates from Christian Brauner: "For historical reasons, the inode->i_ino field is an unsigned long, which means that it's 32 bits on 32 bit architectures. This has caused a number of filesystems to implement hacks to hash a 64-bit identifier into a 32-bit field, and deprives us of a universal identifier field for an inode. This changes the inode->i_ino field from an unsigned long to a u64. This shouldn't make any material difference on 64-bit hosts, but 32-bit hosts will see struct inode grow by at least 4 bytes. This could have effects on slabcache sizes and field alignment. The bulk of the changes are to format strings and tracepoints, since the kernel itself doesn't care that much about the i_ino field. The first patch changes some vfs function arguments, so check that one out carefully. With this change, we may be able to shrink some inode structures. For instance, struct nfs_inode has a fileid field that holds the 64-bit inode number. With this set of changes, that field could be eliminated. I'd rather leave that sort of cleanups for later just to keep this simple" * tag 'vfs-7.1-rc1.kino' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: nilfs2: fix 64-bit division operations in nilfs_bmap_find_target_in_group() EVM: add comment describing why ino field is still unsigned long vfs: remove externs from fs.h on functions modified by i_ino widening treewide: fix missed i_ino format specifier conversions ext4: fix signed format specifier in ext4_load_inode trace event treewide: change inode->i_ino from unsigned long to u64 nilfs2: widen trace event i_ino fields to u64 f2fs: widen trace event i_ino fields to u64 ext4: widen trace event i_ino fields to u64 zonefs: widen trace event i_ino fields to u64 hugetlbfs: widen trace event i_ino fields to u64 ext2: widen trace event i_ino fields to u64 cachefiles: widen trace event i_ino fields to u64 vfs: widen trace event i_ino fields to u64 net: change sock.sk_ino and sock_i_ino() to u64 audit: widen ino fields to u64 vfs: widen inode hash/lookup functions to u64
2 parents 0f00132 + 2e43ca1 commit b7d74ea

222 files changed

Lines changed: 1331 additions & 1321 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/dma-buf/dma-buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
17081708

17091709

17101710
spin_lock(&buf_obj->name_lock);
1711-
seq_printf(s, "%08zu\t%08x\t%08x\t%08ld\t%s\t%08lu\t%s\n",
1711+
seq_printf(s, "%08zu\t%08x\t%08x\t%08ld\t%s\t%08llu\t%s\n",
17121712
buf_obj->size,
17131713
buf_obj->file->f_flags, buf_obj->file->f_mode,
17141714
file_count(buf_obj->file),

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,9 +1676,9 @@ u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m)
16761676
attachment = READ_ONCE(bo->tbo.base.import_attach);
16771677

16781678
if (attachment)
1679-
seq_printf(m, " imported from ino:%lu", file_inode(dma_buf->file)->i_ino);
1679+
seq_printf(m, " imported from ino:%llu", file_inode(dma_buf->file)->i_ino);
16801680
else if (dma_buf)
1681-
seq_printf(m, " exported as ino:%lu", file_inode(dma_buf->file)->i_ino);
1681+
seq_printf(m, " exported as ino:%llu", file_inode(dma_buf->file)->i_ino);
16821682

16831683
amdgpu_bo_print_flag(m, bo, CPU_ACCESS_REQUIRED);
16841684
amdgpu_bo_print_flag(m, bo, NO_CPU_ACCESS);

fs/9p/vfs_addr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void v9fs_begin_writeback(struct netfs_io_request *wreq)
3636

3737
fid = v9fs_fid_find_inode(wreq->inode, true, INVALID_UID, true);
3838
if (!fid) {
39-
WARN_ONCE(1, "folio expected an open fid inode->i_ino=%lx\n",
39+
WARN_ONCE(1, "folio expected an open fid inode->i_ino=%llx\n",
4040
wreq->inode->i_ino);
4141
return;
4242
}
@@ -133,7 +133,7 @@ static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)
133133
return 0;
134134

135135
no_fid:
136-
WARN_ONCE(1, "folio expected an open fid inode->i_ino=%lx\n",
136+
WARN_ONCE(1, "folio expected an open fid inode->i_ino=%llx\n",
137137
rreq->inode->i_ino);
138138
return -EINVAL;
139139
}

fs/9p/vfs_inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ static int
12451245
v9fs_vfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
12461246
struct dentry *dentry, const char *symname)
12471247
{
1248-
p9_debug(P9_DEBUG_VFS, " %lu,%pd,%s\n",
1248+
p9_debug(P9_DEBUG_VFS, " %llu,%pd,%s\n",
12491249
dir->i_ino, dentry, symname);
12501250

12511251
return v9fs_vfs_mkspecial(dir, dentry, P9_DMSYMLINK, symname);
@@ -1269,7 +1269,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,
12691269
char name[1 + U32_MAX_DIGITS + 2]; /* sign + number + \n + \0 */
12701270
struct p9_fid *oldfid;
12711271

1272-
p9_debug(P9_DEBUG_VFS, " %lu,%pd,%pd\n",
1272+
p9_debug(P9_DEBUG_VFS, " %llu,%pd,%pd\n",
12731273
dir->i_ino, dentry, old_dentry);
12741274

12751275
oldfid = v9fs_fid_clone(old_dentry);
@@ -1305,7 +1305,7 @@ v9fs_vfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
13051305
char name[2 + U32_MAX_DIGITS + 1 + U32_MAX_DIGITS + 1];
13061306
u32 perm;
13071307

1308-
p9_debug(P9_DEBUG_VFS, " %lu,%pd mode: %x MAJOR: %u MINOR: %u\n",
1308+
p9_debug(P9_DEBUG_VFS, " %llu,%pd mode: %x MAJOR: %u MINOR: %u\n",
13091309
dir->i_ino, dentry, mode,
13101310
MAJOR(rdev), MINOR(rdev));
13111311

fs/9p/vfs_inode_dotl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ v9fs_vfs_symlink_dotl(struct mnt_idmap *idmap, struct inode *dir,
691691
struct p9_fid *fid = NULL;
692692

693693
name = dentry->d_name.name;
694-
p9_debug(P9_DEBUG_VFS, "%lu,%s,%s\n", dir->i_ino, name, symname);
694+
p9_debug(P9_DEBUG_VFS, "%llu,%s,%s\n", dir->i_ino, name, symname);
695695

696696
dfid = v9fs_parent_fid(dentry);
697697
if (IS_ERR(dfid)) {
@@ -734,7 +734,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
734734
struct p9_fid *dfid, *oldfid;
735735
struct v9fs_session_info *v9ses;
736736

737-
p9_debug(P9_DEBUG_VFS, "dir ino: %lu, old_name: %pd, new_name: %pd\n",
737+
p9_debug(P9_DEBUG_VFS, "dir ino: %llu, old_name: %pd, new_name: %pd\n",
738738
dir->i_ino, old_dentry, dentry);
739739

740740
v9ses = v9fs_inode2v9ses(dir);
@@ -798,7 +798,7 @@ v9fs_vfs_mknod_dotl(struct mnt_idmap *idmap, struct inode *dir,
798798
struct p9_qid qid;
799799
struct posix_acl *dacl = NULL, *pacl = NULL;
800800

801-
p9_debug(P9_DEBUG_VFS, " %lu,%pd mode: %x MAJOR: %u MINOR: %u\n",
801+
p9_debug(P9_DEBUG_VFS, " %llu,%pd mode: %x MAJOR: %u MINOR: %u\n",
802802
dir->i_ino, dentry, omode,
803803
MAJOR(rdev), MINOR(rdev));
804804

fs/affs/amigaffs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)
3333
ino = bh->b_blocknr;
3434
offset = affs_hash_name(sb, AFFS_TAIL(sb, bh)->name + 1, AFFS_TAIL(sb, bh)->name[0]);
3535

36-
pr_debug("%s(dir=%lu, ino=%d)\n", __func__, dir->i_ino, ino);
36+
pr_debug("%s(dir=%llu, ino=%d)\n", __func__, dir->i_ino, ino);
3737

3838
dir_bh = affs_bread(sb, dir->i_ino);
3939
if (!dir_bh)
@@ -83,7 +83,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
8383
sb = dir->i_sb;
8484
rem_ino = rem_bh->b_blocknr;
8585
offset = affs_hash_name(sb, AFFS_TAIL(sb, rem_bh)->name+1, AFFS_TAIL(sb, rem_bh)->name[0]);
86-
pr_debug("%s(dir=%lu, ino=%d, hashval=%d)\n", __func__, dir->i_ino,
86+
pr_debug("%s(dir=%llu, ino=%d, hashval=%d)\n", __func__, dir->i_ino,
8787
rem_ino, offset);
8888

8989
bh = affs_bread(sb, dir->i_ino);
@@ -128,7 +128,7 @@ affs_fix_dcache(struct inode *inode, u32 entry_ino)
128128
spin_lock(&inode->i_lock);
129129
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
130130
if (entry_ino == (u32)(long)dentry->d_fsdata) {
131-
dentry->d_fsdata = (void *)inode->i_ino;
131+
dentry->d_fsdata = (void *)(unsigned long)inode->i_ino;
132132
break;
133133
}
134134
}
@@ -147,7 +147,7 @@ affs_remove_link(struct dentry *dentry)
147147
u32 link_ino, ino;
148148
int retval;
149149

150-
pr_debug("%s(key=%ld)\n", __func__, inode->i_ino);
150+
pr_debug("%s(key=%llu)\n", __func__, inode->i_ino);
151151
retval = -EIO;
152152
bh = affs_bread(sb, inode->i_ino);
153153
if (!bh)
@@ -279,7 +279,7 @@ affs_remove_header(struct dentry *dentry)
279279
if (!inode)
280280
goto done;
281281

282-
pr_debug("%s(key=%ld)\n", __func__, inode->i_ino);
282+
pr_debug("%s(key=%llu)\n", __func__, inode->i_ino);
283283
retval = -EIO;
284284
bh = affs_bread(sb, (u32)(long)dentry->d_fsdata);
285285
if (!bh)

fs/affs/bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ affs_alloc_block(struct inode *inode, u32 goal)
125125
sb = inode->i_sb;
126126
sbi = AFFS_SB(sb);
127127

128-
pr_debug("balloc(inode=%lu,goal=%u): ", inode->i_ino, goal);
128+
pr_debug("balloc(inode=%llu,goal=%u): ", inode->i_ino, goal);
129129

130130
if (AFFS_I(inode)->i_pa_cnt) {
131131
pr_debug("%d\n", AFFS_I(inode)->i_lastalloc+1);

fs/affs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ affs_readdir(struct file *file, struct dir_context *ctx)
9090
u32 ino;
9191
int error = 0;
9292

93-
pr_debug("%s(ino=%lu,f_pos=%llx)\n", __func__, inode->i_ino, ctx->pos);
93+
pr_debug("%s(ino=%llu,f_pos=%llx)\n", __func__, inode->i_ino, ctx->pos);
9494

9595
if (ctx->pos < 2) {
9696
data->ino = 0;

fs/affs/file.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext);
2424
static int
2525
affs_file_open(struct inode *inode, struct file *filp)
2626
{
27-
pr_debug("open(%lu,%d)\n",
27+
pr_debug("open(%llu,%d)\n",
2828
inode->i_ino, atomic_read(&AFFS_I(inode)->i_opencnt));
2929
atomic_inc(&AFFS_I(inode)->i_opencnt);
3030
return 0;
@@ -33,7 +33,7 @@ affs_file_open(struct inode *inode, struct file *filp)
3333
static int
3434
affs_file_release(struct inode *inode, struct file *filp)
3535
{
36-
pr_debug("release(%lu, %d)\n",
36+
pr_debug("release(%llu, %d)\n",
3737
inode->i_ino, atomic_read(&AFFS_I(inode)->i_opencnt));
3838

3939
if (atomic_dec_and_test(&AFFS_I(inode)->i_opencnt)) {
@@ -301,7 +301,7 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
301301
struct buffer_head *ext_bh;
302302
u32 ext;
303303

304-
pr_debug("%s(%lu, %llu)\n", __func__, inode->i_ino,
304+
pr_debug("%s(%llu, %llu)\n", __func__, inode->i_ino,
305305
(unsigned long long)block);
306306

307307
BUG_ON(block > (sector_t)0x7fffffffUL);
@@ -534,7 +534,7 @@ static int affs_do_read_folio_ofs(struct folio *folio, size_t to, int create)
534534
size_t bidx, boff, bsize;
535535
u32 tmp;
536536

537-
pr_debug("%s(%lu, %ld, 0, %zu)\n", __func__, inode->i_ino,
537+
pr_debug("%s(%llu, %ld, 0, %zu)\n", __func__, inode->i_ino,
538538
folio->index, to);
539539
BUG_ON(to > folio_size(folio));
540540
bsize = AFFS_SB(sb)->s_data_blksize;
@@ -566,7 +566,7 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize)
566566
u32 size, bsize;
567567
u32 tmp;
568568

569-
pr_debug("%s(%lu, %d)\n", __func__, inode->i_ino, newsize);
569+
pr_debug("%s(%llu, %d)\n", __func__, inode->i_ino, newsize);
570570
bsize = AFFS_SB(sb)->s_data_blksize;
571571
bh = NULL;
572572
size = AFFS_I(inode)->mmu_private;
@@ -634,7 +634,7 @@ static int affs_read_folio_ofs(struct file *file, struct folio *folio)
634634
size_t to;
635635
int err;
636636

637-
pr_debug("%s(%lu, %ld)\n", __func__, inode->i_ino, folio->index);
637+
pr_debug("%s(%llu, %ld)\n", __func__, inode->i_ino, folio->index);
638638
to = folio_size(folio);
639639
if (folio_pos(folio) + to > inode->i_size) {
640640
to = inode->i_size - folio_pos(folio);
@@ -658,7 +658,7 @@ static int affs_write_begin_ofs(const struct kiocb *iocb,
658658
pgoff_t index;
659659
int err = 0;
660660

661-
pr_debug("%s(%lu, %llu, %llu)\n", __func__, inode->i_ino, pos,
661+
pr_debug("%s(%llu, %llu, %llu)\n", __func__, inode->i_ino, pos,
662662
pos + len);
663663
if (pos > AFFS_I(inode)->mmu_private) {
664664
/* XXX: this probably leaves a too-big i_size in case of
@@ -710,7 +710,7 @@ static int affs_write_end_ofs(const struct kiocb *iocb,
710710
* due to write_begin.
711711
*/
712712

713-
pr_debug("%s(%lu, %llu, %llu)\n", __func__, inode->i_ino, pos,
713+
pr_debug("%s(%llu, %llu, %llu)\n", __func__, inode->i_ino, pos,
714714
pos + len);
715715
bsize = AFFS_SB(sb)->s_data_blksize;
716716
data = folio_address(folio);
@@ -854,7 +854,7 @@ affs_free_prealloc(struct inode *inode)
854854
{
855855
struct super_block *sb = inode->i_sb;
856856

857-
pr_debug("free_prealloc(ino=%lu)\n", inode->i_ino);
857+
pr_debug("free_prealloc(ino=%llu)\n", inode->i_ino);
858858

859859
while (AFFS_I(inode)->i_pa_cnt) {
860860
AFFS_I(inode)->i_pa_cnt--;
@@ -874,7 +874,7 @@ affs_truncate(struct inode *inode)
874874
struct buffer_head *ext_bh;
875875
int i;
876876

877-
pr_debug("truncate(inode=%lu, oldsize=%llu, newsize=%llu)\n",
877+
pr_debug("truncate(inode=%llu, oldsize=%llu, newsize=%llu)\n",
878878
inode->i_ino, AFFS_I(inode)->mmu_private, inode->i_size);
879879

880880
last_blk = 0;

fs/affs/inode.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
3232
if (!(inode_state_read_once(inode) & I_NEW))
3333
return inode;
3434

35-
pr_debug("affs_iget(%lu)\n", inode->i_ino);
35+
pr_debug("affs_iget(%llu)\n", inode->i_ino);
3636

3737
block = inode->i_ino;
3838
bh = affs_bread(sb, block);
@@ -171,14 +171,14 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc)
171171
uid_t uid;
172172
gid_t gid;
173173

174-
pr_debug("write_inode(%lu)\n", inode->i_ino);
174+
pr_debug("write_inode(%llu)\n", inode->i_ino);
175175

176176
if (!inode->i_nlink)
177177
// possibly free block
178178
return 0;
179179
bh = affs_bread(sb, inode->i_ino);
180180
if (!bh) {
181-
affs_error(sb,"write_inode","Cannot read block %lu",inode->i_ino);
181+
affs_error(sb, "write_inode", "Cannot read block %llu", inode->i_ino);
182182
return -EIO;
183183
}
184184
tail = AFFS_TAIL(sb, bh);
@@ -219,7 +219,7 @@ affs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
219219
struct inode *inode = d_inode(dentry);
220220
int error;
221221

222-
pr_debug("notify_change(%lu,0x%x)\n", inode->i_ino, attr->ia_valid);
222+
pr_debug("notify_change(%llu,0x%x)\n", inode->i_ino, attr->ia_valid);
223223

224224
error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
225225
if (error)
@@ -260,7 +260,7 @@ void
260260
affs_evict_inode(struct inode *inode)
261261
{
262262
unsigned long cache_page;
263-
pr_debug("evict_inode(ino=%lu, nlink=%u)\n",
263+
pr_debug("evict_inode(ino=%llu, nlink=%u)\n",
264264
inode->i_ino, inode->i_nlink);
265265
truncate_inode_pages_final(&inode->i_data);
266266

@@ -353,7 +353,7 @@ affs_add_entry(struct inode *dir, struct inode *inode, struct dentry *dentry, s3
353353
u32 block = 0;
354354
int retval;
355355

356-
pr_debug("%s(dir=%lu, inode=%lu, \"%pd\", type=%d)\n", __func__,
356+
pr_debug("%s(dir=%llu, inode=%llu, \"%pd\", type=%d)\n", __func__,
357357
dir->i_ino, inode->i_ino, dentry, type);
358358

359359
retval = -EIO;

0 commit comments

Comments
 (0)