Whamcloud - gitweb
libext2fs: Convert ext2fs_bg_flag_test() to ext2fs_bg_flags_test()
authorTheodore Ts'o <tytso@mit.edu>
Mon, 26 Oct 2009 01:42:12 +0000 (21:42 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 26 Oct 2009 01:42:12 +0000 (21:42 -0400)
After cleaning up ext2fs_bg_flag_set() and ext2fs_bg_flag_clear(),
we're left with ext2fs_bg_flag_test().  Convert it to
ext2fs_bg_flags_test().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/debugfs.c
e2fsck/pass2.c
e2fsck/pass5.c
e2fsck/super.c
lib/ext2fs/alloc.c
lib/ext2fs/blknum.c
lib/ext2fs/ext2fs.h
lib/ext2fs/inode.c
lib/ext2fs/rw_bitmaps.c
resize/resize2fs.c

index e3fb5f3..8e0dc55 100644 (file)
@@ -293,7 +293,7 @@ static void print_features(struct ext2_super_block * s, FILE *f)
 static void print_bg_opts(ext2_filsys fs, dgrp_t group, int mask,
                          const char *str, int *first, FILE *f)
 {
-       if (ext2fs_bg_flag_test(fs, group, mask)) {
+       if (ext2fs_bg_flags_test(fs, group, mask)) {
                if (*first) {
                        fputs("           [", f);
                        *first = 0;
index d45ff74..cbf1457 100644 (file)
@@ -987,7 +987,7 @@ out_htree:
                 * we could call a function in pass1.c that checks the
                 * newly visible inodes.
                 */
-               if (ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT)) {
+               if (ext2fs_bg_flags_test(fs, group, EXT2_BG_INODE_UNINIT)) {
                        pctx.num = dirent->inode;
                        if (fix_problem(ctx, PR_2_INOREF_BG_INO_UNINIT,
                                        &cd->pctx)){
index aee4e5f..ef8e141 100644 (file)
@@ -162,7 +162,7 @@ redo_counts:
        save_problem = 0;
        pctx.blk = pctx.blk2 = NO_BLK;
        if (csum_flag &&
-           (ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT)))
+           (ext2fs_bg_flags_test(fs, group, EXT2_BG_BLOCK_UNINIT)))
                skip_group++;
        for (i = fs->super->s_first_data_block;
             i < ext2fs_blocks_count(fs->super);
@@ -300,7 +300,7 @@ redo_counts:
                                        goto errout;
                        if (csum_flag &&
                            (i != ext2fs_blocks_count(fs->super)-1) &&
-                           ext2fs_bg_flag_test(fs, group, 
+                           ext2fs_bg_flags_test(fs, group, 
                                                EXT2_BG_BLOCK_UNINIT))
                                skip_group++;
                }
@@ -423,7 +423,7 @@ redo_counts:
        save_problem = 0;
        pctx.ino = pctx.ino2 = 0;
        if (csum_flag &&
-           (ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT)))
+           (ext2fs_bg_flags_test(fs, group, EXT2_BG_INODE_UNINIT)))
                skip_group++;
 
        /* Protect loop from wrap-around if inodes_count is maxed */
@@ -526,7 +526,7 @@ do_counts:
                                        goto errout;
                        if (csum_flag &&
                            (i != fs->super->s_inodes_count) &&
-                           (ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT)
+                           (ext2fs_bg_flags_test(fs, group, EXT2_BG_INODE_UNINIT)
                             ))
                                skip_group++;
                }
index b10539a..fbc8b8a 100644 (file)
@@ -647,8 +647,8 @@ void check_super_block(e2fsck_t ctx)
                }
 
                if (!csum_flag &&
-                   (ext2fs_bg_flag_test(fs, i, EXT2_BG_BLOCK_UNINIT) ||
-                    ext2fs_bg_flag_test(fs, i, EXT2_BG_INODE_UNINIT) ||
+                   (ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT) ||
+                    ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT) ||
                     gd->bg_itable_unused != 0)){
                        if (fix_problem(ctx, PR_0_GDT_UNINIT, &pctx)) {
                                ext2fs_bg_flags_clear(fs, i, EXT2_BG_BLOCK_UNINIT);
@@ -660,7 +660,7 @@ void check_super_block(e2fsck_t ctx)
                }
 
                if (i == fs->group_desc_count - 1 &&
-                   ext2fs_bg_flag_test(fs, i, EXT2_BG_BLOCK_UNINIT)) {
+                   ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT)) {
                        if (fix_problem(ctx, PR_0_BB_UNINIT_LAST, &pctx)) {
                                ext2fs_bg_flags_clear(fs, i, EXT2_BG_BLOCK_UNINIT);
                                should_be = 1;
@@ -668,8 +668,8 @@ void check_super_block(e2fsck_t ctx)
                        ext2fs_unmark_valid(fs);
                }
 
-               if (ext2fs_bg_flag_test(fs, i, EXT2_BG_BLOCK_UNINIT) &&
-                   !ext2fs_bg_flag_test(fs, i, EXT2_BG_INODE_UNINIT)) {
+               if (ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT) &&
+                   !ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT)) {
                        if (fix_problem(ctx, PR_0_BB_UNINIT_IB_INIT, &pctx)) {
                                ext2fs_bg_flags_clear(fs, i, EXT2_BG_BLOCK_UNINIT);
                                should_be = 1;
index a711d45..932103d 100644 (file)
@@ -38,7 +38,7 @@ static void check_block_uninit(ext2_filsys fs, ext2fs_block_bitmap map,
 
        if (!(EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
                                         EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) ||
-           !(ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT)))
+           !(ext2fs_bg_flags_test(fs, group, EXT2_BG_BLOCK_UNINIT)))
                return;
 
        blk = (group * fs->super->s_blocks_per_group) +
@@ -82,7 +82,7 @@ static void check_inode_uninit(ext2_filsys fs, ext2fs_inode_bitmap map,
 
        if (!(EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
                                         EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) ||
-           !(ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT)))
+           !(ext2fs_bg_flags_test(fs, group, EXT2_BG_INODE_UNINIT)))
                return;
 
        ino = (group * fs->super->s_inodes_per_group) + 1;
index 6ebe47e..83f43cf 100644 (file)
@@ -439,7 +439,7 @@ void ext2fs_bg_flags_zap(ext2_filsys fs, dgrp_t group)
 /*
  * Get the value of a particular flag for this block group
  */
-int ext2fs_bg_flag_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag)
+int ext2fs_bg_flags_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag)
 {
        if (fs->super->s_desc_size >= EXT2_MIN_DESC_SIZE_64BIT) {
                struct ext4_group_desc *gdp;
index eb655b5..2112a68 100644 (file)
@@ -763,7 +763,7 @@ extern void ext2fs_bg_itable_unused_set(ext2_filsys fs, dgrp_t group,
                                     __u32 n);
 extern __u16 ext2fs_bg_flags(ext2_filsys fs, dgrp_t group);
 extern void ext2fs_bg_flags_zap(ext2_filsys fs, dgrp_t group);
-extern int ext2fs_bg_flag_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag);
+extern int ext2fs_bg_flags_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag);
 extern void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags);
 extern void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flags);
 extern __u16 ext2fs_bg_checksum(ext2_filsys fs, dgrp_t group);
