cluster: STABLE3 - Misc cleanups

Bob Peterson rpeterso at fedoraproject.org
Tue Jan 26 21:21:29 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=745f9cb9576a0d76023ce4509b9b3322923ed10a
Commit:        745f9cb9576a0d76023ce4509b9b3322923ed10a
Parent:        28fd084202addc60b3dc0b064bd24179aac451c4
Author:        Bob Peterson <bob at ganesha.peterson>
AuthorDate:    Mon Jan 25 17:02:45 2010 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Tue Jan 26 14:39:33 2010 -0600

Misc cleanups

This is a collection of benign cleanups.

rhbz#455300
---
 gfs2/fsck/pass1.c         |    8 ++++----
 gfs2/fsck/pass2.c         |    4 ++--
 gfs2/libgfs2/block_list.c |   16 ----------------
 gfs2/libgfs2/fs_ops.c     |    9 ++++-----
 gfs2/libgfs2/libgfs2.h    |    6 ------
 5 files changed, 10 insertions(+), 33 deletions(-)

diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index f50c4b6..79cf8a7 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -443,7 +443,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
 	if(gfs2_check_range(sdp, indirect)) {
 		/*log_warn("EA indirect block #%"PRIu64" is out of range.\n",
 			indirect);
-			gfs2_blockmap_set(bl, parent, bad_block);*/
+			fsck_blockmap_set(parent, "bad", bad_block);*/
 		/* Doesn't help to mark this here - this gets checked
 		 * in pass1c */
 		return 1;
@@ -1014,7 +1014,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh)
 	if (S_ISDIR(ip->i_di.di_mode) &&
 	    (ip->i_di.di_flags & GFS2_DIF_EXHASH)) {
 		if (((1 << ip->i_di.di_depth) * sizeof(uint64_t)) != ip->i_di.di_size){
-			log_warn( _("Directory dinode #%llu (0x%llx"
+			log_warn( _("Directory dinode block #%llu (0x%llx"
 				 ") has bad depth.  Found %u, Expected %u\n"),
 				 (unsigned long long)ip->i_di.di_num.no_addr,
 				 (unsigned long long)ip->i_di.di_num.no_addr,
@@ -1142,8 +1142,8 @@ int pass1(struct gfs2_sbd *sbp)
 			log_debug( _("rgrp block %lld (0x%llx) "
 				     "is now marked as 'rgrp data'\n"),
 				   rgd->ri.ri_addr + i, rgd->ri.ri_addr + i);
-			if(gfs2_blockmap_set(bl, rgd->ri.ri_addr + i,
-					     gfs2_meta_rgrp)){
+			if (gfs2_blockmap_set(bl, rgd->ri.ri_addr + i,
+					      gfs2_meta_rgrp)) {
 				stack;
 				return FSCK_ERROR;
 			}
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 08dd5a4..9bb3e78 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -284,8 +284,8 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 			 (unsigned long long)ip->i_di.di_num.no_addr,
 			 (unsigned long long)ip->i_di.di_num.no_addr,
 			 q, q == gfs2_inode_invalid ?
-			 _("previously marked invalid") :
-			 _("is not an inode"));
+			 _("was previously marked invalid") :
+			 _("was deleted or is not an inode"));
 
 		if(!query( _("Clear directory entry to non-inode block? "
 			     "(y/n) "))) {
diff --git a/gfs2/libgfs2/block_list.c b/gfs2/libgfs2/block_list.c
index 2c1bfc9..faedc54 100644
--- a/gfs2/libgfs2/block_list.c
+++ b/gfs2/libgfs2/block_list.c
@@ -109,22 +109,6 @@ void gfs2_special_clear(struct special_blocks *blocklist, uint64_t block)
 	}
 }
 
-/* gfs2_block_unmark clears ONE mark for the given block */
-int gfs2_block_unmark(struct gfs2_sbd *sdp, struct gfs2_bmap *bmap,
-		      uint64_t block, enum gfs2_mark_block mark)
-{
-	static unsigned char *byte;
-	static uint64_t b;
-
-	if(block > bmap->size)
-		return -1;
-
-	byte = bmap->map + BLOCKMAP_SIZE4(block);
-	b = BLOCKMAP_BYTE_OFFSET4(block);
-	*byte &= ~(BLOCKMAP_MASK4 << b);
-	return 0;
-}
-
 int gfs2_blockmap_set(struct gfs2_bmap *bmap, uint64_t bblock,
 		      enum gfs2_mark_block mark)
 {
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 35721fa..8573dac 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -707,7 +707,7 @@ int gfs2_dirent_next(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 	bh_end = bh->b_data + dip->i_sbd->bsize;
 	cur_rec_len = be16_to_cpu((*dent)->de_rec_len);
 
-	if ((char *)(*dent) + cur_rec_len >= bh_end)
+	if (cur_rec_len == 0 || (char *)(*dent) + cur_rec_len >= bh_end)
 		return -ENOENT;
 
 	*dent = (struct gfs2_dirent *)((char *)(*dent) + cur_rec_len);
@@ -1405,7 +1405,6 @@ static int leaf_search(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 
 static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
 			      int len, struct gfs2_dirent **dent_out,
-			      struct gfs2_dirent **dent_prev,
 			      struct gfs2_buffer_head **bh_out)
 {
 	struct gfs2_buffer_head *bh = NULL, *bh_next;
@@ -1432,8 +1431,8 @@ static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
 			brelse(bh);
 
 		bh = bh_next;
-		
-		error = leaf_search(dip, bh, filename, len, dent_out, dent_prev);
+
+		error = leaf_search(dip, bh, filename, len, dent_out, NULL);
 		switch (error){
 		case 0:
 			*bh_out = bh;
@@ -1472,7 +1471,7 @@ static int dir_e_search(struct gfs2_inode *dip, const char *filename,
 	struct gfs2_dirent *dent;
 	int error;
 
-	error = linked_leaf_search(dip, filename, len, &dent, NULL, &bh);
+	error = linked_leaf_search(dip, filename, len, &dent, &bh);
 	if (error)
 		return error;
 
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 0e7e1b4..c4675f7 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -351,12 +351,6 @@ extern int gfs2_blockmap_set(struct gfs2_bmap *il, uint64_t block,
 			     enum gfs2_mark_block mark);
 extern void gfs2_special_clear(struct special_blocks *blocklist,
 			       uint64_t block);
-/* gfs2_block_unmark clears ONE mark for the given block */
-extern int gfs2_block_unmark(struct gfs2_sbd *sdp, struct gfs2_bmap *il,
-			     uint64_t block, enum gfs2_mark_block m);
-/* gfs2_block_clear clears all the marks for the given block */
-extern int gfs2_blockmap_clear(struct gfs2_sbd *sdp, struct gfs2_bmap *il,
-			    uint64_t block);
 extern void *gfs2_bmap_destroy(struct gfs2_sbd *sdp, struct gfs2_bmap *il);
 
 /* buf.c */


More information about the cluster-commits mailing list