Skip to content

Commit

Permalink
ext4: let ext4_group_add_blocks() handle 0 blocks quickly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yongqiang Yang authored and Theodore Ts'o committed Jul 27, 2011
1 parent cc7365d commit 4740b83
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4691,6 +4691,9 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,

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

if (count == 0)
return 0;

ext4_get_group_no_and_offset(sb, block, &block_group, &bit);
/*
* Check to see if we are freeing blocks across a group
Expand Down

0 comments on commit 4740b83

Please sign in to comment.