[Ocfs2-tools-devel] [PATCH 5/7] fsck: Suppress build warnings

Sunil Mushran sunil.mushran at oracle.com
Tue Jun 3 14:46:42 PDT 2008


From: Tao Ma <tao.ma at oracle.com>

This patch silences the following warning:
extent.c:88: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 5 has type ‘__u64’

This patch silences the build warning by casting the argument as uint64_t.

Signed-off-by: Tao Ma <tao.ma at oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 fsck.ocfs2/extent.c |   38 ++++++++++++----------
 fsck.ocfs2/pass0.c  |   86 ++++++++++++++++++++++++++++----------------------
 fsck.ocfs2/pass1.c  |   77 ++++++++++++++++++++++++++-------------------
 fsck.ocfs2/pass2.c  |   20 ++++++------
 fsck.ocfs2/pass4.c  |   14 +++++---
 fsck.ocfs2/util.c   |    6 ++--
 6 files changed, 134 insertions(+), 107 deletions(-)

diff --git a/fsck.ocfs2/extent.c b/fsck.ocfs2/extent.c
index 718719a..665704d 100644
--- a/fsck.ocfs2/extent.c
+++ b/fsck.ocfs2/extent.c
@@ -85,7 +85,7 @@ static errcode_t check_eb(o2fsck_state *ost, struct extent_info *ei,
 	if (ret) {
 		com_err(whoami, ret, "reading extent block at %"PRIu64" in "
 			"inode %"PRIu64" for verification", blkno, 
-			di->i_blkno);
+			(uint64_t)di->i_blkno);
 		if (ret == OCFS2_ET_BAD_EXTENT_BLOCK_MAGIC)
 			*is_valid = 0;
 		goto out;
@@ -97,8 +97,8 @@ static errcode_t check_eb(o2fsck_state *ost, struct extent_info *ei,
 	    prompt(ost, PY, PR_EB_BLKNO,
 		   "An extent block at %"PRIu64" in inode %"PRIu64" "
 		   "claims to be located at block %"PRIu64".  Update the "
-		   "extent block's location?", blkno, di->i_blkno,
-		   eb->h_blkno)) {
+		   "extent block's location?", blkno, (uint64_t)di->i_blkno,
+		   (uint64_t)eb->h_blkno)) {
 		eb->h_blkno = blkno;
 		changed = 1;
 	}
@@ -108,8 +108,10 @@ static errcode_t check_eb(o2fsck_state *ost, struct extent_info *ei,
 			   "An extent block at %"PRIu64" in inode "
 			   "%"PRIu64" has a generation of %x which doesn't "
 			   "match the volume's generation of %x.  Consider "
-			   "this extent block invalid?", blkno, di->i_blkno,
-			   eb->h_fs_generation, ost->ost_fs_generation)) {
+			   "this extent block invalid?", blkno,
+			   (uint64_t)di->i_blkno,
+			   eb->h_fs_generation,
+			   ost->ost_fs_generation)) {
 
 			*is_valid = 0;
 			goto out;
@@ -135,7 +137,7 @@ static errcode_t check_eb(o2fsck_state *ost, struct extent_info *ei,
 		if (ret) {
 			com_err(whoami, ret, "while writing an updated extent "
 				"block at %"PRIu64" for inode %"PRIu64,
-				blkno, di->i_blkno);
+				blkno, (uint64_t)di->i_blkno);
 			goto out;
 		}
 	}
@@ -159,7 +161,7 @@ static errcode_t check_er(o2fsck_state *ost, struct extent_info *ei,
 
 	clusters = ocfs2_rec_clusters(el->l_tree_depth, er);
 	verbosef("cpos %u clusters %u blkno %"PRIu64"\n", er->e_cpos,
-		 clusters, er->e_blkno);
+		 clusters, (uint64_t)er->e_blkno);
 
 	if (ocfs2_block_out_of_range(ost->ost_fs, er->e_blkno))
 		goto out;
