cluster: RHEL510 - fsck.gfs2: misc cosmetic changes
Bob Peterson
rpeterso at fedoraproject.org
Fri Apr 5 13:45:44 UTC 2013
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=62a86dd0925a4d914f01d041a43e26811b66f556
Commit: 62a86dd0925a4d914f01d041a43e26811b66f556
Parent: f3dcee6421d8d717c0d56c0b6a0cf61b27ed5454
Author: Bob Peterson <rpeterso at redhat.com>
AuthorDate: Tue Aug 9 14:07:21 2011 -0500
Committer: Bob Peterson <rpeterso at redhat.com>
CommitterDate: Fri Apr 5 06:25:00 2013 -0700
fsck.gfs2: misc cosmetic changes
This patch is just cosmetic changes. It cleans up comments and code
but there should be no logic changes.
rhbz#877150
---
gfs2/fsck/metawalk.c | 17 +++++++----------
gfs2/fsck/pass1.c | 8 ++++----
gfs2/fsck/pass1b.c | 9 +++++----
gfs2/fsck/pass2.c | 2 +-
gfs2/fsck/pass5.c | 10 ++++++----
5 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 58fa88e..282822e 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -467,15 +467,14 @@ static int warn_and_patch(struct gfs2_inode *ip, uint64_t *leaf_no,
}
if (*leaf_no == *bad_leaf ||
(okay_to_fix = query( _("Attempt to patch around it? (y/n) ")))) {
- if (!valid_block(ip->i_sbd, old_leaf) == 0)
+ if (valid_block(ip->i_sbd, old_leaf))
gfs2_put_leaf_nr(ip, pindex, old_leaf);
else
gfs2_put_leaf_nr(ip, pindex, first_ok_leaf);
log_err( _("Directory Inode %llu (0x%llx) repaired.\n"),
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
- }
- else
+ } else
log_err( _("Bad leaf left in place.\n"));
*bad_leaf = *leaf_no;
*leaf_no = old_leaf;
@@ -624,9 +623,9 @@ static int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
leaf. That way, bad blocks at the beginning will be overwritten
with the first valid leaf. */
first_ok_leaf = leaf_no = -1;
- for(lindex = 0; lindex < (1 << ip->i_di.di_depth); lindex++) {
+ for (lindex = 0; lindex < (1 << ip->i_di.di_depth); lindex++) {
gfs2_get_leaf_nr(ip, lindex, &leaf_no);
- if (!valid_block(ip->i_sbd, leaf_no) == 0) {
+ if (valid_block(ip->i_sbd, leaf_no)) {
lbh = bread(sdp, leaf_no);
/* Make sure it's really a valid leaf block. */
if (gfs2_check_meta(lbh, GFS2_METATYPE_LF) == 0) {
@@ -652,11 +651,9 @@ static int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
gfs2_get_leaf_nr(ip, lindex, &leaf_no);
/* GFS has multiple indirect pointers to the same leaf
- * until those extra pointers are needed, so skip the
- * dups */
+ * until those extra pointers are needed, so skip the dups */
if (leaf_no == bad_leaf) {
- gfs2_put_leaf_nr(ip, lindex, old_leaf); /* fill w/old
- leaf info */
+ gfs2_put_leaf_nr(ip, lindex, old_leaf);
ref_count++;
continue;
} else if (old_leaf == leaf_no) {
@@ -826,7 +823,7 @@ int delete_block(struct gfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, const char *btype,
void *private)
{
- if (!valid_block(ip->i_sbd, block) == 0) {
+ if (valid_block(ip->i_sbd, block)) {
fsck_blockmap_set(ip, block, btype, gfs2_block_free);
return 0;
}
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 31b1f9c..ee81436 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -386,7 +386,7 @@ static int check_metalist(struct gfs2_inode *ip, uint64_t block,
*bh = NULL;
- if (!valid_block(ip->i_sbd, block)){ /* blk outside of FS */
+ if (!valid_block(ip->i_sbd, block)) { /* blk outside of FS */
fsck_blockmap_set(ip, ip->i_di.di_num.no_addr,
_("itself"), gfs2_bad_block);
log_debug( _("Bad indirect block (invalid/out of range) "
@@ -460,7 +460,7 @@ static int undo_check_metalist(struct gfs2_inode *ip, uint64_t block,
*bh = NULL;
- if (!valid_block(ip->i_sbd, block)){ /* blk outside of FS */
+ if (!valid_block(ip->i_sbd, block)) { /* blk outside of FS */
fsck_blockmap_set(ip, ip->i_di.di_num.no_addr,
_("itself"), gfs2_block_free);
return 1;
@@ -881,7 +881,7 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr,
struct gfs2_buffer_head *bh = NULL;
int error;
- if (!valid_block(sdp, el_blk)){
+ if (!valid_block(sdp, el_blk)) {
log_err( _("Inode #%llu (0x%llx): Extended Attribute block "
"%llu (0x%llx) has an extended leaf block #%llu "
"(0x%llx) that is invalid or out of range.\n"),
@@ -1073,7 +1073,7 @@ static int rangecheck_block(struct gfs2_inode *ip, uint64_t block,
long *bad_pointers = (long *)private;
uint8_t q;
- if (!valid_block(ip->i_sbd, block) != 0) {
+ if (!valid_block(ip->i_sbd, block)) {
(*bad_pointers)++;
log_info( _("Bad %s block pointer (invalid or out of range "
"#%ld) found in inode %lld (0x%llx).\n"),
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 49b1d95..443daf5 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -225,7 +225,7 @@ static int clear_dup_metalist(struct gfs2_inode *ip, uint64_t block,
struct dup_handler *dh = (struct dup_handler *) private;
struct duptree *d;
- if (!valid_block(ip->i_sbd, block) != 0)
+ if (!valid_block(ip->i_sbd, block))
return 0;
/* This gets tricky. We're traversing a metadata tree trying to
@@ -641,9 +641,10 @@ int pass1b(struct gfs2_sbd *sdp)
/* Rescan the fs looking for pointers to blocks that are in
* the duplicate block map */
log_info( _("Scanning filesystem for inodes containing duplicate blocks...\n"));
- log_debug( _("Filesystem has %"PRIu64" (0x%" PRIx64 ") blocks total\n"),
- last_fs_block, last_fs_block);
- for(i = 0; i < last_fs_block; i++) {
+ log_debug( _("Filesystem has %llu (0x%llx) blocks total\n"),
+ (unsigned long long)last_fs_block,
+ (unsigned long long)last_fs_block);
+ for (i = 0; i < last_fs_block; i++) {
if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
goto out;
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index b050e44..deaa883 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -778,7 +778,7 @@ int pass2(struct gfs2_sbd *sdp)
}
log_info( _("Checking directory inodes.\n"));
/* Grab each directory inode, and run checks on it */
- for(dirblk = 0; dirblk < last_fs_block; dirblk++) {
+ for (dirblk = 0; dirblk < last_fs_block; dirblk++) {
warm_fuzzy_stuff(dirblk);
if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
return FSCK_OK;
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index f5798a0..cc11b6b 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -56,13 +56,14 @@ static int convert_mark(uint8_t q, uint32_t *count)
default:
log_err( _("Invalid block type %d found\n"), q);
- return -1;
}
return -1;
}
-static int check_block_status(struct gfs2_sbd *sdp, char *buffer, unsigned int buflen,
- uint64_t *rg_block, uint64_t rg_data, uint32_t *count)
+
+static int check_block_status(struct gfs2_sbd *sdp, char *buffer,
+ unsigned int buflen, uint64_t *rg_block,
+ uint64_t rg_data, uint32_t *count)
{
unsigned char *byte, *end;
unsigned int bit;
@@ -163,7 +164,8 @@ static void update_rgrp(struct gfs2_sbd *sdp, struct rgrp_list *rgp,
/* update the bitmaps */
check_block_status(sdp, rgp->bh[i]->b_data + bits->bi_offset,
- bits->bi_len, &rg_block, rgp->ri.ri_data0, count);
+ bits->bi_len, &rg_block, rgp->ri.ri_data0,
+ count);
if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
return;
}
More information about the cluster-commits
mailing list