[PATCH 49/61] ufs: update format strings for u64 i_ino

Jeff Layton
2026-02-26T16:06:31Z

Update format strings and local variable types in ufs for the
i_ino type change from unsigned long to u64.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/ufs/balloc.c | 6 +++---
fs/ufs/dir.c | 10 +++++-----
fs/ufs/ialloc.c | 6 +++---
fs/ufs/inode.c | 18 +++++++++---------
fs/ufs/ufs_fs.h | 6 +++---
fs/ufs/util.c | 2 +-
6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index 194ed3ab945e3eae94db085ee8d37eb1a4439470..628edfde3a9fd73852930094c19ae6944858f2c4 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -245,7 +245,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
sector_t end, i;
struct buffer_head *head, *bh;

- UFSD("ENTER, ino %lu, count %u, oldb %llu, newb %llu\n",
+ UFSD("ENTER, ino %llu, count %u, oldb %llu, newb %llu\n",
inode->i_ino, count,
(unsigned long long)oldb, (unsigned long long)newb);

@@ -340,7 +340,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
unsigned cgno, oldcount, newcount;
u64 tmp, request, result;

- UFSD("ENTER, ino %lu, fragment %llu, goal %llu, count %u\n",
+ UFSD("ENTER, ino %llu, fragment %llu, goal %llu, count %u\n",
inode->i_ino, (unsigned long long)fragment,
(unsigned long long)goal, count);

@@ -583,7 +583,7 @@ static u64 ufs_alloc_fragments(struct inode *inode, unsigned cgno,
unsigned oldcg, i, j, k, allocsize;
u64 result;

- UFSD("ENTER, ino %lu, cgno %u, goal %llu, count %u\n",
+ UFSD("ENTER, ino %llu, cgno %u, goal %llu, count %u\n",
inode->i_ino, cgno, (unsigned long long)goal, count);

sb = inode->i_sb;
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 43f1578ab8666a9611d4a77f5aababfce812fbe4..f10a50f7e78b8020fd216eff19c147b20bd332c1 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -150,7 +150,7 @@ static bool ufs_check_folio(struct folio *folio, char *kaddr)

Ebadsize:
ufs_error(sb, __func__,
- "size of directory #%lu is not a multiple of chunk size",
+ "size of directory #%llu is not a multiple of chunk size",
dir->i_ino
);
goto fail;
@@ -169,7 +169,7 @@ static bool ufs_check_folio(struct folio *folio, char *kaddr)
Einumber:
error = "inode out of bounds";
bad_entry:
- ufs_error(sb, __func__, "bad entry in directory #%lu: %s - "
+ ufs_error(sb, __func__, "bad entry in directory #%llu: %s - "
"offset=%llu, rec_len=%d, name_len=%d",
dir->i_ino, error, folio_pos(folio) + offs,
rec_len, ufs_get_de_namlen(sb, p));
@@ -177,7 +177,7 @@ static bool ufs_check_folio(struct folio *folio, char *kaddr)
Eend:
p = (struct ufs_dir_entry *)(kaddr + offs);
ufs_error(sb, __func__,
- "entry in directory #%lu spans the page boundary"
+ "entry in directory #%llu spans the page boundary"
"offset=%llu",
dir->i_ino, folio_pos(folio) + offs);
fail:
@@ -258,7 +258,7 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr,
struct ufs_inode_info *ui = UFS_I(dir);
struct ufs_dir_entry *de;

- UFSD("ENTER, dir_ino %lu, name %s, namlen %u\n", dir->i_ino, name, namelen);
+ UFSD("ENTER, dir_ino %llu, name %s, namlen %u\n", dir->i_ino, name, namelen);

if (npages == 0 || namelen > UFS_MAXNAMLEN)
goto out;
@@ -434,7 +434,7 @@ ufs_readdir(struct file *file, struct dir_context *ctx)

if (IS_ERR(kaddr)) {
ufs_error(sb, __func__,
- "bad page in #%lu",
+ "bad page in #%llu",
inode->i_ino);
ctx->pos += PAGE_SIZE - offset;
return PTR_ERR(kaddr);
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index 73531827ecee12b3dff09aef0acc0e374b00fb29..8e51f4630d186ae49aa987ca46df20960f300614 100644
--- a/fs/ufs/ialloc.c
+++ b/fs/ufs/ialloc.c
@@ -63,7 +63,7 @@ void ufs_free_inode (struct inode * inode)
int is_directory;
unsigned ino, cg, bit;

- UFSD("ENTER, ino %lu\n", inode->i_ino);
+ UFSD("ENTER, ino %llu\n", inode->i_ino);

sb = inode->i_sb;
uspi = UFS_SB(sb)->s_uspi;
@@ -317,7 +317,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
bh = sb_bread(sb, uspi->s_sbbase + ufs_inotofsba(inode->i_ino));
if (!bh) {
ufs_warning(sb, "ufs_read_inode",
- "unable to read inode %lu\n",
+ "unable to read inode %llu\n",
inode->i_ino);
err = -EIO;
goto fail_remove_inode;
@@ -336,7 +336,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)
}
mutex_unlock(&sbi->s_lock);

- UFSD("allocating inode %lu\n", inode->i_ino);
+ UFSD("allocating inode %llu\n", inode->i_ino);
UFSD("EXIT\n");
return inode;

diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index e2b0a35de2a7000f46a298114c1dcaffa17c43dc..2a8728c879796403166f713d1b4ee1b05fe1ffed 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -400,7 +400,7 @@ static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buff

mutex_lock(&UFS_I(inode)->truncate_mutex);

- UFSD("ENTER, ino %lu, fragment %llu\n", inode->i_ino, (unsigned long long)fragment);
+ UFSD("ENTER, ino %llu, fragment %llu\n", inode->i_ino, (unsigned long long)fragment);
if (unlikely(!depth)) {
ufs_warning(sb, "ufs_get_block", "block > big");
err = -EIO;
@@ -595,7 +595,7 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
struct super_block *sb = inode->i_sb;
umode_t mode;

- UFSD("Reading ufs2 inode, ino %lu\n", inode->i_ino);
+ UFSD("Reading ufs2 inode, ino %llu\n", inode->i_ino);
/*
* Copy data to the in-core inode.
*/
@@ -662,7 +662,7 @@ struct inode *ufs_iget(struct super_block *sb, unsigned long ino)

bh = sb_bread(sb, uspi->s_sbbase + ufs_inotofsba(inode->i_ino));
if (!bh) {
- ufs_warning(sb, "ufs_read_inode", "unable to read inode %lu\n",
+ ufs_warning(sb, "ufs_read_inode", "unable to read inode %llu\n",
inode->i_ino);
goto bad_inode;
}
@@ -793,17 +793,17 @@ static int ufs_update_inode(struct inode * inode, int do_sync)
struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
struct buffer_head * bh;

- UFSD("ENTER, ino %lu\n", inode->i_ino);
+ UFSD("ENTER, ino %llu\n", inode->i_ino);

if (inode->i_ino < UFS_ROOTINO ||
inode->i_ino > (uspi->s_ncg * uspi->s_ipg)) {
- ufs_warning (sb, "ufs_read_inode", "bad inode number (%lu)\n", inode->i_ino);
+ ufs_warning (sb, "ufs_read_inode", "bad inode number (%llu)\n", inode->i_ino);
return -1;
}

bh = sb_bread(sb, ufs_inotofsba(inode->i_ino));
if (!bh) {
- ufs_warning (sb, "ufs_read_inode", "unable to read inode %lu\n", inode->i_ino);
+ ufs_warning (sb, "ufs_read_inode", "unable to read inode %llu\n", inode->i_ino);
return -1;
}
if (uspi->fs_magic == UFS2_MAGIC) {
@@ -891,7 +891,7 @@ static void ufs_trunc_direct(struct inode *inode)
unsigned int old_tail, new_tail;
struct to_free ctx = {.inode = inode};

- UFSD("ENTER: ino %lu\n", inode->i_ino);
+ UFSD("ENTER: ino %llu\n", inode->i_ino);

new_frags = DIRECT_FRAGMENT;
// new_frags = first fragment past the new EOF
@@ -956,7 +956,7 @@ static void ufs_trunc_direct(struct inode *inode)
}
}
done:
- UFSD("EXIT: ino %lu\n", inode->i_ino);
+ UFSD("EXIT: ino %llu\n", inode->i_ino);
}

static void free_full_branch(struct inode *inode, u64 ind_block, int depth)
@@ -1169,7 +1169,7 @@ static int ufs_truncate(struct inode *inode, loff_t size)
{
int err = 0;

- UFSD("ENTER: ino %lu, i_size: %llu, old_i_size: %llu\n",
+ UFSD("ENTER: ino %llu, i_size: %llu, old_i_size: %llu\n",
inode->i_ino, (unsigned long long)size,
(unsigned long long)i_size_read(inode));

diff --git a/fs/ufs/ufs_fs.h b/fs/ufs/ufs_fs.h
index 0905f9a16b9150b656bd6d8966c0f8cc220b439d..b8dc354ae90f4a0839303f89c87bd2940db62b99 100644
--- a/fs/ufs/ufs_fs.h
+++ b/fs/ufs/ufs_fs.h
@@ -226,10 +226,10 @@ typedef __u16 __bitwise __fs16;
* inode number to cylinder group number.
* inode number to file system block address.
*/
-#define ufs_inotocg(x) ((x) / uspi->s_ipg)
-#define ufs_inotocgoff(x) ((x) % uspi->s_ipg)
+#define ufs_inotocg(x) ((unsigned int)(x) / uspi->s_ipg)
+#define ufs_inotocgoff(x) ((unsigned int)(x) % uspi->s_ipg)
#define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
-#define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
+#define ufs_inotofsbo(x) ((unsigned int)(x) % uspi->s_inopf)

/*
* Compute the cylinder and rotational position of a cyl block addr.
diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 034b1d82c355ca49ec917e98dcfcc6d80e6eb00b..dff6f74618def7bd5687bd7427f3001a78b708b8 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -203,7 +203,7 @@ struct folio *ufs_get_locked_folio(struct address_space *mapping,
folio = read_mapping_folio(mapping, index, NULL);

if (IS_ERR(folio)) {
- printk(KERN_ERR "ufs_change_blocknr: read_mapping_folio error: ino %lu, index: %lu\n",
+ printk(KERN_ERR "ufs_change_blocknr: read_mapping_folio error: ino %llu, index: %lu\n",
mapping->host->i_ino, index);
return folio;
}

--
2.53.0