@@ -177,8 +179,8 @@ static errcode_t check_er(o2fsck_state *ost, struct extent_info *ei,
 			   "The extent record for cluster offset "
 			   "%"PRIu32" in inode %"PRIu64" refers to an invalid "
 			   "extent block at %"PRIu64".  Clear the reference "
-			   "to this invalid block?", er->e_cpos, di->i_blkno,
-			   er->e_blkno)) {
+			   "to this invalid block?", er->e_cpos,
+			   (uint64_t)di->i_blkno, (uint64_t)er->e_blkno)) {
 
 			er->e_blkno = 0;
 			*changed = 1;
@@ -196,7 +198,8 @@ static errcode_t check_er(o2fsck_state *ost, struct extent_info *ei,
 		   "in inode %"PRIu64" refers to block %"PRIu64" which isn't "
 		   "aligned with the start of a cluster.  Point the extent "
 		   "record at block %"PRIu64" which starts this cluster?",
-		   er->e_cpos, di->i_blkno, er->e_blkno, first_block)) {
+		   er->e_cpos, (uint64_t)di->i_blkno,
+		   (uint64_t)er->e_blkno, first_block)) {
 
 		er->e_blkno = first_block;
 		*changed = 1;
@@ -212,8 +215,9 @@ static errcode_t check_er(o2fsck_state *ost, struct extent_info *ei,
 		   "The extent record for cluster offset %"PRIu32" "
 		   "in inode %"PRIu64" refers to an extent that goes beyond "
 		   "the end of the volume.  Truncate the extent by %"PRIu32" "
-		   "clusters to fit it in the volume?", er->e_cpos, 
-		   di->i_blkno, last_cluster - ost->ost_fs->fs_clusters)) {
+		   "clusters to fit it in the volume?", er->e_cpos,
+		   (uint64_t)di->i_blkno,
+		   last_cluster - ost->ost_fs->fs_clusters)) {
 
 		clusters -= last_cluster - ost->ost_fs->fs_clusters;
 		ocfs2_set_rec_clusters(el->l_tree_depth, er, clusters);
@@ -249,7 +253,7 @@ static errcode_t check_el(o2fsck_state *ost, struct extent_info *ei,
 	    prompt(ost, PY, PR_EXTENT_LIST_DEPTH,
 		   "Extent list in inode %"PRIu64" is recorded as "
 		   "being at depth %u but we expect it to be at depth %u. "
-		   "update the list?", di->i_blkno, el->l_tree_depth,
+		   "update the list?", (uint64_t)di->i_blkno, el->l_tree_depth,
 		   ei->ei_expected_depth)) {
 
 		el->l_tree_depth = ei->ei_expected_depth;
@@ -260,7 +264,7 @@ static errcode_t check_el(o2fsck_state *ost, struct extent_info *ei,
 	    prompt(ost, PY, PR_EXTENT_LIST_COUNT,
 		   "Extent list in inode %"PRIu64" claims to have %u "
 		   "records, but the maximum is %u. Fix the list's count?",
-		   di->i_blkno, el->l_count, max_recs)) {
+		   (uint64_t)di->i_blkno, el->l_count, max_recs)) {
 
 		el->l_count = max_recs;
 		*changed = 1;
@@ -274,8 +278,8 @@ static errcode_t check_el(o2fsck_state *ost, struct extent_info *ei,
 		  	   "Extent list in inode %"PRIu64" claims %u "
 			   "as the next free chain record, but fsck believes "
 			   "the largest valid value is %u.  Clamp the next "
-			   "record value?", di->i_blkno, el->l_next_free_rec,
-			   max_recs)) {
+			   "record value?", (uint64_t)di->i_blkno,
+			   el->l_next_free_rec, max_recs)) {
 
 			el->l_next_free_rec = el->l_count;
 			*changed = 1;
@@ -311,7 +315,7 @@ static errcode_t check_el(o2fsck_state *ost, struct extent_info *ei,
 			   "Extent record %u in inode %"PRIu64" "
 			   "refers to a block that is out of range.  Remove "
 			   "this record from the extent list?", i,
-			   di->i_blkno)) {
+			   (uint64_t)di->i_blkno)) {
 
 			if (!trust_next_free) {
 				printf("Can't remove the record becuase "
diff --git a/fsck.ocfs2/pass0.c b/fsck.ocfs2/pass0.c
index dca3f23..68dd930 100644
--- a/fsck.ocfs2/pass0.c
+++ b/fsck.ocfs2/pass0.c
@@ -167,9 +167,9 @@ static errcode_t repair_group_desc(o2fsck_state *ost,
 	int max_free_bits = 0;
 
 	verbosef("checking desc at %"PRIu64"; blkno %"PRIu64" size %u bits %u "
-		 "free_bits %u chain %u generation %u\n", blkno, bg->bg_blkno,
-		 bg->bg_size, bg->bg_bits, bg->bg_free_bits_count, 
-		 bg->bg_chain, bg->bg_generation);
+		 "free_bits %u chain %u generation %u\n", blkno,
+		 (uint64_t)bg->bg_blkno, bg->bg_size, bg->bg_bits,
+		 bg->bg_free_bits_count, bg->bg_chain, bg->bg_generation);
 
 	if (bg->bg_generation != ost->ost_fs_generation &&
 	    prompt(ost, PY, PR_GROUP_GEN,
@@ -202,7 +202,8 @@ static errcode_t repair_group_desc(o2fsck_state *ost,
 		   "referenced by inode %"PRIu64" but thinks its parent inode "
 		   "is %"PRIu64" and we can also see it in that inode."
 		    " So it may be duplicated.  Remove it from this inode?",
-		    blkno, di->i_blkno, bg->bg_parent_dinode)) {
+		    blkno, (uint64_t)di->i_blkno,
+		    (uint64_t)bg->bg_parent_dinode)) {
 			*clear_ref = 1;
 			goto out;
 		}
@@ -211,7 +212,7 @@ static errcode_t repair_group_desc(o2fsck_state *ost,
 		   "Group descriptor at block %"PRIu64" is "
 		   "referenced by inode %"PRIu64" but thinks its parent inode "
 		   "is %"PRIu64".  Fix the descriptor's parent inode?", blkno,
-		   di->i_blkno, bg->bg_parent_dinode)) {
+		   (uint64_t)di->i_blkno, (uint64_t)bg->bg_parent_dinode)) {
 			bg->bg_parent_dinode = di->i_blkno;
 			changed = 1;
 		}
@@ -222,7 +223,7 @@ static errcode_t repair_group_desc(o2fsck_state *ost,
 	    prompt(ost, PY, PR_GROUP_BLKNO,
 		   "Group descriptor read from block %"PRIu64" "
 		   "claims to be located at block %"PRIu64".  Update its "
-		   "recorded block location?", blkno, di->i_blkno)) {
+		   "recorded block location?", blkno, (uint64_t)di->i_blkno)) {
 		bg->bg_blkno = blkno;
 		changed = 1;
 	}
@@ -259,7 +260,8 @@ static errcode_t repair_group_desc(o2fsck_state *ost,
 			com_err(whoami, ret, "while writing a group "
 				"descriptor to block %"PRIu64" somewhere in "
 				"chain %d in group allocator inode %"PRIu64, 
-				bg->bg_blkno, cs->cs_chain_no, di->i_blkno);
+				(uint64_t)bg->bg_blkno, cs->cs_chain_no,
+				(uint64_t)di->i_blkno);
 			ost->ost_saw_error = 1;
 		}
 	}
@@ -332,7 +334,7 @@ static void unlink_group_desc(o2fsck_state *ost,
 					"descriptor to block %"PRIu64" "
 					"somewhere in chain %d in group "
 					"allocator inode %"PRIu64, 
-					next_desc, i, di->i_blkno);
+					next_desc, i, (uint64_t)di->i_blkno);
 				ost->ost_saw_error = 1;
 				goto out;
 			}
