From: Jan Kara Date: Wed, 20 Oct 2010 20:32:02 +0000 (+0200) Subject: udf: Call udf_add_free_space() for more blocks at once in udf_free_blocks() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=7abc2e45e48ca04206949682402d5d55bc64a16b;p=deliverable%2Flinux.git udf: Call udf_add_free_space() for more blocks at once in udf_free_blocks() There's no need to call udf_add_free_space() for one block at a time. It saves us noticeable amount of work and yields different result from the original code only if the filesystem is corrupted and bitmap bit is already cleared. In such case counter of free blocks is probably wrong anyways so the change does not matter. Signed-off-by: Jan Kara --- diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index b608efaa4cee..306ee39ef2c3 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -157,10 +157,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb, udf_debug("bit %ld already set\n", bit + i); udf_debug("byte=%2x\n", ((char *)bh->b_data)[(bit + i) >> 3]); - } else { - udf_add_free_space(sb, sbi->s_partition, 1); } } + udf_add_free_space(sb, sbi->s_partition, count); mark_buffer_dirty(bh); if (overflow) { block += count;