This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 4e328af777a8cdfdae42de2ef482776e16489d54
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 28 15:50:51 2019 +0000
gfs2-utils: Accept a char* instead of a buffer head in gfs2_check_meta
This allows us to call it from different contexts.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 6 +++---
gfs2/edit/hexedit.c | 6 +++---
gfs2/edit/savemeta.c | 2 +-
gfs2/fsck/fs_recovery.c | 6 +++---
gfs2/fsck/initialize.c | 6 +++---
gfs2/fsck/metawalk.c | 10 +++++-----
gfs2/fsck/pass1.c | 12 ++++++------
gfs2/fsck/pass2.c | 8 ++++----
gfs2/fsck/pass5.c | 2 +-
gfs2/fsck/rgrepair.c | 10 +++++-----
gfs2/libgfs2/fs_ops.c | 6 +++---
gfs2/libgfs2/libgfs2.h | 2 +-
gfs2/libgfs2/rgrp.c | 2 +-
gfs2/libgfs2/structures.c | 6 +++---
gfs2/libgfs2/super.c | 2 +-
15 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 9cf97b6..17217ce 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -836,7 +836,7 @@ static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct g
/* Read in the i_di.di_eattr block */
eabh = bread(sbp, ip->i_di.di_eattr);
- if (!gfs2_check_meta(eabh, GFS_METATYPE_IN)) {/* if it is an indirect block */
+ if (!gfs2_check_meta(eabh->b_data, GFS_METATYPE_IN)) {/* if it is an indirect block */
len = sbp->bsize - sizeof(struct gfs_indirect);
buf = malloc(len);
if (!buf) {
@@ -1012,7 +1012,7 @@ static int next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
return -1;
bh = bread(sdp, *block);
first = 0;
- } while(gfs2_check_meta(bh, type));
+ } while(gfs2_check_meta(bh->b_data, type));
brelse(bh);
return 0;
}
@@ -1072,7 +1072,7 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
sbp->sd_sb.sb_root_dir.no_formal_ino = sbp->md.next_inum;
}
bh = bread(sbp, block);
- if (!gfs2_check_meta(bh, GFS_METATYPE_DI)) {/* if it is an dinode */
+ if (!gfs2_check_meta(bh->b_data, GFS_METATYPE_DI)) {/* if it is an dinode */
/* Skip the rindex and jindex inodes for now. */
if (block != rindex_addr && block != jindex_addr) {
error = adjust_inode(sbp, bh);
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index f015828..655afc5 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1275,7 +1275,7 @@ static int find_rg_metatype(struct rgrp_tree *rgd, uint64_t *blk, uint64_t start
for (j = 0; j < m; j++) {
*blk = ibuf[j];
bhp = bread(&sbd, *blk);
- found = (*blk > startblk) && !gfs2_check_meta(bhp, mtype);
+ found = (*blk > startblk) && !gfs2_check_meta(bhp->b_data, mtype);
brelse(bhp);
if (found) {
free(ibuf);
@@ -2280,7 +2280,7 @@ static int count_dinode_blks(struct rgrp_tree *rgd, int bitmap,
rgd->bits[bitmap].bi_start + b);
byte = rbh->b_data + off + (b / GFS2_NBBY);
bit = (b % GFS2_NBBY) * GFS2_BIT_SIZE;
- if (gfs2_check_meta(tbh, GFS2_METATYPE_DI) == 0) {
+ if (gfs2_check_meta(tbh->b_data, GFS2_METATYPE_DI) == 0) {
dinodes++;
new_state = GFS2_BLKST_DINODE;
} else {
@@ -2351,7 +2351,7 @@ static void rg_repair(void)
printf("Bitmap #%d:", b);
rbh = bread(&sbd, rgd->ri.ri_addr + b);
- if (gfs2_check_meta(rbh, mtype)) { /* wrong type */
+ if (gfs2_check_meta(rbh->b_data, mtype)) { /* wrong type */
printf("Damaged. Repairing...");
/* Fix the meta header */
memset(rbh->b_data, 0, sbd.bsize);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 04f1221..18432b7 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -567,7 +567,7 @@ static int save_leaf_chain(struct metafd *mfd, struct gfs2_sbd *sdp, uint64_t bl
return 1;
}
warm_fuzzy_stuff(blk, FALSE);
- if (gfs2_check_meta(bh, GFS2_METATYPE_LF) == 0) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LF) == 0) {
int ret = save_bh(mfd, bh, blk, NULL);
if (ret != 0) {
brelse(bh);
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 677abd7..4c0932b 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -211,7 +211,7 @@ static int revoke_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
return error;
if (!first) {
- if (gfs2_check_meta(bh, GFS2_METATYPE_LB))
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LB))
continue;
}
while (offset + sizeof(uint64_t) <= sdp->sd_sb.sb_bsize) {
@@ -355,7 +355,7 @@ static int foreach_descriptor(struct gfs2_inode *ip, unsigned int start,
bmodified(bh);
brelse(bh);
return error;
- } else if (gfs2_check_meta(bh, GFS2_METATYPE_LD)) {
+ } else if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LD)) {
bmodified(bh);
brelse(bh);
return -EIO;
@@ -649,7 +649,7 @@ static int rangecheck_jmeta(struct gfs2_inode *ip, uint64_t block,
rc = rangecheck_jblock(ip, block);
if (rc == meta_is_good) {
*bh = bread(ip->i_sbd, block);
- *is_valid = (gfs2_check_meta(*bh, GFS2_METATYPE_IN) == 0);
+ *is_valid = (gfs2_check_meta((*bh)->b_data, GFS2_METATYPE_IN) == 0);
if (!(*is_valid)) {
log_err( _("Journal at block %lld (0x%llx) has a bad "
"indirect block pointer %lld (0x%llx) "
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index d1c620a..ed6954d 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -243,7 +243,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
if (state == GFS2_BLKST_DINODE) {
if (sdp->gfs1) {
bh = bread(sdp, diblock);
- if (!gfs2_check_meta(bh,
+ if (!gfs2_check_meta(bh->b_data,
GFS2_METATYPE_DI))
rg_useddi++;
else
@@ -298,7 +298,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
(unsigned long long)diblock,
(unsigned long long)diblock);
bh = bread(sdp, diblock);
- if (!gfs2_check_meta(bh, GFS2_METATYPE_DI)) {
+ if (!gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI)) {
struct gfs2_inode *ip =
fsck_inode_get(sdp, rgd, bh);
if (ip->i_di.di_blocks > 1) {
@@ -1171,7 +1171,7 @@ static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
/* Max RG size is 2GB. 2G / bsize. */
for (blk = startblock; blk < startblock + max_rg_size; blk++) {
bh = bread(sdp, blk);
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI)) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI)) {
brelse(bh);
continue;
}
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 118e6f3..d256dd2 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -560,7 +560,7 @@ int check_leaf(struct gfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
/* Try to read in the leaf block. */
lbh = bread(sdp, *leaf_no);
/* Make sure it's really a valid leaf block. */
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF)) {
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF)) {
msg = _("that is not really a leaf");
goto bad_leaf;
}
@@ -771,7 +771,7 @@ int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
if (valid_block_ip(ip, 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) {
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF) == 0) {
brelse(lbh);
first_ok_leaf = leaf_no;
break;
@@ -1271,7 +1271,7 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next){
bh = osi_list_entry(tmp, struct gfs2_buffer_head,
b_altlist);
- if (gfs2_check_meta(bh, iblk_type)) {
+ if (gfs2_check_meta(bh->b_data, iblk_type)) {
if (pass->invalid_meta_is_fatal)
return meta_error;
@@ -1515,7 +1515,7 @@ static int undo_check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
static int hdr_size(struct gfs2_buffer_head *bh, int height)
{
if (height > 1) {
- if (gfs2_check_meta(bh, GFS2_METATYPE_IN))
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_IN))
return 0;
if (bh->sdp->gfs1)
return sizeof(struct gfs_indirect);
@@ -1523,7 +1523,7 @@ static int hdr_size(struct gfs2_buffer_head *bh, int height)
return sizeof(struct gfs2_meta_header);
}
/* if this isn't really a dinode, skip it */
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI))
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI))
return 0;
return sizeof(struct gfs2_dinode);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 24a6498..22db60d 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -393,7 +393,7 @@ static int check_metalist(struct gfs2_inode *ip, uint64_t block,
}
nbh = bread(ip->i_sbd, block);
- *is_valid = (gfs2_check_meta(nbh, iblk_type) == 0);
+ *is_valid = (gfs2_check_meta(nbh->b_data, iblk_type) == 0);
if (!(*is_valid)) {
log_err( _("Inode %lld (0x%llx) has a bad indirect block "
@@ -519,7 +519,7 @@ static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t block)
/* The bitmap says it's a dinode, but a block reference begs to differ.
So which is it? */
bh = bread(ip->i_sbd, block);
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI) != 0)
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) != 0)
goto out;
/* The meta header agrees it's a dinode. But it might be data in
@@ -747,7 +747,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
handling sort it out. If it isn't, clear it but don't
count it as a duplicate. */
*bh = bread(sdp, indirect);
- if (gfs2_check_meta(*bh, GFS2_METATYPE_IN)) {
+ 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,
@@ -829,7 +829,7 @@ static int check_ealeaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
really is an EA. If it is, let duplicate handling sort it out.
If it isn't, clear it but don't count it as a duplicate. */
leaf_bh = bread(sdp, block);
- if (gfs2_check_meta(leaf_bh, 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,
@@ -1666,7 +1666,7 @@ static int check_system_inode(struct gfs2_sbd *sdp,
" (0x%llx)\n"), filename,
(unsigned long long)iblock,
(unsigned long long)iblock);
- if (gfs2_check_meta((*sysinode)->i_bh, GFS2_METATYPE_DI)) {
+ if (gfs2_check_meta((*sysinode)->i_bh->b_data, GFS2_METATYPE_DI)) {
log_err( _("Found invalid system dinode at block #"
"%llu (0x%llx)\n"),
(unsigned long long)iblock,
@@ -1935,7 +1935,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
bh = bread(sdp, block);
is_inode = 0;
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI) == 0)
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) == 0)
is_inode = 1;
check_magic = ((struct gfs2_meta_header *)
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 763e39a..0a54c9b 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -651,7 +651,7 @@ static int basic_dentry_checks(struct gfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_buffer_head *tbh;
tbh = bread(sdp, entry->no_addr);
- if (gfs2_check_meta(tbh, GFS2_METATYPE_DI)) { /* not dinode */
+ if (gfs2_check_meta(tbh->b_data, GFS2_METATYPE_DI)) { /* not dinode */
log_err( _("Directory entry '%s' pointing to block "
"%llu (0x%llx) in directory %llu (0x%llx) "
"is not really a GFS1 dinode.\n"), tmp_name,
@@ -1600,7 +1600,7 @@ static int check_hash_tbl_dups(struct gfs2_inode *ip, uint64_t *tbl,
continue;
lbh = bread(ip->i_sbd, leafblk);
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF)) { /* Chked later */
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF)) { /* Chked later */
brelse(lbh);
continue;
}
@@ -1794,7 +1794,7 @@ static int check_hash_tbl(struct gfs2_inode *ip, uint64_t *tbl,
proper_len, proper_len);
lbh = bread(ip->i_sbd, leafblk);
gfs2_leaf_in(&leaf, lbh->b_data);
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF) ||
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF) ||
leaf.lf_depth > ip->i_di.di_depth)
leaf.lf_depth = factor;
brelse(lbh);
@@ -1895,7 +1895,7 @@ static int check_data_qc(struct gfs2_inode *ip, uint64_t metablock,
return -1;
bh = bread(ip->i_sbd, block);
- if (gfs2_check_meta(bh, GFS2_METATYPE_QC) != 0) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_QC) != 0) {
log_crit(_("Error: quota_change block at %lld (0x%llx) is "
"the wrong metadata type.\n"),
(unsigned long long)block, (unsigned long long)block);
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index 6234194..d284ab5 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -49,7 +49,7 @@ static int check_block_status(struct gfs2_sbd *sdp, struct gfs2_bmap *bl,
struct gfs2_buffer_head *bh;
bh = bread(sdp, block);
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI) == 0)
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) == 0)
count[GFS2_BLKST_DINODE]++;
else
count[GFS1_BLKST_USEDMETA]++;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 2f14590..ac44efd 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -70,7 +70,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
if (!dblock)
break;
bh = bread(sdp, dblock);
- if (!gfs2_check_meta(bh, GFS2_METATYPE_RG)) {
+ if (!gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG)) {
/* False rgrp found at block dblock */
false_count++;
gfs2_special_set(&false_rgrps, dblock);
@@ -127,7 +127,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
is_rgrp = 0;
else {
bh = bread(sdp, blk);
- is_rgrp = (gfs2_check_meta(bh, GFS2_METATYPE_RG) == 0);
+ is_rgrp = (gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG) == 0);
brelse(bh);
}
if (!is_rgrp) {
@@ -145,7 +145,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
is_rgrp = 0;
} else {
bh = bread(sdp, nblk);
- is_rgrp = (((gfs2_check_meta(bh,
+ is_rgrp = (((gfs2_check_meta(bh->b_data,
GFS2_METATYPE_RG) == 0)));
brelse(bh);
}
@@ -562,7 +562,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
while (blk <= sdp->device.length) {
log_debug( _("Block 0x%llx\n"), (unsigned long long)blk);
bh = bread(sdp, blk);
- rg_was_fnd = (!gfs2_check_meta(bh, GFS2_METATYPE_RG));
+ rg_was_fnd = (!gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG));
brelse(bh);
/* Allocate a new RG and index. */
calc_rgd = rgrp_insert(&sdp->rgcalc, blk);
@@ -594,7 +594,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
for (fwd_block = blk + 1; fwd_block < sdp->device.length; fwd_block++) {
int bitmap_was_fnd;
bh = bread(sdp, fwd_block);
- bitmap_was_fnd = !gfs2_check_meta(bh, GFS2_METATYPE_RB);
+ bitmap_was_fnd = !gfs2_check_meta(bh->b_data, GFS2_METATYPE_RB);
brelse(bh);
if (bitmap_was_fnd) /* if a bitmap */
calc_rgd->ri.ri_length++;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 7e87e43..0acd59b 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -887,7 +887,7 @@ void dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
uint16_t cur_rec_len, prev_rec_len;
bmodified(bh);
- if (gfs2_check_meta(bh, GFS2_METATYPE_LF) == 0) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LF) == 0) {
struct gfs2_leaf *lf = (struct gfs2_leaf *)bh->b_data;
lf->lf_entries = be16_to_cpu(lf->lf_entries) - 1;
@@ -1107,7 +1107,7 @@ int gfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
int error = 0;
*bhp = bread(dip->i_sbd, leaf_no);
- error = gfs2_check_meta(*bhp, GFS2_METATYPE_LF);
+ error = gfs2_check_meta((*bhp)->b_data, GFS2_METATYPE_LF);
if(error)
brelse(*bhp);
return error;
@@ -1159,7 +1159,7 @@ static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
if (*bh_out == NULL)
return -ENOENT;
/* Check for a leaf pointing to a non-leaf */
- if (gfs2_check_meta(*bh_out, GFS2_METATYPE_LF)) {
+ if (gfs2_check_meta((*bh_out)->b_data, GFS2_METATYPE_LF)) {
brelse(*bh_out);
*bh_out = NULL;
return -ENOENT;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index f75ff1e..fc0afed 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -699,7 +699,7 @@ extern int build_quota(struct gfs2_sbd *sdp);
extern int build_root(struct gfs2_sbd *sdp);
extern int do_init_inum(struct gfs2_sbd *sdp);
extern int do_init_statfs(struct gfs2_sbd *sdp);
-extern int gfs2_check_meta(struct gfs2_buffer_head *bh, int type);
+extern int gfs2_check_meta(const char *buf, int type);
extern unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx,
uint64_t *buf, uint8_t state);
extern int build_inum_range(struct gfs2_inode *per_node, unsigned int j);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 20ce580..bd69301 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -221,7 +221,7 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
int mtype = (x ? GFS2_METATYPE_RB : GFS2_METATYPE_RG);
bi->bi_bh = bhs[x];
- if (gfs2_check_meta(bi->bi_bh, mtype)) {
+ if (gfs2_check_meta(bi->bi_bh->b_data, mtype)) {
unsigned err = x;
do {
brelse(rgd->bits[x].bi_bh);
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index c84701d..b00c2a9 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -648,10 +648,10 @@ int do_init_statfs(struct gfs2_sbd *sdp)
return 0;
}
-int gfs2_check_meta(struct gfs2_buffer_head *bh, int type)
+int gfs2_check_meta(const char *buf, int type)
{
- uint32_t check_magic = ((struct gfs2_meta_header *)(bh->b_data))->mh_magic;
- uint32_t check_type = ((struct gfs2_meta_header *)(bh->b_data))->mh_type;
+ uint32_t check_magic = ((struct gfs2_meta_header *)buf)->mh_magic;
+ uint32_t check_type = ((struct gfs2_meta_header *)buf)->mh_type;
check_magic = be32_to_cpu(check_magic);
check_type = be32_to_cpu(check_type);
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 7592564..6fe29ad 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -181,7 +181,7 @@ static int good_on_disk(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
int is_rgrp;
bh = bread(sdp, rgd->ri.ri_addr);
- is_rgrp = (gfs2_check_meta(bh, GFS2_METATYPE_RG) == 0);
+ is_rgrp = (gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG) == 0);
brelse(bh);
return is_rgrp;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.