aboutsummaryrefslogtreecommitdiffstats
path: root/resize
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-09-07 21:15:12 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-09-07 21:15:12 -0400
commit732c8cd58ff30ffae0d3276c411a08920717a46c (patch)
treede130d62127f09d3c8a975d3b5b7fd2875209afa /resize
parent24a117abd0340d247befbf7687ffb70547fdf218 (diff)
downloade2fsprogs-732c8cd58ff30ffae0d3276c411a08920717a46c.tar.gz
Use accessor functions fields for bg_flags in the block group descriptors
Signed-off-by: Valerie Aurora Henson <vaurora@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'resize')
-rw-r--r--resize/resize2fs.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 2e971771a..dc3500135 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -112,8 +112,8 @@ errcode_t resize_fs(ext2_filsys fs, blk_t *new_size, int flags,
fix_uninit_block_bitmaps(rfs->new_fs);
/* Clear the block bitmap uninit flag for the last block group */
- rfs->new_fs->group_desc[rfs->new_fs->group_desc_count-1].bg_flags &=
- ~EXT2_BG_BLOCK_UNINIT;
+ ext2fs_bg_flag_clear(rfs->new_fs, rfs->new_fs->group_desc_count - 1,
+ EXT2_BG_BLOCK_UNINIT);
*new_size = rfs->new_fs->super->s_blocks_count;
@@ -199,7 +199,7 @@ static void fix_uninit_block_bitmaps(ext2_filsys fs)
return;
for (g=0; g < fs->group_desc_count; g++) {
- if (!(fs->group_desc[g].bg_flags & EXT2_BG_BLOCK_UNINIT))
+ if (!(ext2fs_bg_flag_test(fs, g, EXT2_BG_BLOCK_UNINIT)))
continue;
blk = (g * fs->super->s_blocks_per_group) +
@@ -495,10 +495,10 @@ retry:
sizeof(struct ext2_group_desc));
adjblocks = 0;
- fs->group_desc[i].bg_flags = 0;
+ ext2fs_bg_flags_clear(fs, i, 0);
if (csum_flag)
- fs->group_desc[i].bg_flags |= EXT2_BG_INODE_UNINIT |
- EXT2_BG_INODE_ZEROED;
+ ext2fs_bg_flag_set(fs, i, EXT2_BG_INODE_UNINIT | EXT2_BG_INODE_ZEROED)
+ ;
if (i == fs->group_desc_count-1) {
numblocks = (fs->super->s_blocks_count -
fs->super->s_first_data_block) %
@@ -508,8 +508,8 @@ retry:
} else {
numblocks = fs->super->s_blocks_per_group;
if (csum_flag)
- fs->group_desc[i].bg_flags |=
- EXT2_BG_BLOCK_UNINIT;
+ ext2fs_bg_flag_set(fs, i, EXT2_BG_BLOCK_UNINIT)
+ ;
}
has_super = ext2fs_bg_has_super(fs, i);
@@ -751,7 +751,7 @@ static void mark_fs_metablock(ext2_resize_t rfs,
rfs->needed_blocks++;
} else if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
- (fs->group_desc[group].bg_flags & EXT2_BG_BLOCK_UNINIT)) {
+ (ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT))) {
/*
* If the block bitmap is uninitialized, which means
* nothing other than standard metadata in use.
@@ -812,7 +812,7 @@ static errcode_t blocks_to_move(ext2_resize_t rfs)
g = ext2fs_group_of_blk(fs, blk);
if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
- (old_fs->group_desc[g].bg_flags & EXT2_BG_BLOCK_UNINIT)) {
+ ext2fs_bg_flag_test(old_fs, g, EXT2_BG_BLOCK_UNINIT)) {
/*
* The block bitmap is uninitialized, so skip
* to the next block group.
@@ -1787,7 +1787,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
/*
* First calculate the block statistics
*/
- uninit = fs->group_desc[group].bg_flags & EXT2_BG_BLOCK_UNINIT;
+ uninit = ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT);
ext2fs_super_and_bgd_loc(fs, group, &super_blk, &old_desc_blk,
&new_desc_blk, 0);
if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
@@ -1821,8 +1821,8 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
group++;
count = 0;
group_free = 0;
- uninit = (fs->group_desc[group].bg_flags &
- EXT2_BG_BLOCK_UNINIT);
+ uninit = (ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT)
+ );
ext2fs_super_and_bgd_loc(fs, group, &super_blk,
&old_desc_blk,
&new_desc_blk, 0);
@@ -1845,7 +1845,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
group = 0;
/* Protect loop from wrap-around if s_inodes_count maxed */
- uninit = fs->group_desc[group].bg_flags & EXT2_BG_INODE_UNINIT;
+ uninit = ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT);
for (ino = 1; ino <= fs->super->s_inodes_count && ino > 0; ino++) {
if (uninit ||
!ext2fs_fast_test_inode_bitmap2(fs->inode_map, ino)) {
@@ -1861,8 +1861,8 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
group++;
count = 0;
group_free = 0;
- uninit = (fs->group_desc[group].bg_flags &
- EXT2_BG_INODE_UNINIT);
+ uninit = (ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT)
+ );
}
}
fs->super->s_free_inodes_count = total_free;