]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: teach ext2fs_block_alloc_stats2() about bigalloc
authorTheodore Ts'o <tytso@mit.edu>
Thu, 7 Jul 2011 17:54:39 +0000 (13:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 7 Jul 2011 18:21:12 +0000 (14:21 -0400)
Change ext2fs_block_alloc_stats2() so that when a cluster is
allocated, the free blocks counter in the superblock is appropriately
decremented by the cluster size.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/alloc_stats.c

index 0f276659389dea59dfec02c62c1c26b06f308339..9a6697e0b4b2b58330adffafe8869be819cbe77e 100644 (file)
@@ -77,7 +77,8 @@ void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse)
        ext2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);
        ext2fs_group_desc_csum_set(fs, group);
 
-       ext2fs_free_blocks_count_add(fs->super, -inuse);
+       ext2fs_free_blocks_count_add(fs->super,
+                                    -inuse * EXT2FS_CLUSTER_RATIO(fs));
        ext2fs_mark_super_dirty(fs);
        ext2fs_mark_bb_dirty(fs);
        if (fs->block_alloc_stats)