mirror of https://github.com/vitalif/e2fsprogs
e2fsck: during pass1b delete_file, only free a cluster once
If we're forced to delete a crosslinked file, only call ext2fs_block_alloc_stats2() on cluster boundaries, since the block bitmaps are all cluster bitmaps at this point. It's safe to do this only once per cluster since we know all the blocks are going away. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>test-maint
parent
9a1d614df2
commit
8dd650ab9a
|
@ -625,7 +625,8 @@ static int delete_file_block(ext2_filsys fs,
|
|||
_("internal error: can't find dup_blk for %llu\n"),
|
||||
*block_nr);
|
||||
} else {
|
||||
ext2fs_block_alloc_stats2(fs, *block_nr, -1);
|
||||
if ((*block_nr % EXT2FS_CLUSTER_RATIO(ctx->fs)) == 0)
|
||||
ext2fs_block_alloc_stats2(fs, *block_nr, -1);
|
||||
pb->dup_blocks++;
|
||||
}
|
||||
pb->cur_cluster = lc;
|
||||
|
|
|
@ -1171,7 +1171,8 @@ static int deallocate_inode_block(ext2_filsys fs,
|
|||
if ((*block_nr < fs->super->s_first_data_block) ||
|
||||
(*block_nr >= ext2fs_blocks_count(fs->super)))
|
||||
return 0;
|
||||
ext2fs_block_alloc_stats2(fs, *block_nr, -1);
|
||||
if ((*block_nr % EXT2FS_CLUSTER_RATIO(fs)) == 0)
|
||||
ext2fs_block_alloc_stats2(fs, *block_nr, -1);
|
||||
p->num++;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue