Skip to content

Commit

Permalink
udf: Call udf_add_free_space() for more blocks at once in udf_free_bl…
Browse files Browse the repository at this point in the history
…ocks()

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 <jack@suse.cz>
  • Loading branch information
Jan Kara committed Jan 6, 2011
1 parent 0484b1c commit 7abc2e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/udf/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7abc2e4

Please sign in to comment.