From: Yongqiang Yang Date: Wed, 27 Jul 2011 01:51:08 +0000 (-0400) Subject: ext4: let ext4_group_add_blocks() handle 0 blocks quickly X-Git-Tag: next-20110728~53^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4da9abb384e6a62613d49a4c1d2b481e8b217def;p=karo-tx-linux.git 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 Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index dbe429567eb3..b6ef4da39ce3 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