@@ -367,7 +369,7 @@ static void unlink_group_desc(o2fsck_state *ost,
 	if (ret) {
 		/* XXX ugh, undo the bitmap math? */
 		com_err(whoami, ret, "while writing inode alloc inode "
-			    "%"PRIu64, di->i_blkno);
+			    "%"PRIu64, (uint64_t)di->i_blkno);
 		ost->ost_saw_error = 1;
 		goto out;
 	}
@@ -434,13 +436,14 @@ static errcode_t maybe_fix_clusters_per_group(o2fsck_state *ost,
 
 	if (prompt(ost, PY, PR_CHAIN_CPG,
 		   "Global bitmap at block %"PRIu64" has clusters per group "
-		   "set to %u instead of %u. Fix?", di->i_blkno, cl->cl_cpg,
-		   new_cl_cpg)) {
+		   "set to %u instead of %u. Fix?", (uint64_t)di->i_blkno,
+		   cl->cl_cpg, new_cl_cpg)) {
 		cl->cl_cpg = new_cl_cpg;
 		ret = ocfs2_write_inode(ost->ost_fs, di->i_blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "while writing inode alloc inode "
-				"%"PRIu64" to fix cl_cpg", di->i_blkno);
+				"%"PRIu64" to fix cl_cpg",
+				(uint64_t)di->i_blkno);
 			ost->ost_saw_error = 1;
 			ret = 0;
 		}
@@ -470,7 +473,7 @@ static errcode_t check_chain(o2fsck_state *ost,
 	int depth = 0, clear_ref = 0;
 
 	verbosef("free %u total %u blkno %"PRIu64"\n", chain->c_free,
-		 chain->c_total, chain->c_blkno);
+		 chain->c_total, (uint64_t)chain->c_blkno);
 
 	while(1) {
 		/* fetch the next reference */
@@ -512,8 +515,8 @@ static errcode_t check_chain(o2fsck_state *ost,
 				   "%"PRIu64" contains a reference at depth "
 				   "%d to block %"PRIu64" which is out "
 				   "of range. Truncate this chain?",
-				   cs->cs_chain_no, di->i_blkno, depth,
-				   blkno))  {
+				   cs->cs_chain_no, (uint64_t)di->i_blkno,
+				   depth, blkno))  {
 
 				clear_ref = 1;
 				break;
@@ -529,8 +532,8 @@ static errcode_t check_chain(o2fsck_state *ost,
 				   "%"PRIu64" contains a reference at depth "
 				   "%d to block %"PRIu64" which doesn't have "
 				   "a valid checksum.  Truncate this chain?",
-				   cs->cs_chain_no, di->i_blkno, depth,
-				   blkno))  {
+				   cs->cs_chain_no, (uint64_t)di->i_blkno,
+				   depth, blkno))  {
 
 				clear_ref = 1;
 				break;
@@ -545,7 +548,7 @@ static errcode_t check_chain(o2fsck_state *ost,
 				"descriptor from block %"PRIu64" as pointed "
 				"to by chain %d in allocator at inode "
 				"%"PRIu64" at depth %d", blkno, 
-				cs->cs_chain_no, di->i_blkno, depth);
+				cs->cs_chain_no, (uint64_t)di->i_blkno, depth);
 			goto out;
 		}
 
@@ -596,8 +599,8 @@ static errcode_t check_chain(o2fsck_state *ost,
 					"descriptor at depth %d in chain %d "
 					"in group allocator inode %"PRIu64" "
 					"to block %"PRIu64, depth,
-					cs->cs_chain_no, di->i_blkno,
-					bg1->bg_blkno);
+					cs->cs_chain_no, (uint64_t)di->i_blkno,
+					(uint64_t)bg1->bg_blkno);
 				ost->ost_saw_error = 1;
 			}
 		}
@@ -610,7 +613,8 @@ static errcode_t check_chain(o2fsck_state *ost,
 			   "has %u bits marked free out of %d total bits "
 			   "but the block groups in the chain have %u "
 			   "free out of %u total.  Fix this by updating "
-			   "the chain record?", cs->cs_chain_no, di->i_blkno,
+			   "the chain record?", cs->cs_chain_no,
+			   (uint64_t)di->i_blkno,
 			   chain->c_free, chain->c_total, cs->cs_free_bits,
 			   cs->cs_total_bits)) {
 			chain->c_total = cs->cs_total_bits;
@@ -643,21 +647,23 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 	if (memcmp(di->i_signature, OCFS2_INODE_SIGNATURE,
 		   strlen(OCFS2_INODE_SIGNATURE))) {
 		printf("Allocator inode %"PRIu64" doesn't have an inode "
-		       "signature.  fsck won't repair this.\n", di->i_blkno);
+		       "signature.  fsck won't repair this.\n",
+		       (uint64_t)di->i_blkno);
 		ret = OCFS2_ET_BAD_INODE_MAGIC;
 		goto out;
 	}
 
 	if (!(di->i_flags & OCFS2_VALID_FL)) {
 		printf("Allocator inode %"PRIu64" is not active.  fsck won't "
-		       "repair this.\n", di->i_blkno);
+		       "repair this.\n", (uint64_t)di->i_blkno);
 		ret = OCFS2_ET_INODE_NOT_VALID;
 		goto out;
 	}
 
 	if (!(di->i_flags & OCFS2_CHAIN_FL)) {
 		printf("Allocator inode %"PRIu64" doesn't have the CHAIN_FL "
-			"flag set.  fsck won't repair this.\n", di->i_blkno);
+		       "flag set.  fsck won't repair this.\n",
+		       (uint64_t)di->i_blkno);
 		/* not _entirely_ accurate, but pretty close. */
 		ret = OCFS2_ET_INODE_NOT_VALID;
 		goto out;
@@ -682,7 +688,7 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 			   "Chain %d in allocator inode %"PRIu64" "
 			   "contains an initial block reference to %"PRIu64" "
 			   "which is out of range.  Clear this reference?",
