From e633b58ac75f2f544b7d6572e37d4b63da31e59c Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Sun, 25 Oct 2009 21:41:32 -0400 Subject: libext2fs: clean up ext2fs_bg_flags_ interfaces The ext2fs_bg_flag* functions were confusing. Currently we have this: void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags); void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group,__u16 bg_flags); (_set (unused) sets exactly bg_flags; _clear clears all and ignores bg_flags) and these, which can twiddle individual bits in bg_flags: void ext2fs_bg_flag_set(ext2_filsys fs, dgrp_t group, __u16 bg_flag); void ext2fs_bg_flag_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flag); A better interface, after the patch below, is just: ext2fs_bg_flags_zap(fs, group) /* zeros bg_flags */ ext2fs_bg_flags_set(fs, group, flags) /* adds flags to bg_flags */ ext2fs_bg_flags_clear(fs, group, flags) /* clears flags in bg_flags */ and remove the original ext2fs_bg_flags_set / ext2fs_bg_flags_clear. Signed-off-by: Eric Sandeen Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/alloc_tables.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/ext2fs/alloc_tables.c') diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c index 94aeedae..8141ec34 100644 --- a/lib/ext2fs/alloc_tables.c +++ b/lib/ext2fs/alloc_tables.c @@ -143,7 +143,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, dgrp_t gr = ext2fs_group_of_blk(fs, new_blk); fs->group_desc[gr].bg_free_blocks_count--; ext2fs_free_blocks_count_add(fs->super, -1); - ext2fs_bg_flag_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); + ext2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); ext2fs_group_desc_csum_set(fs, gr); } } @@ -171,7 +171,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, dgrp_t gr = ext2fs_group_of_blk(fs, new_blk); fs->group_desc[gr].bg_free_blocks_count--; ext2fs_free_blocks_count_add(fs->super, -1); - ext2fs_bg_flag_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); + ext2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); ext2fs_group_desc_csum_set(fs, gr); } } @@ -205,7 +205,7 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, dgrp_t gr = ext2fs_group_of_blk(fs, blk); fs->group_desc[gr].bg_free_blocks_count--; ext2fs_free_blocks_count_add(fs->super, -1); - ext2fs_bg_flag_clear(fs, gr, + ext2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT); ext2fs_group_desc_csum_set(fs, gr); } -- cgit v1.2.3