This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 6b8677e53e8ef318f088a8ff4c2fb94a594675c7
Author: Andreas Gruenbacher <agruenba(a)redhat.com>
AuthorDate: Thu Apr 22 20:45:01 2021 +0200
fsck.gfs2: Convert enum values to upper-case
Several of the enums in the fsck.gfs2 code use lower-case enum values, which
makes the code harder to read than necessary. Convert those to upper-case
with:
toupper() {
printf '%s\n' "$@" |
awk '{ print "s/\\<" $1 "\\>/" toupper($1) "/g" }'
}
toupper \
ref_as_data ref_as_meta ref_as_ea ref_is_inode ref_types \
blind_faith ye_of_little_faith open_minded distrust indignation \
incr_link_bad incr_link_good incr_link_ino_mismatch incr_link_check_orig \
meta_error meta_is_good meta_skip_further meta_skip_one \
btype_meta btype_leaf btype_data btype_ieattr btype_eattr \
| sed -i -f /dev/stdin $(git ls-files gfs2/fsck)
Signed-off-by: Andreas Gruenbacher <agruenba(a)redhat.com>
---
gfs2/fsck/afterpass1_common.c | 8 ++---
gfs2/fsck/fs_recovery.c | 8 ++---
gfs2/fsck/fsck.h | 22 ++++++------
gfs2/fsck/initialize.c | 4 +--
gfs2/fsck/link.c | 16 ++++-----
gfs2/fsck/link.h | 8 ++---
gfs2/fsck/metawalk.c | 24 ++++++-------
gfs2/fsck/metawalk.h | 8 ++---
gfs2/fsck/pass1.c | 78 +++++++++++++++++++++----------------------
gfs2/fsck/pass1b.c | 68 ++++++++++++++++++-------------------
gfs2/fsck/pass2.c | 6 ++--
gfs2/fsck/rgrepair.c | 28 ++++++++--------
gfs2/fsck/util.c | 24 ++++++-------
gfs2/fsck/util.h | 2 +-
14 files changed, 152 insertions(+), 152 deletions(-)
diff --git a/gfs2/fsck/afterpass1_common.c b/gfs2/fsck/afterpass1_common.c
index 646e4010..82b9a54c 100644
--- a/gfs2/fsck/afterpass1_common.c
+++ b/gfs2/fsck/afterpass1_common.c
@@ -39,7 +39,7 @@ static int find_remove_dup(struct gfs2_inode *ip, uint64_t block,
if (!id)
goto more_refs;
- if (id->reftypecount[ref_as_meta])
+ if (id->reftypecount[REF_AS_META])
deleted_a_meta_ref = 1;
dup_listent_delete(dt, id);
if (dt->refs == 0) {
@@ -82,7 +82,7 @@ static int delete_block_if_notdup(struct gfs2_inode *ip, uint64_t block,
int removed_lastmeta = 0;
if (!valid_block_ip(ip, block))
- return meta_error;
+ return META_ERROR;
q = bitmap_type(ip->i_sbd, block);
if (q == GFS2_BLKST_FREE) {
@@ -92,7 +92,7 @@ static int delete_block_if_notdup(struct gfs2_inode *ip, uint64_t block,
(unsigned long long)block,
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
- return meta_is_good;
+ return META_IS_GOOD;
}
if (find_remove_dup(ip, block, btype, &removed_lastmeta)) { /* a dup */
if (was_duplicate) {
@@ -111,7 +111,7 @@ static int delete_block_if_notdup(struct gfs2_inode *ip, uint64_t block,
check_n_fix_bitmap(ip->i_sbd, ip->i_rgd, block, 0,
GFS2_BLKST_FREE);
}
- return meta_is_good;
+ return META_IS_GOOD;
}
static int remove_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 7bfddbfd..c7704b0e 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -628,9 +628,9 @@ static int rangecheck_jblock(struct gfs2_inode *ip, uint64_t block)
"journal inode %lld (0x%llx).\n"),
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
- return meta_error; /* Exits check_metatree quicker */
+ return META_ERROR; /* Exits check_metatree quicker */
}
- return meta_is_good;
+ return META_IS_GOOD;
}
static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
@@ -644,7 +644,7 @@ static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int
*was_duplicate = 0;
*is_valid = 0;
rc = rangecheck_jblock(ip, block);
- if (rc == meta_is_good) {
+ if (rc == META_IS_GOOD) {
*bh = bread(ip->i_sbd, block);
*is_valid = (gfs2_check_meta((*bh)->b_data, GFS2_METATYPE_IN) == 0);
if (!(*is_valid)) {
@@ -658,7 +658,7 @@ static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int
(unsigned long long)block);
brelse(*bh);
*bh = NULL;
- return meta_skip_further;
+ return META_SKIP_FURTHER;
}
}
return rc;
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index aad9a360..16aab67d 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -74,36 +74,36 @@ struct duptree {
};
enum dup_ref_type {
- ref_as_data = 0, /* dinode references this block as a data block */
- ref_as_meta = 1, /* dinode references this block as a metadata block */
- ref_as_ea = 2, /* dinode references this block as an extended attr */
- ref_is_inode= 3, /* The reference is itself a dinode. In other words,
+ REF_AS_DATA = 0, /* dinode references this block as a data block */
+ REF_AS_META = 1, /* dinode references this block as a metadata block */
+ REF_AS_EA = 2, /* dinode references this block as an extended attr */
+ REF_IS_INODE= 3, /* The reference is itself a dinode. In other words,
it's a dinode, not pointed to as data or
metadata */
- ref_types = 4,
+ REF_TYPES = 4,
};
struct inode_with_dups {
osi_list_t list;
uint64_t block_no;
int dup_count;
- int reftypecount[ref_types];
+ int reftypecount[REF_TYPES];
uint64_t parent;
char *name;
};
enum rgindex_trust_level { /* how far can we trust our RG index? */
- blind_faith = 0, /* We'd like to trust the rgindex. We always used to
+ BLIND_FAITH = 0, /* We'd like to trust the rgindex. We always used to
before bz 179069. This should cover most cases. */
- ye_of_little_faith = 1, /* The rindex seems trustworthy but there's
+ YE_OF_LITTLE_FAITH = 1, /* The rindex seems trustworthy but there's
rg damage that need to be fixed. */
- open_minded = 2, /* At least 1 RG is corrupt. Try to calculate what it
+ OPEN_MINDED = 2, /* At least 1 RG is corrupt. Try to calculate what it
should be, in a perfect world where our RGs are all
on even boundaries. Blue sky. Chirping birds. */
- distrust = 3, /* The world isn't perfect, our RGs are not on nice neat
+ DISTRUST = 3, /* The world isn't perfect, our RGs are not on nice neat
boundaries. The fs must have been messed with by
gfs2_grow or something. Count the RGs by hand. */
- indignation = 4 /* Not only do we have corruption, but the rgrps
+ INDIGNATION = 4 /* Not only do we have corruption, but the rgrps
aren't on even boundaries, so this file system
must have been converted from gfs2_convert. */
};
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 17f2d6cd..e35cf0a9 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -779,7 +779,7 @@ static int fetch_rgrps(struct gfs2_sbd *sdp)
int ok = 1;
log_notice(_("Validating resource group index.\n"));
- for (trust_lvl = blind_faith; trust_lvl <= indignation; trust_lvl++) {
+ for (trust_lvl = BLIND_FAITH; trust_lvl <= INDIGNATION; trust_lvl++) {
int ret = 0;
ret = fetch_rgrps_level(sdp, trust_lvl, &rgcount, &ok);
@@ -788,7 +788,7 @@ static int fetch_rgrps(struct gfs2_sbd *sdp)
if (fsck_abort)
break;
}
- if (trust_lvl > indignation) {
+ if (trust_lvl > INDIGNATION) {
log_err( _("Resource group recovery impossible; I can't fix "
"this file system.\n"));
return -1;
diff --git a/gfs2/fsck/link.c b/gfs2/fsck/link.c
index 8ea09c75..08118e8a 100644
--- a/gfs2/fsck/link.c
+++ b/gfs2/fsck/link.c
@@ -88,33 +88,33 @@ int incr_link_count(struct gfs2_inum no, struct gfs2_inode *ip,
di = dirtree_find(no.no_addr);
if (di) {
if (di->dinode.no_formal_ino != no.no_formal_ino)
- return incr_link_ino_mismatch;
+ return INCR_LINK_INO_MISMATCH;
di->counted_links++;
whyincr(no.no_addr, why, referenced_from, di->counted_links);
- return incr_link_good;
+ return INCR_LINK_GOOD;
}
ii = inodetree_find(no.no_addr);
/* If the list has entries, look for one that matches inode_no */
if (ii) {
if (ii->di_num.no_formal_ino != no.no_formal_ino)
- return incr_link_ino_mismatch;
+ return INCR_LINK_INO_MISMATCH;
ii->counted_links++;
whyincr(no.no_addr, why, referenced_from, ii->counted_links);
- return incr_link_good;
+ return INCR_LINK_GOOD;
}
if (link1_type(&clink1map, no.no_addr) != 1) {
link1_set(&clink1map, no.no_addr, 1);
whyincr(no.no_addr, why, referenced_from, 1);
- return incr_link_good;
+ return INCR_LINK_GOOD;
}
link_ip = fsck_load_inode(ip->i_sbd, no.no_addr);
/* Check formal ino against dinode before adding to inode tree. */
if (no.no_formal_ino != link_ip->i_di.di_num.no_formal_ino) {
fsck_inode_put(&link_ip);
- return incr_link_ino_mismatch; /* inode mismatch */
+ return INCR_LINK_INO_MISMATCH; /* inode mismatch */
}
/* Move it from the link1 maps to a real inode tree entry */
link1_set(&nlink1map, no.no_addr, 0);
@@ -130,7 +130,7 @@ int incr_link_count(struct gfs2_inum no, struct gfs2_inode *ip,
(unsigned long long)referenced_from,
(unsigned long long)no.no_addr);
fsck_inode_put(&link_ip);
- return incr_link_bad;
+ return INCR_LINK_BAD;
}
ii->di_num = link_ip->i_di.di_num;
fsck_inode_put(&link_ip);
@@ -142,7 +142,7 @@ int incr_link_count(struct gfs2_inum no, struct gfs2_inode *ip,
not a directory. But the new reference has the correct formal
inode number, so the first reference is suspect: we need to
check it in case it's a bad reference, and not just a hard link. */
- return incr_link_check_orig;
+ return INCR_LINK_CHECK_ORIG;
}
#define whydecr(no_addr, why, referenced_from, counted_links) \
diff --git a/gfs2/fsck/link.h b/gfs2/fsck/link.h
index a5dd1c85..0b300225 100644
--- a/gfs2/fsck/link.h
+++ b/gfs2/fsck/link.h
@@ -5,10 +5,10 @@ extern struct gfs2_bmap nlink1map; /* map of dinodes with nlink == 1 */
extern struct gfs2_bmap clink1map; /* map of dinodes w/counted links == 1 */
enum {
- incr_link_bad = -1,
- incr_link_good = 0,
- incr_link_ino_mismatch = 1,
- incr_link_check_orig = 2,
+ INCR_LINK_BAD = -1,
+ INCR_LINK_GOOD = 0,
+ INCR_LINK_INO_MISMATCH = 1,
+ INCR_LINK_CHECK_ORIG = 2,
};
int link1_set(struct gfs2_bmap *bmap, uint64_t bblock, int mark);
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index ef029351..8b721015 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1225,14 +1225,14 @@ static int do_check_metalist(struct iptr iptr, int height, struct gfs2_buffer_he
error = pass->check_metalist(iptr, bhp, height, &is_valid,
&was_duplicate, pass->private);
- if (error == meta_error) {
+ if (error == META_ERROR) {
stack;
log_info("\n");
log_info(_("Serious metadata error on block %"PRIu64" (0x%"PRIx64").\n"),
block, block);
return error;
}
- if (error == meta_skip_further) {
+ if (error == META_SKIP_FURTHER) {
log_info("\n");
log_info(_("Unrecoverable metadata error on block %"PRIu64" (0x%"PRIx64")\n"),
block, block);
@@ -1242,18 +1242,18 @@ static int do_check_metalist(struct iptr iptr, int height, struct gfs2_buffer_he
if (!is_valid) {
log_debug("Skipping rejected block %"PRIu64" (0x%"PRIx64")\n", block, block);
if (pass->invalid_meta_is_fatal)
- return meta_error;
- return meta_skip_one;
+ return META_ERROR;
+ return META_SKIP_ONE;
}
if (was_duplicate) {
log_debug("Skipping duplicate %"PRIu64" (0x%"PRIx64")\n", block, block);
- return meta_skip_one;
+ return META_SKIP_ONE;
}
if (!valid_block_ip(ip, block)) {
log_debug("Skipping invalid block %"PRIu64" (0x%"PRIx64")\n", block, block);
if (pass->invalid_meta_is_fatal)
- return meta_error;
- return meta_skip_one;
+ return META_ERROR;
+ return META_SKIP_ONE;
}
return error;
}
@@ -1293,7 +1293,7 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
/* if (<there are no indirect blocks to check>) */
if (height < 2)
- return meta_is_good;
+ return META_IS_GOOD;
for (h = 1; h < height; h++) {
if (h > 1) {
if (is_dir(&ip->i_di, ip->i_sbd->gfs1) &&
@@ -1323,7 +1323,7 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
if (gfs2_check_meta(iptr_buf(iptr), iblk_type)) {
if (pass->invalid_meta_is_fatal)
- return meta_error;
+ return META_ERROR;
continue;
}
@@ -1335,14 +1335,14 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
struct gfs2_buffer_head *nbh = NULL;
if (skip_this_pass || fsck_abort)
- return meta_is_good;
+ return META_IS_GOOD;
if (!iptr_block(iptr))
continue;
error = do_check_metalist(iptr, h, &nbh, pass);
- if (error == meta_error || error == meta_skip_further)
+ if (error == META_ERROR || error == META_SKIP_FURTHER)
goto error_undo;
- if (error == meta_skip_one)
+ if (error == META_SKIP_ONE)
continue;
if (!nbh)
nbh = bread(ip->i_sbd, iptr_block(iptr));
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index 88c7d9c1..f63ed5cf 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -36,10 +36,10 @@ extern struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,
#define fsck_bitmap_set_noino(ip, b, bt, m) \
_fsck_bitmap_set(ip, b, bt, m, 1, __FUNCTION__, __LINE__)
enum meta_check_rc {
- meta_error = -1,
- meta_is_good = 0,
- meta_skip_further = 1,
- meta_skip_one = 2,
+ META_ERROR = -1,
+ META_IS_GOOD = 0,
+ META_SKIP_FURTHER = 1,
+ META_SKIP_ONE = 2,
};
struct iptr {
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 27a7d6dc..71d6a46d 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -238,7 +238,7 @@ static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
*is_valid = 0;
- return meta_is_good;
+ return META_IS_GOOD;
}
if (fsck_system_inode(ip->i_sbd, block))
fsck_blockmap_set(ip, block, _("system file"),
@@ -249,7 +249,7 @@ static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
ip->i_sbd->gfs1 ?
GFS2_BLKST_DINODE : GFS2_BLKST_USED);
bc->indir_count++;
- return meta_is_good;
+ return META_IS_GOOD;
}
/*
@@ -328,7 +328,7 @@ static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr, q,
block_type_string(q));
- add_duplicate_ref(ip, block, ref_as_meta, 0, INODE_VALID);
+ add_duplicate_ref(ip, block, REF_AS_META, 0, INODE_VALID);
if (q == (ip->i_sbd->gfs1 ? GFS2_BLKST_DINODE :
GFS2_BLKST_USED))
/* If the previous reference also saw this as a leaf,
@@ -368,7 +368,7 @@ static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
- return meta_skip_further;
+ return META_SKIP_FURTHER;
}
if (is_dir(&ip->i_di, ip->i_sbd->gfs1) && h == ip->i_di.di_height) {
iblk_type = GFS2_METATYPE_JD;
@@ -405,16 +405,16 @@ static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
*iptr_ptr(iptr) = 0;
bmodified(iptr.ipt_bh);
*is_valid = 1;
- return meta_skip_one;
+ return META_SKIP_ONE;
} else {
brelse(nbh);
- return meta_skip_further;
+ return META_SKIP_FURTHER;
}
}
bc->indir_count++;
if (*was_duplicate) {
- add_duplicate_ref(ip, block, ref_as_meta, 0,
+ add_duplicate_ref(ip, block, REF_AS_META, 0,
*is_valid ? INODE_VALID : INODE_INVALID);
brelse(nbh);
} else {
@@ -424,8 +424,8 @@ static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
}
if (*is_valid)
- return meta_is_good;
- return meta_skip_further;
+ return META_IS_GOOD;
+ return META_SKIP_FURTHER;
}
/* undo_reference - undo previously processed data or metadata
@@ -602,7 +602,7 @@ static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
when check_metatree tries to delete the inode, we
can't have the "undo" functions freeing the block
out from other the original referencing inode. */
- add_duplicate_ref(ip, block, ref_as_data, 0,
+ add_duplicate_ref(ip, block, REF_AS_DATA, 0,
INODE_VALID);
return 1;
case GFS2_BLKST_USED: /* tough decision: May be data or meta */
@@ -622,13 +622,13 @@ static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
the inode, we can't have the "undo"
functions freeing the block out from other
the original referencing inode. */
- add_duplicate_ref(ip, block, ref_as_data, 0,
+ add_duplicate_ref(ip, block, REF_AS_DATA, 0,
INODE_VALID);
return 1;
}
log_info( _("Seems to be a normal duplicate; I'll "
"sort it out in pass1b.\n"));
- add_duplicate_ref(ip, block, ref_as_data, 0,
+ add_duplicate_ref(ip, block, REF_AS_DATA, 0,
INODE_VALID);
/* This inode references the block as data. So if this
all is validated, we want to keep this count. */
@@ -636,7 +636,7 @@ static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
case GFS2_BLKST_UNLINKED:
log_info( _("The block was invalid as metadata but might be "
"okay as data. I'll sort it out in pass1b.\n"));
- add_duplicate_ref(ip, block, ref_as_data, 0, INODE_VALID);
+ add_duplicate_ref(ip, block, REF_AS_DATA, 0, INODE_VALID);
return 0;
}
}
@@ -692,7 +692,7 @@ static int undo_eattr_indir_or_leaf(struct gfs2_inode *ip, uint64_t block,
struct block_count *bc = (struct block_count *) private;
if (!valid_block_ip(ip, block))
- return meta_error;
+ return META_ERROR;
/* Need to check block_type before undoing the reference, which can
set it to free, which would cause the test below to fail. */
@@ -755,7 +755,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
if (gfs2_check_meta((*bh)->b_data, GFS2_METATYPE_IN)) {
bc->ea_count++;
if (q != GFS2_BLKST_FREE) { /* Duplicate? */
- add_duplicate_ref(ip, indirect, ref_as_ea, 0,
+ add_duplicate_ref(ip, indirect, REF_AS_EA, 0,
INODE_VALID);
complain_eas(ip, indirect,
_("Bad indirect Extended Attribute "
@@ -772,7 +772,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
return 1;
}
if (q != GFS2_BLKST_FREE) { /* Duplicate? */
- add_duplicate_ref(ip, indirect, ref_as_ea, 0, INODE_VALID);
+ add_duplicate_ref(ip, indirect, REF_AS_EA, 0, INODE_VALID);
complain_eas(ip, indirect,
_("Duplicate Extended Attribute indirect block"));
bc->ea_count++;
@@ -837,7 +837,7 @@ static int check_ealeaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
if (gfs2_check_meta(leaf_bh->b_data, btype)) {
bc->ea_count++;
if (q != GFS2_BLKST_FREE) { /* Duplicate? */
- add_duplicate_ref(ip, block, ref_as_ea, 0,
+ add_duplicate_ref(ip, block, REF_AS_EA, 0,
INODE_VALID);
complain_eas(ip, block, _("Extended attribute leaf "
"duplicate found"));
@@ -855,7 +855,7 @@ static int check_ealeaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
if (q != GFS2_BLKST_FREE) { /* Duplicate? */
complain_eas(ip, block, _("Extended Attribute leaf "
"duplicate found"));
- add_duplicate_ref(ip, block, ref_as_data, 0, INODE_VALID);
+ add_duplicate_ref(ip, block, REF_AS_DATA, 0, INODE_VALID);
bc->ea_count++;
brelse(leaf_bh);
/* Return 0 here because if all that's wrong is a duplicate
@@ -1103,7 +1103,7 @@ static int mark_block_invalid(struct gfs2_inode *ip, uint64_t block,
if (!valid_block_ip(ip, block)) {
if (is_valid)
*is_valid = 0;
- return meta_is_good;
+ return META_IS_GOOD;
}
q = block_type(bl, block);
@@ -1118,10 +1118,10 @@ static int mark_block_invalid(struct gfs2_inode *ip, uint64_t block,
(unsigned long long)block,
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
- return meta_is_good;
+ return META_IS_GOOD;
}
fsck_blockmap_set(ip, block, btype, GFS2_BLKST_UNLINKED);
- return meta_is_good;
+ return META_IS_GOOD;
}
static int invalidate_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
@@ -1132,14 +1132,14 @@ static int invalidate_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, i
*is_valid = 1;
*was_duplicate = 0;
- return mark_block_invalid(ip, block, ref_as_meta, _("metadata"),
+ return mark_block_invalid(ip, block, REF_AS_META, _("metadata"),
is_valid, was_duplicate);
}
static int invalidate_leaf(struct gfs2_inode *ip, uint64_t block,
void *private)
{
- return mark_block_invalid(ip, block, ref_as_meta, _("leaf"),
+ return mark_block_invalid(ip, block, REF_AS_META, _("leaf"),
NULL, NULL);
}
@@ -1147,7 +1147,7 @@ static int invalidate_data(struct gfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
- return mark_block_invalid(ip, block, ref_as_data, _("data"),
+ return mark_block_invalid(ip, block, REF_AS_DATA, _("data"),
NULL, NULL);
}
@@ -1155,7 +1155,7 @@ static int invalidate_eattr_indir(struct gfs2_inode *ip, uint64_t block,
uint64_t parent,
struct gfs2_buffer_head **bh, void *private)
{
- return mark_block_invalid(ip, block, ref_as_ea,
+ return mark_block_invalid(ip, block, REF_AS_EA,
_("indirect extended attribute"),
NULL, NULL);
}
@@ -1164,7 +1164,7 @@ static int invalidate_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
- return mark_block_invalid(ip, block, ref_as_ea,
+ return mark_block_invalid(ip, block, REF_AS_EA,
_("extended attribute"),
NULL, NULL);
}
@@ -1181,7 +1181,7 @@ static int invalidate_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
* be trusted. Thus it needs to be in a separate loop.
* Returns: 0 if good range, otherwise != 0
*/
-enum b_types { btype_meta, btype_leaf, btype_data, btype_ieattr, btype_eattr};
+enum b_types { BTYPE_META, BTYPE_LEAF, BTYPE_DATA, BTYPE_IEATTR, BTYPE_EATTR};
const char *btypes[5] = {
"metadata", "leaf", "data", "indirect extended attribute",
"extended attribute" };
@@ -1201,9 +1201,9 @@ static int rangecheck_block(struct gfs2_inode *ip, uint64_t block,
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
if ((*bad_pointers) <= BAD_POINTER_TOLERANCE)
- return meta_is_good;
+ return META_IS_GOOD;
else
- return meta_error; /* Exits check_metatree quicker */
+ return META_ERROR; /* Exits check_metatree quicker */
}
/* See how many duplicate blocks it has */
q = block_type(bl, block);
@@ -1216,16 +1216,16 @@ static int rangecheck_block(struct gfs2_inode *ip, uint64_t block,
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
if ((*bad_pointers) <= BAD_POINTER_TOLERANCE)
- return meta_is_good;
+ return META_IS_GOOD;
else {
log_debug(_("Inode 0x%llx bad pointer tolerance "
"exceeded: block 0x%llx.\n"),
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)block);
- return meta_error; /* Exits check_metatree quicker */
+ return META_ERROR; /* Exits check_metatree quicker */
}
}
- return meta_is_good;
+ return META_IS_GOOD;
}
static int rangecheck_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
@@ -1236,34 +1236,34 @@ static int rangecheck_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, i
*is_valid = 1;
*was_duplicate = 0;
- return rangecheck_block(ip, block, bh, btype_meta, private);
+ return rangecheck_block(ip, block, bh, BTYPE_META, private);
}
static int rangecheck_leaf(struct gfs2_inode *ip, uint64_t block,
void *private)
{
- return rangecheck_block(ip, block, NULL, btype_leaf, private);
+ return rangecheck_block(ip, block, NULL, BTYPE_LEAF, private);
}
static int rangecheck_data(struct gfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
- return rangecheck_block(ip, block, NULL, btype_data, private);
+ return rangecheck_block(ip, block, NULL, BTYPE_DATA, private);
}
static int rangecheck_eattr_indir(struct gfs2_inode *ip, uint64_t block,
uint64_t parent,
struct gfs2_buffer_head **bh, void *private)
{
- return rangecheck_block(ip, block, NULL, btype_ieattr, private);
+ return rangecheck_block(ip, block, NULL, BTYPE_IEATTR, private);
}
static int rangecheck_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
- return rangecheck_block(ip, block, NULL, btype_eattr, private);
+ return rangecheck_block(ip, block, NULL, BTYPE_EATTR, private);
}
struct metawalk_fxns rangecheck_fxns = {
@@ -1355,7 +1355,7 @@ static int alloc_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
gfs2_blockmap_set(bl, block, ip->i_sbd->gfs1 ?
GFS2_BLKST_DINODE : GFS2_BLKST_USED);
}
- return meta_is_good;
+ return META_IS_GOOD;
}
static int alloc_data(struct gfs2_inode *ip, uint64_t metablock,
@@ -1975,7 +1975,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
block_type_string(q));
ip = fsck_inode_get(sdp, rgd, bh);
if (is_inode && ip->i_di.di_num.no_addr == block)
- add_duplicate_ref(ip, block, ref_is_inode, 0,
+ add_duplicate_ref(ip, block, REF_IS_INODE, 0,
INODE_VALID);
else
log_info(_("dinum.no_addr is wrong, so I "
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index ae5a2c49..a6f06ade 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -55,10 +55,10 @@ static void log_inode_reference(struct duptree *dt, osi_list_t *tmp, int inval)
sprintf(reftypestring, "as %s", reftypes[get_ref_type(id)]);
else
sprintf(reftypestring, "%d/%d/%d/%d",
- id->reftypecount[ref_is_inode],
- id->reftypecount[ref_as_data],
- id->reftypecount[ref_as_meta],
- id->reftypecount[ref_as_ea]);
+ id->reftypecount[REF_IS_INODE],
+ id->reftypecount[REF_AS_DATA],
+ id->reftypecount[REF_AS_META],
+ id->reftypecount[REF_AS_EA]);
if (inval)
log_warn( _("Invalid "));
log_warn( _("Inode %s (%lld/0x%llx) has %d reference(s) to "
@@ -74,7 +74,7 @@ static int findref_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
{
*is_valid = 1;
*was_duplicate = 0;
- return meta_is_good;
+ return META_IS_GOOD;
}
static int findref_data(struct gfs2_inode *ip, uint64_t metablock,
@@ -90,7 +90,7 @@ static int findref_data(struct gfs2_inode *ip, uint64_t metablock,
"block 0x%llx, offset 0x%x\n",
(unsigned long long)mbr->metablock, mbr->off);
}
- return meta_is_good;
+ return META_IS_GOOD;
}
static void clone_data_block(struct gfs2_sbd *sdp, struct duptree *dt,
@@ -225,7 +225,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
* block, we should really duplicate the block and fix all
* references to it in this inode. Unfortunately, we would
* have to traverse the entire metadata tree to do that. */
- if (acceptable_ref != ref_types && /* If we're nuking all but
+ if (acceptable_ref != REF_TYPES && /* If we're nuking all but
an acceptable reference
type and */
this_ref == acceptable_ref) { /* this ref is acceptable */
@@ -261,7 +261,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
(unsigned long long)dt->block,
(unsigned long long)dt->block,
reftypes[this_ref], reftypes[acceptable_ref]);
- if (this_ref == ref_as_ea) {
+ if (this_ref == REF_AS_EA) {
if (!(query( _("Okay to remove extended attributes "
"from %s inode %lld (0x%llx)? (y/n) "),
(inval ? _("invalidated") : ""),
@@ -278,8 +278,8 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
dup_listent_delete(dt, id);
continue;
}
- } else if (acceptable_ref == ref_types &&
- this_ref == ref_as_data) {
+ } else if (acceptable_ref == REF_TYPES &&
+ this_ref == REF_AS_DATA) {
clone_data_block(sdp, dt, id);
dup_listent_delete(dt, id);
revise_dup_handler(dt->block, dh);
@@ -303,7 +303,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
"deleted.\n"),
(unsigned long long)id->block_no,
(unsigned long long)id->block_no);
- else if (this_ref == ref_as_ea)
+ else if (this_ref == REF_AS_EA)
log_warn(_("Pass1b is removing extended attributes "
"from inode %lld (0x%llx).\n"),
(unsigned long long)id->block_no,
@@ -343,9 +343,9 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
}
/* If the reference was as metadata or data, we've got
a corrupt dinode that will be deleted. */
- if ((this_ref != ref_as_ea) &&
- (inval || id->reftypecount[ref_as_data] ||
- id->reftypecount[ref_as_meta])) {
+ if ((this_ref != REF_AS_EA) &&
+ (inval || id->reftypecount[REF_AS_DATA] ||
+ id->reftypecount[REF_AS_META])) {
/* Fix the bitmap first, while the inodetree
and dirtree entries exist. That way, the
bitmap_set will do proper accounting for
@@ -385,7 +385,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
(because they were eliminated earlier in pass1b). And so
the blocks will be mistakenly freed, when, in fact, they're
still being referenced by a valid dinode. */
- if (this_ref != ref_as_ea)
+ if (this_ref != REF_AS_EA)
delete_all_dups(ip);
fsck_inode_put(&ip); /* out, brelse, free */
}
@@ -584,12 +584,12 @@ static void resolve_last_reference(struct gfs2_sbd *sdp, struct duptree *dt,
"already marked free.\n"),
(unsigned long long)id->block_no,
(unsigned long long)id->block_no);
- } else if (id->reftypecount[ref_is_inode]) {
+ } else if (id->reftypecount[REF_IS_INODE]) {
set_ip_bitmap(ip);
- } else if (id->reftypecount[ref_as_data]) {
+ } else if (id->reftypecount[REF_AS_DATA]) {
fsck_bitmap_set(ip, dt->block, _("reference-repaired data"),
GFS2_BLKST_USED);
- } else if (id->reftypecount[ref_as_meta]) {
+ } else if (id->reftypecount[REF_AS_META]) {
if (is_dir(&ip->i_di, sdp->gfs1))
fsck_bitmap_set(ip, dt->block,
_("reference-repaired leaf"),
@@ -601,7 +601,7 @@ static void resolve_last_reference(struct gfs2_sbd *sdp, struct duptree *dt,
sdp->gfs1 ? GFS2_BLKST_DINODE :
GFS2_BLKST_USED);
} else {
- if (acceptable_ref == ref_as_ea)
+ if (acceptable_ref == REF_AS_EA)
fsck_bitmap_set(ip, dt->block,
_("reference-repaired extended "
"attribute"),
@@ -687,16 +687,16 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
entries) are invalid and should be deleted. */
if (be32_to_cpu(cmagic) == GFS2_MAGIC &&
be32_to_cpu(ctype) == GFS2_METATYPE_DI)
- acceptable_ref = ref_is_inode;
+ acceptable_ref = REF_IS_INODE;
else if (be32_to_cpu(cmagic) == GFS2_MAGIC &&
(be32_to_cpu(ctype) == GFS2_METATYPE_EA ||
be32_to_cpu(ctype) == GFS2_METATYPE_ED))
- acceptable_ref = ref_as_ea;
+ acceptable_ref = REF_AS_EA;
else if (be32_to_cpu(cmagic) == GFS2_MAGIC &&
be32_to_cpu(ctype) <= GFS2_METATYPE_QC)
- acceptable_ref = ref_as_meta;
+ acceptable_ref = REF_AS_META;
else
- acceptable_ref = ref_as_data;
+ acceptable_ref = REF_AS_DATA;
/* A single reference to the block implies a possible situation where
a data pointer points to a metadata block. In other words, the
@@ -714,7 +714,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
/* Step 1 - eliminate references from inodes that are not valid.
* This may be because they were deleted due to corruption.
- * All block types are unacceptable, so we use ref_types.
+ * All block types are unacceptable, so we use REF_TYPES.
*/
if (dh.ref_count > 1) {
log_debug( _("----------------------------------------------\n"
@@ -724,7 +724,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
(unsigned long long)dt->block,
(unsigned long long)dt->block);
resolve_dup_references(sdp, dt, &dt->ref_invinode_list,
- &dh, 1, ref_types);
+ &dh, 1, REF_TYPES);
revise_dup_handler(dup_blk, &dh);
}
/* Step 2 - eliminate reference from inodes that reference it as the
@@ -744,7 +744,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
}
/* Step 3 - We have multiple dinodes referencing it as the correct
* type. Just blast one of them.
- * All block types are fair game, so we use ref_types.
+ * All block types are fair game, so we use REF_TYPES.
*/
if (dh.ref_count > 1) {
log_debug( _("----------------------------------------------\n"
@@ -753,7 +753,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
(unsigned long long)dt->block,
(unsigned long long)dt->block);
resolve_dup_references(sdp, dt, &dt->ref_inode_list, &dh, 0,
- ref_types);
+ REF_TYPES);
revise_dup_handler(dup_blk, &dh);
}
/* If there's still a last remaining reference, and it's a valid
@@ -786,7 +786,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
static int check_leaf_refs(struct gfs2_inode *ip, uint64_t block,
void *private)
{
- return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID);
+ return add_duplicate_ref(ip, block, REF_AS_META, 1, INODE_VALID);
}
static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
@@ -797,14 +797,14 @@ static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, i
*was_duplicate = 0;
*is_valid = 1;
- return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID);
+ return add_duplicate_ref(ip, block, REF_AS_META, 1, INODE_VALID);
}
static int check_data_refs(struct gfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
- return add_duplicate_ref(ip, block, ref_as_data, 1, INODE_VALID);
+ return add_duplicate_ref(ip, block, REF_AS_DATA, 1, INODE_VALID);
}
static int check_eattr_indir_refs(struct gfs2_inode *ip, uint64_t block,
@@ -814,7 +814,7 @@ static int check_eattr_indir_refs(struct gfs2_inode *ip, uint64_t block,
struct gfs2_sbd *sdp = ip->i_sbd;
int error;
- error = add_duplicate_ref(ip, block, ref_as_ea, 1, INODE_VALID);
+ error = add_duplicate_ref(ip, block, REF_AS_EA, 1, INODE_VALID);
if (!error)
*bh = bread(sdp, block);
@@ -828,7 +828,7 @@ static int check_eattr_leaf_refs(struct gfs2_inode *ip, uint64_t block,
struct gfs2_sbd *sdp = ip->i_sbd;
int error;
- error = add_duplicate_ref(ip, block, ref_as_ea, 1, INODE_VALID);
+ error = add_duplicate_ref(ip, block, REF_AS_EA, 1, INODE_VALID);
if (!error)
*bh = bread(sdp, block);
return error;
@@ -859,7 +859,7 @@ static int check_eattr_extentry_refs(struct gfs2_inode *ip, int i,
the blockmap. In this case, we should be okay because the only
error possible is a malloc that fails, in which case we don't
want to delete the eattr anyway. */
- return add_duplicate_ref(ip, block, ref_as_ea, 1, INODE_VALID);
+ return add_duplicate_ref(ip, block, REF_AS_EA, 1, INODE_VALID);
}
/* Finds all references to duplicate blocks in the metadata */
@@ -892,7 +892,7 @@ static int find_block_ref(struct gfs2_sbd *sdp, uint64_t inode)
goto out;
}
/* Check to see if this inode was referenced by another by mistake */
- add_duplicate_ref(ip, inode, ref_is_inode, 1, INODE_VALID);
+ add_duplicate_ref(ip, inode, REF_IS_INODE, 1, INODE_VALID);
/* Check this dinode's metadata for references to known duplicates */
error = check_metatree(ip, &find_refs);
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 9184bbc6..e595051d 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -977,9 +977,9 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
dentry_is_valid:
/* This directory inode links to this inode via this dentry */
error = incr_link_count(entry, ip, _("valid reference"));
- if (error == incr_link_check_orig) {
+ if (error == INCR_LINK_CHECK_ORIG) {
error = check_suspicious_dirref(sdp, &entry);
- } else if (error == incr_link_ino_mismatch) {
+ } else if (error == INCR_LINK_INO_MISMATCH) {
log_err("incr_link_count err=%d.\n", error);
if (bad_formal_ino(ip, dent, entry, tmp_name, q, de, bh) == 1)
goto nuke_dentry;
@@ -1882,7 +1882,7 @@ static int check_metalist_qc(struct iptr iptr, struct gfs2_buffer_head **bh, int
*was_duplicate = 0;
*is_valid = 1;
*bh = bread(ip->i_sbd, block);
- return meta_is_good;
+ return META_IS_GOOD;
}
static int check_data_qc(struct gfs2_inode *ip, uint64_t metablock,
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index cc7c9c9d..bf1641e8 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -488,7 +488,7 @@ static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
/*
* rindex_rebuild - rebuild a corrupt Resource Group (RG) index manually
- * where trust_lvl == distrust
+ * where trust_lvl == DISTRUST
*
* If this routine is called, it means we have RGs in odd/unexpected places,
* and there is a corrupt RG or RG index entry. It also means we can't trust
@@ -854,7 +854,7 @@ static int calc_rgrps(struct gfs2_sbd *sdp)
/*
* gfs2_rindex_calculate - calculate what the rindex should look like
- * in a perfect world (trust_lvl == open_minded)
+ * in a perfect world (trust_lvl == OPEN_MINDED)
*
* Calculate what the rindex should look like,
* so we can later check if all RG index entries are sane.
@@ -1002,11 +1002,11 @@ static int expect_rindex_sanity(struct gfs2_sbd *sdp, int *num_rgs)
/*
* rg_repair - try to repair a damaged rg index (rindex)
* trust_lvl - This is how much we trust the rindex file.
- * blind_faith means we take the rindex at face value.
- * open_minded means it might be okay, but we should verify it.
- * distrust means it's not to be trusted, so we should go to
+ * BLIND_FAITH means we take the rindex at face value.
+ * OPEN_MINDED means it might be okay, but we should verify it.
+ * DISTRUST means it's not to be trusted, so we should go to
* greater lengths to build it from scratch.
- * indignation means we have corruption, but the file system
+ * INDIGNATION means we have corruption, but the file system
* was converted from GFS via gfs2_convert, and its rgrps are
* not on nice boundaries thanks to previous gfs_grow ops. Lovely.
*/
@@ -1017,9 +1017,9 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok)
int calc_rg_count = 0, rg;
struct gfs2_rindex buf;
- if (trust_lvl == blind_faith)
+ if (trust_lvl == BLIND_FAITH)
return 0;
- if (trust_lvl == ye_of_little_faith) { /* if rindex seems sane */
+ if (trust_lvl == YE_OF_LITTLE_FAITH) { /* if rindex seems sane */
/* Don't free previous incarnations in memory, if any.
* We need them to copy in the next function:
* gfs2_rgrp_free(&sdp->rglist); */
@@ -1033,7 +1033,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok)
gfs2_rgrp_free(sdp, &sdp->rgcalc);
return error;
}
- } else if (trust_lvl == open_minded) { /* If we can't trust RG index */
+ } else if (trust_lvl == OPEN_MINDED) { /* If we can't trust RG index */
/* Free previous incarnations in memory, if any. */
gfs2_rgrp_free(sdp, &sdp->rgtree);
@@ -1043,7 +1043,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok)
gfs2_rgrp_free(sdp, &sdp->rgcalc);
return -1;
}
- } else if (trust_lvl == distrust) { /* If we can't trust RG index */
+ } else if (trust_lvl == DISTRUST) { /* If we can't trust RG index */
/* Free previous incarnations in memory, if any. */
gfs2_rgrp_free(sdp, &sdp->rgtree);
@@ -1053,7 +1053,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok)
gfs2_rgrp_free(sdp, &sdp->rgcalc);
return -1;
}
- } else if (trust_lvl == indignation) { /* If we can't trust anything */
+ } else if (trust_lvl == INDIGNATION) { /* If we can't trust anything */
/* Free previous incarnations in memory, if any. */
gfs2_rgrp_free(sdp, &sdp->rgtree);
@@ -1090,11 +1090,11 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok)
"extended, (2) an odd\n"), trust_lvl + 1);
log_warn( _("L%d: rgrp size was used, or (3) we have a corrupt "
"rg index.\n"), trust_lvl + 1);
- /* If the trust level is open_minded, we would have calculated
+ /* If the trust level is OPEN_MINDED, we would have calculated
the rindex based on the device size. If it's not the same
number, don't trust it. Complain about the discrepancy,
- then try again with a little more distrust. */
- if ((trust_lvl < distrust) ||
+ then try again with a little more DISTRUST. */
+ if ((trust_lvl < DISTRUST) ||
!query( _("Attempt to use what rgrps we can? (y/n)"))) {
gfs2_rgrp_free(sdp, &sdp->rgcalc);
gfs2_rgrp_free(sdp, &sdp->rgtree);
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index abcf5f9c..26170fa5 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -17,7 +17,7 @@
#include "metawalk.h"
#include "util.h"
-const char *reftypes[ref_types + 1] = {"data", "metadata",
+const char *reftypes[REF_TYPES + 1] = {"data", "metadata",
"an extended attribute", "an inode",
"unimportant"};
@@ -304,12 +304,12 @@ int count_dup_meta_refs(struct duptree *dt)
osi_list_foreach(ref, &dt->ref_invinode_list) {
id = osi_list_entry(ref, struct inode_with_dups, list);
- if (id->reftypecount[ref_as_meta])
+ if (id->reftypecount[REF_AS_META])
metarefs++;
}
osi_list_foreach(ref, &dt->ref_inode_list) {
id = osi_list_entry(ref, struct inode_with_dups, list);
- if (id->reftypecount[ref_as_meta])
+ if (id->reftypecount[REF_AS_META])
metarefs++;
}
return metarefs;
@@ -336,19 +336,19 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
struct duptree *dt;
if (!valid_block_ip(ip, block))
- return meta_is_good;
+ return META_IS_GOOD;
/* If this is not the first reference (i.e. all calls from pass1) we
need to create the duplicate reference. If this is pass1b, we want
to ignore references that aren't found. */
dt = gfs2_dup_set(block, !first);
if (!dt) /* If this isn't a duplicate */
- return meta_is_good;
+ return META_IS_GOOD;
/* If we found the duplicate reference but we've already discovered
the first reference (in pass1b) and the other references in pass1,
we don't need to count it, so just return. */
if (dt->dup_flags & DUPFLAG_REF1_FOUND)
- return meta_is_good;
+ return META_IS_GOOD;
/* Check for a previous reference to this duplicate */
id = find_dup_ref_inode(dt, ip);
@@ -391,7 +391,7 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
id = calloc(1, sizeof(*id));
if (!id) {
log_crit( _("Unable to allocate inode_with_dups structure\n"));
- return meta_error;
+ return META_ERROR;
}
id->block_no = ip->i_di.di_num.no_addr;
q = bitmap_type(ip->i_sbd, ip->i_di.di_num.no_addr);
@@ -431,7 +431,7 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
"%d from this inode.\n"),
dt->refs, id->dup_count);
}
- return meta_is_good;
+ return META_IS_GOOD;
}
struct dir_info *dirtree_insert(struct gfs2_inum inum)
@@ -491,10 +491,10 @@ enum dup_ref_type get_ref_type(struct inode_with_dups *id)
int found_type_with_ref;
int found_other_types;
- for (t = ref_as_data; t < ref_types; t++) {
+ for (t = REF_AS_DATA; t < REF_TYPES; t++) {
found_type_with_ref = 0;
found_other_types = 0;
- for (i = ref_as_data; i < ref_types; i++) {
+ for (i = REF_AS_DATA; i < REF_TYPES; i++) {
if (id->reftypecount[i]) {
if (t == i)
found_type_with_ref = 1;
@@ -503,9 +503,9 @@ enum dup_ref_type get_ref_type(struct inode_with_dups *id)
}
}
if (found_type_with_ref)
- return found_other_types ? ref_types : t;
+ return found_other_types ? REF_TYPES : t;
}
- return ref_types;
+ return REF_TYPES;
}
void dup_listent_delete(struct duptree *dt, struct inode_with_dups *id)
diff --git a/gfs2/fsck/util.h b/gfs2/fsck/util.h
index d93b65d3..d8767247 100644
--- a/gfs2/fsck/util.h
+++ b/gfs2/fsck/util.h
@@ -21,7 +21,7 @@ extern struct inode_with_dups *find_dup_ref_inode(struct duptree *dt,
struct gfs2_inode *ip);
extern void dup_listent_delete(struct duptree *dt, struct inode_with_dups *id);
extern int count_dup_meta_refs(struct duptree *dt);
-extern const char *reftypes[ref_types + 1];
+extern const char *reftypes[REF_TYPES + 1];
#define BLOCKMAP_SIZE1(size) ((size) >> 3)
#define BLOCKMAP_SIZE2(size) ((size) >> 2)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.