-			   i, di->i_blkno, cr->c_blkno)) {
+			   i, (uint64_t)di->i_blkno, (uint64_t)cr->c_blkno)) {
 
 			cr->c_blkno = 0;
 			changed = 1;
@@ -694,7 +700,7 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 	    prompt(ost, PY, PR_CHAIN_COUNT,
 		   "Allocator inode %"PRIu64" claims to have %u "
 		   "chains, but the maximum is %u. Fix the inode's count?",
-		   di->i_blkno, cl->cl_count, max_count)) {
+		   (uint64_t)di->i_blkno, cl->cl_count, max_count)) {
 		cl->cl_count = max_count;
 		changed = 1;
 	}
@@ -707,7 +713,8 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 			   "Allocator inode %"PRIu64" claims %u "
 			   "as the next free chain record, but fsck believes "
 			   "the largest valid value is %u.  Clamp the next "
-			   "record value?", di->i_blkno, cl->cl_next_free_rec,
+			   "record value?", (uint64_t)di->i_blkno,
+			   cl->cl_next_free_rec,
 			   max_count)) {
 			cl->cl_next_free_rec = cl->cl_count;
 			changed = 1;
@@ -743,7 +750,8 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 			   "Chain %d in allocator inode %"PRIu64" "
 			   "is empty.  Remove it from the chain record "
 			   "array in the inode and shift further chains "
-			   "into its place?", cs.cs_chain_no, di->i_blkno)) {
+			   "into its place?", cs.cs_chain_no,
+			   (uint64_t)di->i_blkno)) {
 
 			if (!trust_next_free) {
 				printf("Can't remove the chain becuase "
@@ -781,7 +789,7 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 			   "Allocator inode %"PRIu64" has %u bits "
 			   "marked used out of %d total bits but the chains "
 			   "have %u used out of %u total.  Fix this by "
-			   "updating the inode counts?", di->i_blkno,
+			   "updating the inode counts?", (uint64_t)di->i_blkno,
 			   di->id1.bitmap1.i_used, di->id1.bitmap1.i_total,
 			   total - free, total)) {
 			   di->id1.bitmap1.i_used = total - free;
@@ -798,7 +806,8 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 		   "Allocator inode %"PRIu64" has %"PRIu32" clusters "
 		   "represented in its allocator chains but has an "
 		   "i_clusters value of %"PRIu32". Fix this by updating "
-		   "i_clusters?", di->i_blkno, total, di->i_clusters)) {
+		   "i_clusters?", (uint64_t)di->i_blkno,
+		   total, di->i_clusters)) {
 		di->i_clusters = total;
 		changed = 1;
 	}
@@ -809,8 +818,9 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 		   "Allocator inode %"PRIu64" has %"PRIu32" clusters "
 		   "represented in its allocator chain which accounts for "
 		   "%"PRIu64" total bytes, but its i_size is %"PRIu64". "
-		   "Fix this by updating i_size?", di->i_blkno,
-		   di->id1.bitmap1.i_total, chain_bytes, di->i_size)) {
+		   "Fix this by updating i_size?", (uint64_t)di->i_blkno,
+		   di->id1.bitmap1.i_total, chain_bytes,
+		   (uint64_t)di->i_size)) {
 		di->i_size = chain_bytes;
 		changed = 1;
 	}
@@ -819,7 +829,7 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 		ret = ocfs2_write_inode(ost->ost_fs, di->i_blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "while writing inode alloc inode "
-				    "%"PRIu64, di->i_blkno);
+				    "%"PRIu64, (uint64_t)di->i_blkno);
 			ost->ost_saw_error = 1;
 			ret = 0;
 		}
@@ -882,7 +892,7 @@ static errcode_t verify_bitmap_descs(o2fsck_state *ost,
 	ret = verify_chain_alloc(ost, di, buf1, buf2, allowed, forbidden);
 	if (ret) {
 		com_err(whoami, ret, "while looking up chain allocator inode "
-			"%"PRIu64, di->i_blkno);
+			"%"PRIu64, (uint64_t)di->i_blkno);
 		goto out;
 	}
 
@@ -1007,7 +1017,7 @@ static errcode_t verify_bitmap_descs(o2fsck_state *ost,
 		ret = ocfs2_write_inode(ost->ost_fs, di->i_blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "while writing inode alloc inode "
-				    "%"PRIu64, di->i_blkno);
+				    "%"PRIu64, (uint64_t)di->i_blkno);
 			ost->ost_saw_error = 1;
 			goto out;
 		}
@@ -1069,7 +1079,7 @@ errcode_t o2fsck_pass0(o2fsck_state *ost)
 	}
 
 	verbosef("found inode alloc %"PRIu64" at block %"PRIu64"\n",
-		 di->i_blkno, blkno);
+		 (uint64_t)di->i_blkno, blkno);
 
 	ret = maybe_fix_clusters_per_group(ost, di);
 	if (ret)
