[Linux-cluster] [PATCH] rm PRIX64 and friends
Mike Christie
michaelc at cs.wisc.edu
Sat Sep 3 05:18:56 UTC 2005
On EMT64 the macros spits out
warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 5 has type ‘uint64_t’
Since most of places these macros are used are in places where we
use uint64_t or int64_t the patch just has gfs2 use llu instead
of trying to define some macros.
Index: gfs2-kernel/src/gfs2/gfs2.h
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/gfs2.h,v
retrieving revision 1.13
diff -a -u -p -r1.13 gfs2.h
--- gfs2-kernel/src/gfs2/gfs2.h 22 Aug 2005 07:25:29 -0000 1.13
+++ gfs2-kernel/src/gfs2/gfs2.h 3 Sep 2005 05:07:31 -0000
@@ -34,18 +34,6 @@
#define NO_FORCE 0
#define FORCE 1
-#if (BITS_PER_LONG == 64)
-#define PRIu64 "lu"
-#define PRId64 "ld"
-#define PRIx64 "lx"
-#define PRIX64 "lX"
-#else
-#define PRIu64 "Lu"
-#define PRId64 "Ld"
-#define PRIx64 "Lx"
-#define PRIX64 "LX"
-#endif
-
/* Divide num by den. Round up if there is a remainder. */
#define DIV_RU(num, den) (((num) + (den) - 1) / (den))
#define MAKE_MULT8(x) (((x) + 7) & ~7)
Index: gfs2-kernel/src/gfs2/gfs2_ondisk.h
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/gfs2_ondisk.h,v
retrieving revision 1.13
diff -a -u -p -r1.13 gfs2_ondisk.h
--- gfs2-kernel/src/gfs2/gfs2_ondisk.h 2 Sep 2005 09:06:54 -0000 1.13
+++ gfs2-kernel/src/gfs2/gfs2_ondisk.h 3 Sep 2005 05:07:31 -0000
@@ -509,8 +509,8 @@ void gfs2_inum_out(struct gfs2_inum *no,
void gfs2_inum_print(struct gfs2_inum *no)
{
- pv(no, no_formal_ino, "%"PRIu64);
- pv(no, no_addr, "%"PRIu64);
+ pv(no, no_formal_ino, "%llu");
+ pv(no, no_addr, "%llu");
}
void gfs2_meta_header_in(struct gfs2_meta_header *mh, char *buf)
@@ -538,7 +538,7 @@ void gfs2_meta_header_print(struct gfs2_
pv(mh, mh_magic, "0x%.8X");
pv(mh, mh_type, "%u");
pv(mh, mh_format, "%u");
- pv(mh, mh_blkno, "%"PRIu64);
+ pv(mh, mh_blkno, "%llu");
}
void gfs2_sb_in(struct gfs2_sb *sb, char *buf)
@@ -627,11 +627,11 @@ void gfs2_rindex_out(struct gfs2_rindex
void gfs2_rindex_print(struct gfs2_rindex *ri)
{
- pv(ri, ri_addr, "%"PRIu64);
+ pv(ri, ri_addr, "%llu");
pv(ri, ri_length, "%u");
pv(ri, ri_pad, "%u");
- pv(ri, ri_data0, "%"PRIu64);
+ pv(ri, ri_data0, "%llu");
pv(ri, ri_data, "%u");
pv(ri, ri_bitbytes, "%u");
@@ -693,9 +693,9 @@ void gfs2_quota_out(struct gfs2_quota *q
void gfs2_quota_print(struct gfs2_quota *qu)
{
- pv(qu, qu_limit, "%"PRIu64);
- pv(qu, qu_warn, "%"PRIu64);
- pv(qu, qu_value, "%"PRId64);
+ pv(qu, qu_limit, "%llu");
+ pv(qu, qu_warn, "%llu");
+ pv(qu, qu_value, "%lld");
}
void gfs2_dinode_in(struct gfs2_dinode *di, char *buf)
@@ -775,16 +775,16 @@ void gfs2_dinode_print(struct gfs2_dinod
pv(di, di_uid, "%u");
pv(di, di_gid, "%u");
pv(di, di_nlink, "%u");
- pv(di, di_size, "%"PRIu64);
- pv(di, di_blocks, "%"PRIu64);
- pv(di, di_atime, "%"PRId64);
- pv(di, di_mtime, "%"PRId64);
- pv(di, di_ctime, "%"PRId64);
+ pv(di, di_size, "%llu");
+ pv(di, di_blocks, "%llu");
+ pv(di, di_atime, "%lld");
+ pv(di, di_mtime, "%lld");
+ pv(di, di_ctime, "%lld");
pv(di, di_major, "%u");
pv(di, di_minor, "%u");
- pv(di, di_goal_meta, "%"PRIu64);
- pv(di, di_goal_data, "%"PRIu64);
+ pv(di, di_goal_meta, "%llu");
+ pv(di, di_goal_data, "%llu");
pv(di, di_flags, "0x%.8X");
pv(di, di_payload_format, "%u");
@@ -793,7 +793,7 @@ void gfs2_dinode_print(struct gfs2_dinod
pv(di, di_depth, "%u");
pv(di, di_entries, "%u");
- pv(di, di_eattr, "%"PRIu64);
+ pv(di, di_eattr, "%llu");
pa(di, di_reserved, 32);
}
@@ -873,7 +873,7 @@ void gfs2_leaf_print(struct gfs2_leaf *l
pv(lf, lf_depth, "%u");
pv(lf, lf_entries, "%u");
pv(lf, lf_dirent_format, "%u");
- pv(lf, lf_next, "%"PRIu64);
+ pv(lf, lf_next, "%llu");
pa(lf, lf_reserved, 32);
}
@@ -948,7 +948,7 @@ void gfs2_log_header_out(struct gfs2_log
void gfs2_log_header_print(struct gfs2_log_header *lh)
{
gfs2_meta_header_print(&lh->lh_header);
- pv(lh, lh_sequence, "%"PRIu64);
+ pv(lh, lh_sequence, "%llu");
pv(lh, lh_flags, "0x%.8X");
pv(lh, lh_tail, "%u");
pv(lh, lh_blkno, "%u");
@@ -1010,8 +1010,8 @@ void gfs2_inum_range_out(struct gfs2_inu
void gfs2_inum_range_print(struct gfs2_inum_range *ir)
{
- pv(ir, ir_start, "%"PRIu64);
- pv(ir, ir_length, "%"PRIu64);
+ pv(ir, ir_start, "%llu");
+ pv(ir, ir_length, "%llu");
}
void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf)
@@ -1034,9 +1034,9 @@ void gfs2_statfs_change_out(struct gfs2_
void gfs2_statfs_change_print(struct gfs2_statfs_change *sc)
{
- pv(sc, sc_total, "%"PRId64);
- pv(sc, sc_free, "%"PRId64);
- pv(sc, sc_dinodes, "%"PRId64);
+ pv(sc, sc_total, "%lld");
+ pv(sc, sc_free, "%lld");
+ pv(sc, sc_dinodes, "%lld");
}
void gfs2_unlinked_tag_in(struct gfs2_unlinked_tag *ut, char *buf)
@@ -1084,7 +1084,7 @@ void gfs2_quota_change_out(struct gfs2_q
void gfs2_quota_change_print(struct gfs2_quota_change *qc)
{
- pv(qc, qc_change, "%"PRId64);
+ pv(qc, qc_change, "%lld");
pv(qc, qc_flags, "0x%.8X");
pv(qc, qc_id, "%u");
}
Index: gfs2-kernel/src/gfs2/glock.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/glock.c,v
retrieving revision 1.30
diff -a -u -p -r1.30 glock.c
--- gfs2-kernel/src/gfs2/glock.c 19 Aug 2005 07:52:14 -0000 1.30
+++ gfs2-kernel/src/gfs2/glock.c 3 Sep 2005 05:07:31 -0000
@@ -2370,7 +2370,7 @@ static int dump_inode(struct gfs2_inode
int error = -ENOBUFS;
gfs2_printf(" Inode:\n");
- gfs2_printf(" num = %"PRIu64"/%"PRIu64"\n",
+ gfs2_printf(" num = %llu %llu\n",
ip->i_num.no_formal_ino, ip->i_num.no_addr);
gfs2_printf(" type = %u\n", IF2DT(ip->i_di.di_mode));
gfs2_printf(" i_count = %d\n", atomic_read(&ip->i_count));
@@ -2406,7 +2406,7 @@ static int dump_glock(struct gfs2_glock
spin_lock(&gl->gl_spin);
- gfs2_printf("Glock (%u, %"PRIu64")\n",
+ gfs2_printf("Glock (%u, %llu)\n",
gl->gl_name.ln_type,
gl->gl_name.ln_number);
gfs2_printf(" gl_flags =");
Index: gfs2-kernel/src/gfs2/ioctl.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/ioctl.c,v
retrieving revision 1.18
diff -a -u -p -r1.18 ioctl.c
--- gfs2-kernel/src/gfs2/ioctl.c 11 Aug 2005 07:23:43 -0000 1.18
+++ gfs2-kernel/src/gfs2/ioctl.c 3 Sep 2005 05:07:31 -0000
@@ -275,9 +275,9 @@ static int gi_get_statfs(struct gfs2_ino
gfs2_printf("version 0\n");
gfs2_printf("bsize %u\n", sdp->sd_sb.sb_bsize);
- gfs2_printf("total %"PRIu64"\n", sc.sc_total);
- gfs2_printf("free %"PRIu64"\n", sc.sc_free);
- gfs2_printf("dinodes %"PRIu64"\n", sc.sc_dinodes);
+ gfs2_printf("total %lld\n", sc.sc_total);
+ gfs2_printf("free %lld\n", sc.sc_free);
+ gfs2_printf("dinodes %lld\n", sc.sc_dinodes);
error = 0;
@@ -353,7 +353,7 @@ static int gi_get_counters(struct gfs2_i
sdp->sd_jdesc->jd_blocks);
gfs2_printf("sd_reclaim_count:glocks on reclaim list::%d\n",
atomic_read(&sdp->sd_reclaim_count));
- gfs2_printf("sd_log_wraps:log wraps::%"PRIu64"\n",
+ gfs2_printf("sd_log_wraps:log wraps::%llu\n",
sdp->sd_log_wraps);
gfs2_printf("sd_bio_outstanding:outstanding BIO calls::%u\n",
atomic_read(&sdp->sd_bio_outstanding));
Index: gfs2-kernel/src/gfs2/lvb.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/lvb.c,v
retrieving revision 1.9
diff -a -u -p -r1.9 lvb.c
--- gfs2-kernel/src/gfs2/lvb.c 2 Sep 2005 09:06:54 -0000 1.9
+++ gfs2-kernel/src/gfs2/lvb.c 3 Sep 2005 05:07:31 -0000
@@ -54,8 +54,8 @@ void gfs2_quota_lvb_print(struct gfs2_qu
{
pv(qb, qb_magic, "%u");
pv(qb, qb_pad, "%u");
- pv(qb, qb_limit, "%"PRIu64);
- pv(qb, qb_warn, "%"PRIu64);
- pv(qb, qb_value, "%"PRId64);
+ pv(qb, qb_limit, "%llu");
+ pv(qb, qb_warn, "%llu");
+ pv(qb, qb_value, "%lld");
}
Index: gfs2-kernel/src/gfs2/meta_io.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/meta_io.c,v
retrieving revision 1.25
diff -a -u -p -r1.25 meta_io.c
--- gfs2-kernel/src/gfs2/meta_io.c 2 Sep 2005 09:06:54 -0000 1.25
+++ gfs2-kernel/src/gfs2/meta_io.c 3 Sep 2005 05:07:31 -0000
@@ -61,7 +61,7 @@ static void stuck_releasepage(struct buf
struct gfs2_glock *gl;
fs_warn(sdp, "stuck in gfs2_releasepage()\n");
- fs_warn(sdp, "blkno = %"PRIu64", bh->b_count = %d\n",
+ fs_warn(sdp, "blkno = %llu, bh->b_count = %d\n",
(uint64_t)bh->b_blocknr, atomic_read(&bh->b_count));
fs_warn(sdp, "pinned = %u\n", buffer_pinned(bh));
fs_warn(sdp, "get_v2bd(bh) = %s\n", (bd) ? "!NULL" : "NULL");
@@ -71,7 +71,7 @@ static void stuck_releasepage(struct buf
gl = bd->bd_gl;
- fs_warn(sdp, "gl = (%u, %"PRIu64")\n",
+ fs_warn(sdp, "gl = (%u, %llu)\n",
gl->gl_name.ln_type, gl->gl_name.ln_number);
fs_warn(sdp, "bd_list_tr = %s, bd_le.le_list = %s\n",
@@ -85,7 +85,7 @@ static void stuck_releasepage(struct buf
if (!ip)
return;
- fs_warn(sdp, "ip = %"PRIu64"/%"PRIu64"\n",
+ fs_warn(sdp, "ip = %llu %llu\n",
ip->i_num.no_formal_ino, ip->i_num.no_addr);
fs_warn(sdp, "ip->i_count = %d, ip->i_vnode = %s\n",
atomic_read(&ip->i_count),
Index: gfs2-kernel/src/gfs2/rgrp.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/rgrp.c,v
retrieving revision 1.25
diff -a -u -p -r1.25 rgrp.c
--- gfs2-kernel/src/gfs2/rgrp.c 19 Aug 2005 07:52:15 -0000 1.25
+++ gfs2-kernel/src/gfs2/rgrp.c 3 Sep 2005 05:07:32 -0000
@@ -1013,7 +1013,7 @@ static struct gfs2_rgrpd *rgblk_free(str
rgd = gfs2_blk2rgrpd(sdp, bstart);
if (!rgd) {
if (gfs2_consist(sdp))
- fs_err(sdp, "block = %"PRIu64"\n", bstart);
+ fs_err(sdp, "block = %llu\n", bstart);
return NULL;
}
@@ -1302,7 +1302,7 @@ void gfs2_rlist_add(struct gfs2_sbd *sdp
rgd = gfs2_blk2rgrpd(sdp, block);
if (!rgd) {
if (gfs2_consist(sdp))
- fs_err(sdp, "block = %"PRIu64"\n", block);
+ fs_err(sdp, "block = %llu\n", block);
return;
}
Index: gfs2-kernel/src/gfs2/util.c
===================================================================
RCS file: /cvs/cluster/cluster/gfs2-kernel/src/gfs2/util.c,v
retrieving revision 1.17
diff -a -u -p -r1.17 util.c
--- gfs2-kernel/src/gfs2/util.c 19 Aug 2005 07:52:15 -0000 1.17
+++ gfs2-kernel/src/gfs2/util.c 3 Sep 2005 05:07:32 -0000
@@ -147,7 +147,7 @@ int gfs2_consist_inode_i(struct gfs2_ino
struct gfs2_sbd *sdp = ip->i_sbd;
return gfs2_lm_withdraw(sdp,
"GFS2: fsid=%s: fatal: filesystem consistency error\n"
- "GFS2: fsid=%s: inode = %"PRIu64"/%"PRIu64"\n"
+ "GFS2: fsid=%s: inode = %llu %llu\n"
"GFS2: fsid=%s: function = %s\n"
"GFS2: fsid=%s: file = %s, line = %u\n"
"GFS2: fsid=%s: time = %lu\n",
@@ -171,7 +171,7 @@ int gfs2_consist_rgrpd_i(struct gfs2_rgr
struct gfs2_sbd *sdp = rgd->rd_sbd;
return gfs2_lm_withdraw(sdp,
"GFS2: fsid=%s: fatal: filesystem consistency error\n"
- "GFS2: fsid=%s: RG = %"PRIu64"\n"
+ "GFS2: fsid=%s: RG = %llu\n"
"GFS2: fsid=%s: function = %s\n"
"GFS2: fsid=%s: file = %s, line = %u\n"
"GFS2: fsid=%s: time = %lu\n",
@@ -195,7 +195,7 @@ int gfs2_meta_check_ii(struct gfs2_sbd *
int me;
me = gfs2_lm_withdraw(sdp,
"GFS2: fsid=%s: fatal: invalid metadata block\n"
- "GFS2: fsid=%s: bh = %"PRIu64" (%s)\n"
+ "GFS2: fsid=%s: bh = %llu (%s)\n"
"GFS2: fsid=%s: function = %s\n"
"GFS2: fsid=%s: file = %s, line = %u\n"
"GFS2: fsid=%s: time = %lu\n",
@@ -220,7 +220,7 @@ int gfs2_metatype_check_ii(struct gfs2_s
int me;
me = gfs2_lm_withdraw(sdp,
"GFS2: fsid=%s: fatal: invalid metadata block\n"
- "GFS2: fsid=%s: bh = %"PRIu64" (type: exp=%u, found=%u)\n"
+ "GFS2: fsid=%s: bh = %llu (type: exp=%u, found=%u)\n"
"GFS2: fsid=%s: function = %s\n"
"GFS2: fsid=%s: file = %s, line = %u\n"
"GFS2: fsid=%s: time = %lu\n",
@@ -263,7 +263,7 @@ int gfs2_io_error_bh_i(struct gfs2_sbd *
{
return gfs2_lm_withdraw(sdp,
"GFS2: fsid=%s: fatal: I/O error\n"
- "GFS2: fsid=%s: block = %"PRIu64"\n"
+ "GFS2: fsid=%s: block = %llu\n"
"GFS2: fsid=%s: function = %s\n"
"GFS2: fsid=%s: file = %s, line = %u\n"
"GFS2: fsid=%s: time = %lu\n",
More information about the Linux-cluster
mailing list