Skip to content

Commit 4740b83

Browse files
xiaoqiangnktytso
authored andcommitted
ext4: let ext4_group_add_blocks() handle 0 blocks quickly
If ext4_group_add_blocks() is called with 0 block, make it return 0 without doing any extra work. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent cc7365d commit 4740b83

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎fs/ext4/mballoc.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,6 +4691,9 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,
46914691

46924692
ext4_debug("Adding block(s) %llu-%llu\n", block, block + count - 1);
46934693

4694+
if (count == 0)
4695+
return 0;
4696+
46944697
ext4_get_group_no_and_offset(sb, block, &block_group, &bit);
46954698
/*
46964699
* Check to see if we are freeing blocks across a group

0 commit comments

Comments
 (0)