@@ -1122,7 +1132,7 @@ errcode_t o2fsck_pass0(o2fsck_state *ost)
 		}
 
 		verbosef("found inode alloc %"PRIu64" at block %"PRIu64"\n",
-			 di->i_blkno, blkno);
+			 (uint64_t)di->i_blkno, blkno);
 
 		ret = verify_chain_alloc(ost, di,
 					 blocks + ost->ost_fs->fs_blocksize,
@@ -1175,7 +1185,7 @@ errcode_t o2fsck_pass0(o2fsck_state *ost)
 		}
 
 		verbosef("found extent alloc %"PRIu64" at block %"PRIu64"\n",
-			 di->i_blkno, blkno);
+			 (uint64_t)di->i_blkno, blkno);
 
 		ret = verify_chain_alloc(ost, di,
 					 blocks + ost->ost_fs->fs_blocksize,
diff --git a/fsck.ocfs2/pass1.c b/fsck.ocfs2/pass1.c
index 5b4e796..bef2863 100644
--- a/fsck.ocfs2/pass1.c
+++ b/fsck.ocfs2/pass1.c
@@ -191,7 +191,8 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 			   "Local alloc inode %"PRIu64" claims to "
 			   "have %u bytes of bitmap data but %u bytes is the "
 			   "maximum allowed.  Set the inode's count to the "
-			   "maximum?", di->i_blkno, la->la_size, max)) {
+			   "maximum?", (uint64_t)di->i_blkno,
+			   la->la_size, max)) {
 
 			la->la_size = max;
 			changed = 1;
@@ -205,7 +206,7 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 			if (prompt(ost, PY, PR_LALLOC_NZ_USED,
 				   "Local alloc inode %"PRIu64" "
 			    "isn't in use bit its i_used isn't 0.  Set it to "
-			    "0?", di->i_blkno)) {
+			    "0?", (uint64_t)di->i_blkno)) {
 
 				di->id1.bitmap1.i_used = 0;
 				changed = 1;
@@ -216,7 +217,7 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 			if (prompt(ost, PY, PR_LALLOC_NZ_BM,
 				   "Local alloc inode %"PRIu64" "
 			    "isn't in use bit its i_bm_off isn't 0.  Set it "
-			    "to 0?", di->i_blkno)) {
+			    "to 0?", (uint64_t)di->i_blkno)) {
 
 				la->la_bm_off = 0;
 				changed = 1;
@@ -232,7 +233,7 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 			   "Local alloc inode %"PRIu64" claims to "
 			   "contain a bitmap that starts at cluster %u but "
 			   "the volume contains %u clusters.  Mark the local "
-			   "alloc bitmap as unused?", di->i_blkno,
+			   "alloc bitmap as unused?", (uint64_t)di->i_blkno,
 			   la->la_bm_off, ost->ost_fs->fs_clusters)) {
 			clear = 1;
 		}
@@ -244,7 +245,8 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 			   "Local alloc inode %"PRIu64" claims to "
 			   "have a bitmap with %u bits but the inode can only "
 			   "fit %u bits.  Clamp the bitmap size to this "
-			   "maxmum?", di->i_blkno, di->id1.bitmap1.i_total,
+			   "maxmum?", (uint64_t)di->i_blkno,
+			   di->id1.bitmap1.i_total,
 			   la->la_size * 8)) {
 
 			di->id1.bitmap1.i_total = la->la_size * 8;
@@ -260,7 +262,7 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 			   "have a bitmap that covers clusters numbered %u "
 			   "through %u but %u is the last valid cluster. "
 			   "Mark the local bitmap as unused?",
-			   di->i_blkno,
+			   (uint64_t)di->i_blkno,
 			   la->la_bm_off,
 			   la->la_bm_off + di->id1.bitmap1.i_total - 1, 
 			   ost->ost_fs->fs_clusters - 1)) {
@@ -277,7 +279,7 @@ static errcode_t verify_local_alloc(o2fsck_state *ost,
 		if (prompt(ost, PY, PR_LALLOC_USED_OVERRUN,
 			   "Local alloc inode %"PRIu64" claims to "
 			   "contain a bitmap with %u bits and %u used.  Set "
-			   "i_used down to %u?", di->i_blkno,
+			   "i_used down to %u?", (uint64_t)di->i_blkno,
 			   di->id1.bitmap1.i_total, di->id1.bitmap1.i_used, 
 			   di->id1.bitmap1.i_total)) {
 
@@ -291,7 +293,7 @@ out:
 	    prompt(ost, PY, PR_LALLOC_CLEAR,
 		   "Local alloc inode %"PRIu64" contained errors. "
 		   "Mark it as unused instead of trying to correct its "
-		   "bitmap?", di->i_blkno)) {
+		   "bitmap?", (uint64_t)di->i_blkno)) {
 		clear = 1;
 	}
 
@@ -308,7 +310,7 @@ out:
 		ret = ocfs2_write_inode(ost->ost_fs, di->i_blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "while writing local alloc inode "
-				    "%"PRIu64, di->i_blkno);
+				    "%"PRIu64, (uint64_t)di->i_blkno);
 			ost->ost_write_error = 1;
 			ret = 0;
 		}
@@ -336,7 +338,7 @@ static errcode_t verify_truncate_log(o2fsck_state *ost,
 	    prompt(ost, PY, PR_DEALLOC_COUNT,
 		   "Truncate log inode %"PRIu64" claims space for %u records but only %u "
 		   "records are possible.  Set the inode's count to the maximum?",
-		   di->i_blkno, tl->tl_count, max)) {
+		   (uint64_t)di->i_blkno, tl->tl_count, max)) {
 
 		tl->tl_count = max;
 		changed = 1;
@@ -346,8 +348,8 @@ static errcode_t verify_truncate_log(o2fsck_state *ost,
 	    prompt(ost, PY, PR_DEALLOC_USED,
 		   "Truncate log inode %"PRIu64" claims to be using %u records but the "
 		   "inode can only hold %u records.  Change the number used to reflect "
-		   "the maximum possible in the inode?", di->i_blkno, tl->tl_used,
-		   tl->tl_count)) {
+		   "the maximum possible in the inode?", (uint64_t)di->i_blkno,
+		   tl->tl_used, tl->tl_count)) {
 
 		tl->tl_used = tl->tl_count;
 		changed = 1;
@@ -368,8 +370,8 @@ static errcode_t verify_truncate_log(o2fsck_state *ost,
 			   "Truncate record at offset %u in truncate log "
 			   "inode %"PRIu64" starts at cluster %u but there "
 			   "are %u clusters in the volume. Remove this record "
-			   "from the log?", i, di->i_blkno, tr->t_start,
-			   ost->ost_fs->fs_clusters)) {
+			   "from the log?", i, (uint64_t)di->i_blkno,
+			   tr->t_start, ost->ost_fs->fs_clusters)) {
 				zero = 1;
 		}
 
@@ -380,7 +382,8 @@ static errcode_t verify_truncate_log(o2fsck_state *ost,
 			   "%u clusters.  It can't have this many clusters "
 			   "as that overflows the number of possible clusters "
 			   "in a volume.  Remove this record from the log?",
-			   i, di->i_blkno, tr->t_start, tr->t_clusters)) {
+			   i, (uint64_t)di->i_blkno,
+			   tr->t_start, tr->t_clusters)) {
 				zero = 1;
 		}
 
