gfs2-utils: master - Misc cleanups
Bob Peterson
rpeterso at fedoraproject.org
Tue Jan 26 21:11:19 UTC 2010
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=ceef74fb4c29ffa8d8ec48a7d5122ca8f07d2a57
Commit: ceef74fb4c29ffa8d8ec48a7d5122ca8f07d2a57
Parent: 1aed3a973bb72e29e9d9d6cc0d1c26060db8080a
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 15:09:52 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 3343fed..3ac0c06 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -445,7 +445,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;
@@ -1016,7 +1016,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,
@@ -1144,8 +1144,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 53422e8..f98b007 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -286,8 +286,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 9d2d08a..9c5ad3b 100644
--- a/gfs2/libgfs2/block_list.c
+++ b/gfs2/libgfs2/block_list.c
@@ -111,22 +111,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 81637c2..56cd4c4 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -709,7 +709,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);
@@ -1407,7 +1407,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;
@@ -1434,8 +1433,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;
@@ -1474,7 +1473,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