* Copyright (C) 1994, 1995, 1996, 2003 Theodore Ts'o.
*
* %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
* %End-Header%
*/
+#include "config.h"
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
if (super_blk || (group == 0))
ext2fs_mark_block_bitmap2(bmap, super_blk);
+ if ((group == 0) && (fs->blocksize == 1024) &&
+ EXT2FS_CLUSTER_RATIO(fs) > 1)
+ ext2fs_mark_block_bitmap2(bmap, 0);
if (old_desc_blk) {
if (fs->super->s_reserved_gdt_blocks && fs->block_map == bmap)
- ext2fs_bg_flag_clear(fs, group, EXT2_BG_BLOCK_UNINIT);
+ ext2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);
for (j=0; j < old_desc_blocks; j++)
if (old_desc_blk + j < ext2fs_blocks_count(fs->super))
ext2fs_mark_block_bitmap2(bmap,
if (new_desc_blk)
ext2fs_mark_block_bitmap2(bmap, new_desc_blk);
- if (group == fs->group_desc_count-1) {
- num_blocks = (ext2fs_blocks_count(fs->super) -
- fs->super->s_first_data_block) %
- fs->super->s_blocks_per_group;
- if (!num_blocks)
- num_blocks = fs->super->s_blocks_per_group;
- } else
- num_blocks = fs->super->s_blocks_per_group;
-
+ num_blocks = ext2fs_group_blocks_count(fs, group);
num_blocks -= 2 + fs->inode_blocks_per_group + used_blks;
return num_blocks ;