xfs: clean up "%Ld/%Lu" which doesn't meet C standard
authorZeng Heng <zengheng4@huawei.com>
Sun, 18 Sep 2022 20:47:14 +0000 (06:47 +1000)
committerDave Chinner <david@fromorbit.com>
Sun, 18 Sep 2022 20:47:14 +0000 (06:47 +1000)
The "%Ld" specifier, which represents long long unsigned,
doesn't meet C language standard, and even more,
it makes people easily mistake with "%ld", which represent
long unsigned. So replace "%Ld" with "lld".

Do the same with "%Lu".

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode_item_recover.c
fs/xfs/xfs_stats.c

index e56723dc9cd5b940623aad0b05dc1facdc676903..49d0d4ea63fcdb11f9b1267f2c30e0585e765e70 100644 (file)
@@ -294,7 +294,7 @@ xfs_check_block(
                        else
                                thispa = XFS_BMBT_PTR_ADDR(mp, block, j, dmxr);
                        if (*thispa == *pp) {
-                               xfs_warn(mp, "%s: thispa(%d) == pp(%d) %Ld",
+                               xfs_warn(mp, "%s: thispa(%d) == pp(%d) %lld",
                                        __func__, j, i,
                                        (unsigned long long)be64_to_cpu(*thispa));
                                xfs_err(mp, "%s: ptrs are equal in node\n",
index 9327a4f392065605dc76f8e54131c4dc6b84a681..6b21760184d9ed33620bec3a72e78f49b161fd24 100644 (file)
@@ -78,7 +78,7 @@ xfs_iformat_local(
         */
        if (unlikely(size > XFS_DFORK_SIZE(dip, ip->i_mount, whichfork))) {
                xfs_warn(ip->i_mount,
-       "corrupt inode %Lu (bad size %d for local fork, size = %zd).",
+       "corrupt inode %llu (bad size %d for local fork, size = %zd).",
                        (unsigned long long) ip->i_ino, size,
                        XFS_DFORK_SIZE(dip, ip->i_mount, whichfork));
                xfs_inode_verifier_error(ip, -EFSCORRUPTED,
@@ -192,7 +192,7 @@ xfs_iformat_btree(
                                        XFS_DFORK_SIZE(dip, mp, whichfork) ||
                     ifp->if_nextents > ip->i_nblocks) ||
                     level == 0 || level > XFS_BM_MAXLEVELS(mp, whichfork)) {
-               xfs_warn(mp, "corrupt inode %Lu (btree).",
+               xfs_warn(mp, "corrupt inode %llu (btree).",
                                        (unsigned long long) ip->i_ino);
                xfs_inode_verifier_error(ip, -EFSCORRUPTED,
                                "xfs_iformat_btree", dfp, size,
index 28493c8e9bb231accb53884e1fd126c9d366c407..b3eeeae3afe1a7d35de0708cf34f7a97b98df6c7 100644 (file)
@@ -3119,7 +3119,7 @@ xfs_iflush(
        if (XFS_TEST_ERROR(dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC),
                               mp, XFS_ERRTAG_IFLUSH_1)) {
                xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
-                       "%s: Bad inode %Lu magic number 0x%x, ptr "PTR_FMT,
+                       "%s: Bad inode %llu magic number 0x%x, ptr "PTR_FMT,
                        __func__, ip->i_ino, be16_to_cpu(dip->di_magic), dip);
                goto flush_out;
        }
@@ -3129,7 +3129,7 @@ xfs_iflush(
                    ip->i_df.if_format != XFS_DINODE_FMT_BTREE,
                    mp, XFS_ERRTAG_IFLUSH_3)) {
                        xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
-                               "%s: Bad regular inode %Lu, ptr "PTR_FMT,
+                               "%s: Bad regular inode %llu, ptr "PTR_FMT,
                                __func__, ip->i_ino, ip);
                        goto flush_out;
                }
@@ -3140,7 +3140,7 @@ xfs_iflush(
                    ip->i_df.if_format != XFS_DINODE_FMT_LOCAL,
                    mp, XFS_ERRTAG_IFLUSH_4)) {
                        xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
-                               "%s: Bad directory inode %Lu, ptr "PTR_FMT,
+                               "%s: Bad directory inode %llu, ptr "PTR_FMT,
                                __func__, ip->i_ino, ip);
                        goto flush_out;
                }
@@ -3158,7 +3158,7 @@ xfs_iflush(
        if (XFS_TEST_ERROR(ip->i_forkoff > mp->m_sb.sb_inodesize,
                                mp, XFS_ERRTAG_IFLUSH_6)) {
                xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
-                       "%s: bad inode %Lu, forkoff 0x%x, ptr "PTR_FMT,
+                       "%s: bad inode %llu, forkoff 0x%x, ptr "PTR_FMT,
                        __func__, ip->i_ino, ip->i_forkoff, ip);
                goto flush_out;
        }
index d28ffaebd067000efbe0150b47cb217a23ee990d..0e5dba2343ea13e2e0451178097f6ad247371724 100644 (file)
@@ -321,7 +321,7 @@ xlog_recover_inode_commit_pass2(
         */
        if (XFS_IS_CORRUPT(mp, !xfs_verify_magic16(bp, dip->di_magic))) {
                xfs_alert(mp,
-       "%s: Bad inode magic number, dip = "PTR_FMT", dino bp = "PTR_FMT", ino = %Ld",
+       "%s: Bad inode magic number, dip = "PTR_FMT", dino bp = "PTR_FMT", ino = %lld",
                        __func__, dip, bp, in_f->ilf_ino);
                error = -EFSCORRUPTED;
                goto out_release;
@@ -329,7 +329,7 @@ xlog_recover_inode_commit_pass2(
        ldip = item->ri_buf[1].i_addr;
        if (XFS_IS_CORRUPT(mp, ldip->di_magic != XFS_DINODE_MAGIC)) {
                xfs_alert(mp,
-                       "%s: Bad inode log record, rec ptr "PTR_FMT", ino %Ld",
+                       "%s: Bad inode log record, rec ptr "PTR_FMT", ino %lld",
                        __func__, item, in_f->ilf_ino);
                error = -EFSCORRUPTED;
                goto out_release;
index 20e0534a772c92018b2c3a03bf38323dff89a172..881720c4cf70e9a583c81aefec2c07f27843c22c 100644 (file)
@@ -74,7 +74,7 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
                defer_relog += per_cpu_ptr(stats, i)->s.defer_relog;
        }
 
-       len += scnprintf(buf + len, PATH_MAX-len, "xpc %Lu %Lu %Lu\n",
+       len += scnprintf(buf + len, PATH_MAX-len, "xpc %llu %llu %llu\n",
                        xs_xstrat_bytes, xs_write_bytes, xs_read_bytes);
        len += scnprintf(buf + len, PATH_MAX-len, "defer_relog %llu\n",
                        defer_relog);