diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-07-07 13:54:39 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-07-07 14:21:12 -0400 |
commit | b98d3e8fadf32cc34b8231089a4da0a225697545 (patch) | |
tree | 09d436206b6fcadc103a258dca7f86a6a9d9f32c /lib | |
parent | c4d2d43e2dc831d5c209af3e42dffd7b5e65c1f6 (diff) | |
download | e2fsprogs-b98d3e8fadf32cc34b8231089a4da0a225697545.tar.gz |
libext2fs: teach ext2fs_block_alloc_stats2() about bigalloc
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ext2fs/alloc_stats.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ext2fs/alloc_stats.c b/lib/ext2fs/alloc_stats.c index 0f276659..9a6697e0 100644 --- a/lib/ext2fs/alloc_stats.c +++ b/lib/ext2fs/alloc_stats.c @@ -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) |