@@ -391,7 +394,8 @@ static errcode_t verify_truncate_log(o2fsck_state *ost,
 			   "%u clusters.  It can't have this many clusters "
 			   "as this volume only has %u clusters. Remove this "
 			   "record from the log?",
-			   i, di->i_blkno, tr->t_start, tr->t_clusters,
+			   i, (uint64_t)di->i_blkno,
+			   tr->t_start, tr->t_clusters,
 			   ost->ost_fs->fs_clusters)) {
 				zero = 1;
 		}
@@ -407,7 +411,7 @@ static errcode_t verify_truncate_log(o2fsck_state *ost,
 		ret = ocfs2_write_inode(ost->ost_fs, di->i_blkno, (char *)di);
 		if (ret) {
 			com_err(whoami, ret, "while writing truncate log inode "
-				    "%"PRIu64, di->i_blkno);
+				    "%"PRIu64, (uint64_t)di->i_blkno);
 			ost->ost_write_error = 1;
 			ret = 0;
 		}
@@ -466,7 +470,7 @@ static void o2fsck_verify_inode_fields(ocfs2_filesys *fs,
 	    prompt(ost, PY, PR_INODE_BLKNO,
 		   "Inode read from block %"PRIu64" has i_blkno set "
 		   "to %"PRIu64".  Set the inode's i_blkno value to reflect "
-		   "its location on disk?", blkno, di->i_blkno)) {
+		   "its location on disk?", blkno, (uint64_t)di->i_blkno)) {
 
 		di->i_blkno = blkno;
 		o2fsck_write_inode(ost, blkno, di);
@@ -487,7 +491,7 @@ static void o2fsck_verify_inode_fields(ocfs2_filesys *fs,
 	if (di->i_dtime &&
 	    prompt(ost, PY, PR_INODE_NZ_DTIME,
 		   "Inode %"PRIu64" is in use but has a non-zero dtime. Reset "
-		   "the dtime to 0?",  di->i_blkno)) {
+		   "the dtime to 0?",  (uint64_t)di->i_blkno)) {
 
 		di->i_dtime = 0ULL;
 		o2fsck_write_inode(ost, blkno, di);
@@ -610,13 +614,15 @@ static void check_link_data(struct verifying_blocks *vb)
 	char *null;
 
 	verbosef("found a link: num %"PRIu64" last %"PRIu64" len "
-		"%"PRIu64" null %d\n", vb->vb_num_blocks, 
-		vb->vb_last_block, vb->vb_link_len, vb->vb_saw_link_null);
+		"%"PRIu64" null %d\n", (uint64_t)vb->vb_num_blocks,
+		(uint64_t)vb->vb_last_block, (uint64_t)vb->vb_link_len,
+		vb->vb_saw_link_null);
 
 	if (di->i_clusters == 0 && vb->vb_num_blocks > 0 &&
 	    prompt(ost, PY, PR_LINK_FAST_DATA,
 		   "Symlink inode %"PRIu64" claims to be a fast symlink "
-		   "but has file data.  Clear the inode?", di->i_blkno)) {
+		   "but has file data.  Clear the inode?",
+		   (uint64_t)di->i_blkno)) {
 		vb->vb_clear = 1;
 		return;
 	}
@@ -646,7 +652,7 @@ static void check_link_data(struct verifying_blocks *vb)
 		if (prompt(ost, PY, PR_LINK_NULLTERM,
 			   "The target of symlink inode %"PRIu64" "
 			   "isn't null terminated.  Clear the inode?",
-			   di->i_blkno)) {
+			   (uint64_t)di->i_blkno)) {
 			vb->vb_clear = 1;
 			return;
 		}
@@ -659,7 +665,8 @@ static void check_link_data(struct verifying_blocks *vb)
 			   "is %"PRIu64" bytes long on disk, but i_size is "
 			   "%"PRIu64" bytes long.  Update i_size to reflect "
 			   "the length on disk?",
-			   di->i_blkno, vb->vb_link_len, di->i_size)) {
+			   (uint64_t)di->i_blkno, vb->vb_link_len,
+			   (uint64_t)di->i_size)) {
 			di->i_size = vb->vb_link_len;
 			o2fsck_write_inode(ost, di->i_blkno, di);
 			return;
@@ -673,7 +680,8 @@ static void check_link_data(struct verifying_blocks *vb)
 			   "The target of symlink inode %"PRIu64" "
 			   "fits in %"PRIu64" blocks but the inode has "
 			   "%"PRIu64" allocated.  Clear the inode?", 
-			   di->i_blkno, expected, vb->vb_num_blocks)) {
+			   (uint64_t)di->i_blkno, expected,
+			   vb->vb_num_blocks)) {
 			vb->vb_clear = 1;
 			return;
 		}
@@ -695,11 +703,13 @@ static int verify_block(ocfs2_filesys *fs,
 
 	if (S_ISDIR(di->i_mode)) {
 		verbosef("adding dir block %"PRIu64"\n", blkno);
-		ret = o2fsck_add_dir_block(&ost->ost_dirblocks, di->i_blkno,
+		ret = o2fsck_add_dir_block(&ost->ost_dirblocks,
+					   (uint64_t)di->i_blkno,
 					   blkno, bcount);
 		if (ret) {
 			com_err(whoami, ret, "while trying to track block in "
-				"directory inode %"PRIu64, di->i_blkno);
+				"directory inode %"PRIu64,
+				(uint64_t)di->i_blkno);
 		}
 	} else if (S_ISLNK(di->i_mode))
 		ret = process_link_block(vb, blkno);
@@ -767,7 +777,7 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
 
 	if (ret) {
 		com_err(whoami, ret, "while iterating over the blocks for "
-			"inode %"PRIu64, di->i_blkno);	
+			"inode %"PRIu64, (uint64_t)di->i_blkno);
 		goto out;
 	}
 
