From 6493f8e85defc568a4ca8cdb4a53361f36fb94ba Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 25 Oct 2009 20:50:15 -0400 Subject: [PATCH] Convert ext2fs_group_of_blk() to ext2fs_group_of_blk2() Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/alloc_tables.c | 6 +++--- lib/ext2fs/mkjournal.c | 2 +- misc/mke2fs.c | 2 +- misc/tune2fs.c | 2 +- resize/resize2fs.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c index 696829f..e104abc 100644 --- a/lib/ext2fs/alloc_tables.c +++ b/lib/ext2fs/alloc_tables.c @@ -140,7 +140,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, ext2fs_mark_block_bitmap2(bmap, new_blk); ext2fs_block_bitmap_loc_set(fs, group, new_blk); if (flexbg_size) { - dgrp_t gr = ext2fs_group_of_blk(fs, new_blk); + dgrp_t gr = ext2fs_group_of_blk2(fs, new_blk); ext2fs_bg_free_blocks_count_set(fs, gr, ext2fs_bg_free_blocks_count(fs, gr) - 1); ext2fs_free_blocks_count_add(fs->super, -1); ext2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); @@ -168,7 +168,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, ext2fs_mark_block_bitmap2(bmap, new_blk); ext2fs_inode_bitmap_loc_set(fs, group, new_blk); if (flexbg_size) { - dgrp_t gr = ext2fs_group_of_blk(fs, new_blk); + dgrp_t gr = ext2fs_group_of_blk2(fs, new_blk); ext2fs_bg_free_blocks_count_set(fs, gr, ext2fs_bg_free_blocks_count(fs, gr) - 1); ext2fs_free_blocks_count_add(fs->super, -1); ext2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); @@ -202,7 +202,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, j++, blk++) { ext2fs_mark_block_bitmap2(bmap, blk); if (flexbg_size) { - dgrp_t gr = ext2fs_group_of_blk(fs, blk); + dgrp_t gr = ext2fs_group_of_blk2(fs, blk); ext2fs_bg_free_blocks_count_set(fs, gr, ext2fs_bg_free_blocks_count(fs, gr) - 1); ext2fs_free_blocks_count_add(fs->super, -1); ext2fs_bg_flags_clear(fs, gr, diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 8d5bf01..6afbbde 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -321,7 +321,7 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino, * the filesystem. Pick a group that has the largest number * of free blocks. */ - group = ext2fs_group_of_blk(fs, (ext2fs_blocks_count(fs->super) - + group = ext2fs_group_of_blk2(fs, (ext2fs_blocks_count(fs->super) - fs->super->s_first_data_block) / 2); log_flex = 1 << fs->super->s_log_groups_per_flex; if (fs->super->s_log_groups_per_flex && (group > log_flex)) { diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 4fb6dfe..1559368 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -273,7 +273,7 @@ _("Warning: the backup superblock/group descriptors at block %u contain\n" " bad blocks.\n\n"), group_block); group_bad++; - group = ext2fs_group_of_blk(fs, group_block+j); + group = ext2fs_group_of_blk2(fs, group_block+j); ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group) + 1); ext2fs_group_desc_csum_set(fs, group); ext2fs_free_blocks_count_add(fs->super, 1); diff --git a/misc/tune2fs.c b/misc/tune2fs.c index df3c0cb..70bc75e 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -260,7 +260,7 @@ static int release_blocks_proc(ext2_filsys fs, blk_t *blocknr, block = *blocknr; ext2fs_unmark_block_bitmap2(fs->block_map, block); - group = ext2fs_group_of_blk(fs, block); + group = ext2fs_group_of_blk2(fs, block); ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group) + 1); ext2fs_group_desc_csum_set(fs, group); ext2fs_free_blocks_count_add(fs->super, 1); diff --git a/resize/resize2fs.c b/resize/resize2fs.c index 76aa51f..b1e1e47 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -810,7 +810,7 @@ static errcode_t blocks_to_move(ext2_resize_t rfs) */ for (blk = ext2fs_blocks_count(fs->super); blk < ext2fs_blocks_count(old_fs->super); blk++) { - g = ext2fs_group_of_blk(fs, blk); + g = ext2fs_group_of_blk2(fs, blk); if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, EXT4_FEATURE_RO_COMPAT_GDT_CSUM) && ext2fs_bg_flags_test(old_fs, g, EXT2_BG_BLOCK_UNINIT)) { -- 1.8.3.1