diff options
author | Yongqiang Yang <xiaoqiangnk@gmail.com> | 2011-07-26 21:51:08 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-07-26 21:51:08 -0400 |
commit | 4740b830ed5720ade6c780dbf3fdfe9089b3552d (patch) | |
tree | 7236a6b16db7d3cf8ef8cf5a6d86dac85df01b01 /fs/ext4/mballoc.c | |
parent | cc7365dfe48cb2191f1572bf69e30d3e58716313 (diff) |
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>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index dbe429567eb..b6ef4da39ce 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -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 |