@@ -777,7 +787,7 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
 	if (S_ISDIR(di->i_mode) && vb.vb_num_blocks == 0 &&
 	    prompt(ost, PY, PR_DIR_ZERO,
 		   "Inode %"PRIu64" is a zero length directory, clear it?",
-		   di->i_blkno)) {
+		   (uint64_t)di->i_blkno)) {
 
 		vb.vb_clear = 1;
 	}
@@ -836,7 +846,7 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
 				   " has a size of %"PRIu64" but has %"PRIu64
 				   " blocks of actual data. "
 				   "Correct the file size?",
-				    di->i_blkno, di->i_size,
+				    (uint64_t)di->i_blkno, (uint64_t)di->i_size,
 				    vb.vb_last_block + 1)) {
 				di->i_size = expected;
 				o2fsck_write_inode(ost, blkno, di);
@@ -851,7 +861,7 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
 			   "Inode %"PRIu64" has %"PRIu32" clusters but its "
 			   "blocks fit in %"PRIu64" clusters. "
 			   "Correct the number of clusters?",
-			   di->i_blkno, di->i_clusters, expected)) {
+			   (uint64_t)di->i_blkno, di->i_clusters, expected)) {
 			di->i_clusters = expected;
 			o2fsck_write_inode(ost, blkno, di);
 		}
@@ -864,7 +874,8 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
 		    prompt(ost, PY, PR_INODE_SIZE, "Inode %"PRIu64" has a size of "
 			   "%"PRIu64" but has %"PRIu64" bytes of actual data. "
 			   "Correct the file size?",
-			    di->i_blkno, di->i_size, expected)) {
+			   (uint64_t)di->i_blkno,
+			   (uint64_t)di->i_size, expected)) {
 			di->i_size = expected;
 			o2fsck_write_inode(ost, blkno, di);
 		}
@@ -878,7 +889,7 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
 			   "Inode %"PRIu64" has %"PRIu32" clusters but its "
 			   "blocks fit in %"PRIu64" clusters.  Correct the "
 			   "number of clusters?",
-			   di->i_blkno, di->i_clusters, expected)) {
+			   (uint64_t)di->i_blkno, di->i_clusters, expected)) {
 			di->i_clusters = expected;
 			o2fsck_write_inode(ost, blkno, di);
 		}
diff --git a/fsck.ocfs2/pass2.c b/fsck.ocfs2/pass2.c
index ba357b4..5f1696d 100644
--- a/fsck.ocfs2/pass2.c
+++ b/fsck.ocfs2/pass2.c
@@ -155,7 +155,7 @@ static errcode_t fix_dirent_dots(o2fsck_state *ost, o2fsck_dirblock_entry *dbe,
             prompt(ost, PY, PR_DIRENT_DOT_INODE,
 		   "The '.' entry in directory inode %"PRIu64" "
 		   "points to inode %"PRIu64" instead of itself.  Fix "
-		   "the '.' entry?", dbe->e_ino, dirent->inode)) {
+		   "the '.' entry?", dbe->e_ino, (uint64_t)dirent->inode)) {
 		dirent->inode = dbe->e_ino;
 		*flags |= OCFS2_DIRENT_CHANGED;
 	}
@@ -324,7 +324,7 @@ static void fix_dirent_inode(o2fsck_state *ost, o2fsck_dirblock_entry *dbe,
 	    prompt(ost, PY, PR_DIRENT_INODE_RANGE,
 		   "Directory entry '%.*s' refers to inode "
 		   "number %"PRIu64" which is out of range, clear the entry?",
-		   dirent->name_len, dirent->name, dirent->inode)) {
+		   dirent->name_len, dirent->name, (uint64_t)dirent->inode)) {
 
 		dirent->inode = 0;
 		*flags |= OCFS2_DIRENT_CHANGED;
@@ -335,7 +335,7 @@ static void fix_dirent_inode(o2fsck_state *ost, o2fsck_dirblock_entry *dbe,
 	    prompt(ost, PY, PR_DIRENT_INODE_FREE,
 		   "Directory entry '%.*s' refers to inode number "
 		   "%"PRIu64" which isn't allocated, clear the entry?", 
-		   dirent->name_len, dirent->name, dirent->inode)) {
+		   dirent->name_len, dirent->name, (uint64_t)dirent->inode)) {
 		dirent->inode = 0;
 		*flags |= OCFS2_DIRENT_CHANGED;
 	}
@@ -410,7 +410,7 @@ check:
 		"entry's type to match the inode's?",
 		dirent->name_len, dirent->name, 
 		file_type_string(dirent->file_type), dirent->file_type,
-		dirent->inode,
+		(uint64_t)dirent->inode,
 		file_type_string(expected_type), expected_type)) {
 
 		dirent->file_type = expected_type;
@@ -446,7 +446,7 @@ static errcode_t fix_dirent_linkage(o2fsck_state *ost,
 	ret = ocfs2_bitmap_test(ost->ost_dir_inodes, dirent->inode, &is_dir);
 	if (ret)
 		com_err(whoami, ret, "while checking for inode %"PRIu64" in "
-			"the dir bitmap", dirent->inode);
+			"the dir bitmap", (uint64_t)dirent->inode);
 	if (!is_dir)
 		goto out;
 
@@ -454,7 +454,7 @@ static errcode_t fix_dirent_linkage(o2fsck_state *ost,
 	if (dp == NULL) {
 		ret = OCFS2_ET_INTERNAL_FAILURE;
 		com_err(whoami, ret, "no dir parents recorded for inode "
-			"%"PRIu64, dirent->inode);
+			"%"PRIu64, (uint64_t)dirent->inode);
 		goto out;
 	}
 
@@ -470,7 +470,7 @@ static errcode_t fix_dirent_linkage(o2fsck_state *ost,
 		"claim to be the parent of subdir '%.*s' (inode %"PRIu64"). "
 		"Clear this directory entry and leave the previous parent of "
 		"the subdir's inode intact?", dbe->e_ino, 
-		dirent->name_len, dirent->name, dirent->inode)) {
+		dirent->name_len, dirent->name, (uint64_t)dirent->inode)) {
 
 		dirent->inode = 0;
 		*flags |= OCFS2_DIRENT_CHANGED;
@@ -594,7 +594,7 @@ static int corrupt_dirent_lengths(struct ocfs2_dir_entry *dirent, int left)
 		return 0;
 
 	verbosef("corrupt dirent: %"PRIu64" rec_len %u name_len %u\n",
-		dirent->inode, dirent->rec_len, dirent->name_len);
+		 (uint64_t)dirent->inode, dirent->rec_len, dirent->name_len);
 
 	return 1;
 }