index e439b1c..6e3adbc 100644 (file)
@@ -435,7 +435,7 @@ errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan, ext2_ino_t *ino,
         * they can be done for block group #0.
         */
        if ((scan->scan_flags & EXT2_SF_DO_LAZY) &&
-           (ext2fs_bg_flag_test(scan->fs, scan->current_group, EXT2_BG_INODE_UNINIT)
+           (ext2fs_bg_flags_test(scan->fs, scan->current_group, EXT2_BG_INODE_UNINIT)
             ))
                goto force_new_group;
        if (scan->inodes_left == 0)
index 7878be6..f85473a 100644 (file)
@@ -70,7 +70,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                if (!do_block)
                        goto skip_block_bitmap;
 
-               if (csum_flag && ext2fs_bg_flag_test(fs, i, EXT2_BG_BLOCK_UNINIT)
+               if (csum_flag && ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT)
                    )
                        goto skip_this_block_bitmap;
 
@@ -102,7 +102,7 @@ static errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                if (!do_inode)
                        continue;
 
-               if (csum_flag && ext2fs_bg_flag_test(fs, i, EXT2_BG_INODE_UNINIT)
+               if (csum_flag && ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT)
                    )
                        goto skip_this_inode_bitmap;
 
@@ -237,7 +237,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                if (block_bitmap) {
                        blk = fs->group_desc[i].bg_block_bitmap;
                        if (csum_flag &&
-                           ext2fs_bg_flag_test(fs, i, EXT2_BG_BLOCK_UNINIT) &&
+                           ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT) &&
                            ext2fs_group_desc_csum_verify(fs, i))
                                blk = 0;
                        if (blk) {
@@ -259,7 +259,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
                if (inode_bitmap) {
                        blk = fs->group_desc[i].bg_inode_bitmap;
                        if (csum_flag &&
-                           ext2fs_bg_flag_test(fs, i, EXT2_BG_INODE_UNINIT) &&
+                           ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT) &&
                            ext2fs_group_desc_csum_verify(fs, i))
                                blk = 0;
                        if (blk) {
index 869ae62..538c7b7 100644 (file)
@@ -199,7 +199,7 @@ static void fix_uninit_block_bitmaps(ext2_filsys fs)
                return;
 
        for (g=0; g < fs->group_desc_count; g++) {
-               if (!(ext2fs_bg_flag_test(fs, g, EXT2_BG_BLOCK_UNINIT)))
+               if (!(ext2fs_bg_flags_test(fs, g, EXT2_BG_BLOCK_UNINIT)))
                        continue;
 
                blk = (g * fs->super->s_blocks_per_group) +
@@ -755,7 +755,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) &&
-                  (ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT))) {
+                  (ext2fs_bg_flags_test(fs, group, EXT2_BG_BLOCK_UNINIT))) {
                /*
                 * If the block bitmap is uninitialized, which means
                 * nothing other than standard metadata in use.
@@ -816,7 +816,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) &&
-                   ext2fs_bg_flag_test(old_fs, g, EXT2_BG_BLOCK_UNINIT)) {
+                   ext2fs_bg_flags_test(old_fs, g, EXT2_BG_BLOCK_UNINIT)) {
                        /*
                         * The block bitmap is uninitialized, so skip
                         * to the next block group.
@@ -1791,7 +1791,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
        /*
         * First calculate the block statistics
         */
-       uninit = ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT);
+       uninit = ext2fs_bg_flags_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)
@@ -1825,7 +1825,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
                        group++;
                        count = 0;
                        group_free = 0;
-                       uninit = (ext2fs_bg_flag_test(fs, group, EXT2_BG_BLOCK_UNINIT)
+                       uninit = (ext2fs_bg_flags_test(fs, group, EXT2_BG_BLOCK_UNINIT)
                                  );
                        ext2fs_super_and_bgd_loc(fs, group, &super_blk,
                                                 &old_desc_blk,
@@ -1849,7 +1849,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
        group = 0;
 
        /* Protect loop from wrap-around if s_inodes_count maxed */
-       uninit = ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT);
+       uninit = ext2fs_bg_flags_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)) {
@@ -1865,8 +1865,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs)
                        group++;
                        count = 0;
                        group_free = 0;
-                       uninit = (ext2fs_bg_flag_test(fs, group, EXT2_BG_INODE_UNINIT)
-                                 );
+                       uninit = ext2fs_bg_flags_test(fs, group, EXT2_BG_INODE_UNINIT);
                }
        }
        fs->super->s_free_inodes_count = total_free;