@@ -630,7 +630,7 @@ static unsigned pass2_dir_block_iterate(o2fsck_dirblock_entry *dbe,
 		}
 
 		verbosef("dir inode %"PRIu64" i_size %"PRIu64"\n",
-			 dbe->e_ino, di->i_size);
+			 dbe->e_ino, (uint64_t)di->i_size);
 
 	}
 
@@ -727,7 +727,7 @@ static unsigned pass2_dir_block_iterate(o2fsck_dirblock_entry *dbe,
 			goto next;
 
 		verbosef("dirent %.*s refs ino %"PRIu64"\n", dirent->name_len,
-				dirent->name, dirent->inode);
+				dirent->name, (uint64_t)dirent->inode);
 		o2fsck_icount_delta(dd->ost->ost_icount_refs, dirent->inode, 1);
 next:
 		offset += dirent->rec_len;
diff --git a/fsck.ocfs2/pass4.c b/fsck.ocfs2/pass4.c
index 505ff70..501f9f0 100644
--- a/fsck.ocfs2/pass4.c
+++ b/fsck.ocfs2/pass4.c
@@ -57,7 +57,7 @@ static void check_link_counts(o2fsck_state *ost,
 	    prompt(ost, PY, PR_INODE_NOT_CONNECTED,
 		   "Inode %"PRIu64" isn't referenced by any "
 		   "directory entries.  Move it to lost+found?", 
-		   di->i_blkno)) {
+		   (uint64_t)di->i_blkno)) {
 		o2fsck_reconnect_file(ost, blkno);
 		refs = o2fsck_icount_get(ost->ost_icount_refs, blkno);
 	}
@@ -77,13 +77,14 @@ static void check_link_counts(o2fsck_state *ost,
 	if (in_inode != di->i_links_count)
 		com_err(whoami, OCFS2_ET_INTERNAL_FAILURE, "fsck's thinks "
 			"inode %"PRIu64" has a link count of %"PRIu16" but on "
-			"disk it is %"PRIu16, di->i_blkno, in_inode, 
+			"disk it is %"PRIu16, (uint64_t)di->i_blkno, in_inode,
 			di->i_links_count);
 
 	if (prompt(ost, PY, PR_INODE_COUNT,
 		   "Inode %"PRIu64" has a link count of %"PRIu16" on "
 		   "disk but directory entry references come to %"PRIu16". "
-		   "Update the count on disk to match?", di->i_blkno, in_inode, 
+		   "Update the count on disk to match?",
+		   (uint64_t)di->i_blkno, in_inode,
 		   refs)) {
 		di->i_links_count = refs;
 		o2fsck_icount_set(ost->ost_icount_in_inodes, di->i_blkno,
@@ -114,14 +115,15 @@ static int replay_orphan_iterate(struct ocfs2_dir_entry *dirent,
 
 	if (!prompt(ost, PY, PR_INODE_ORPHANED,
 		   "Inode %"PRIu64" was found in the orphan directory. "
-		   "Delete its contents and unlink it?", dirent->inode)) {
+		   "Delete its contents and unlink it?",
+		   (uint64_t)dirent->inode)) {
 		goto out;
 	}
 
 	ret = ocfs2_truncate(ost->ost_fs, dirent->inode, 0);
 	if (ret) {
 		com_err(whoami, ret, "while truncating orphan inode %"PRIu64,
-			dirent->inode);
+			(uint64_t)dirent->inode);
 		ret_flags |= OCFS2_DIRENT_ABORT;
 		goto out;
 	}
@@ -129,7 +131,7 @@ static int replay_orphan_iterate(struct ocfs2_dir_entry *dirent,
 	ret = ocfs2_delete_inode(ost->ost_fs, dirent->inode);
 	if (ret) {
 		com_err(whoami, ret, "while deleting orphan inode %"PRIu64
-			"after truncating it", dirent->inode);
+			"after truncating it", (uint64_t)dirent->inode);
 		ret_flags |= OCFS2_DIRENT_ABORT;
 		goto out;
 	}
diff --git a/fsck.ocfs2/util.c b/fsck.ocfs2/util.c
index ca22a85..c2382ac 100644
--- a/fsck.ocfs2/util.c
+++ b/fsck.ocfs2/util.c
@@ -40,14 +40,14 @@ void o2fsck_write_inode(o2fsck_state *ost, uint64_t blkno,
 	if (blkno != di->i_blkno) {
 		com_err(whoami, OCFS2_ET_INTERNAL_FAILURE, "when asked to "
 			"write an inode with an i_blkno of %"PRIu64" to block "
-			"%"PRIu64, di->i_blkno, blkno);
+			"%"PRIu64, (uint64_t)di->i_blkno, blkno);
 		return;
 	}
 
 	ret = ocfs2_write_inode(ost->ost_fs, blkno, (char *)di);
 	if (ret) {
-		com_err(whoami, ret, "while writing inode %"PRIu64, 
-		        di->i_blkno);
+		com_err(whoami, ret, "while writing inode %"PRIu64,
+			(uint64_t)di->i_blkno);
 		ost->ost_saw_error = 1;
 	}
 }
-- 
1.5.3.6




More information about the Ocfs2-tools-devel mailing list