diff options
author | Kazuya Mio <k-mio@sx.jp.nec.com> | 2012-01-30 03:41:25 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2012-02-29 15:53:46 -0500 |
commit | 053800a84b942511054b51299db4430b3d1b06bc (patch) | |
tree | 8fd6dad627d82b8db442bf15f3c15a2e0f8d2927 /fs/ext3 | |
parent | 75b09e022fc22d675c726c94b1b73f5d08dafdf6 (diff) |
ext3: Don't call dquot_free_block() if we don't update anything
dquot_free_block() is called in the end of ext3_new_blocks() and updates
information of the inode structure. However, this update is not necessary
if the number of blocks we requested is equal to the number of
allocated blocks.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/balloc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index a2038928f9a3..954a7d355f59 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
@@ -1743,8 +1743,11 @@ allocated: | |||
1743 | 1743 | ||
1744 | *errp = 0; | 1744 | *errp = 0; |
1745 | brelse(bitmap_bh); | 1745 | brelse(bitmap_bh); |
1746 | dquot_free_block(inode, *count-num); | 1746 | |
1747 | *count = num; | 1747 | if (num < *count) { |
1748 | dquot_free_block(inode, *count-num); | ||
1749 | *count = num; | ||
1750 | } | ||
1748 | 1751 | ||
1749 | trace_ext3_allocate_blocks(inode, goal, num, | 1752 | trace_ext3_allocate_blocks(inode, goal, num, |
1750 | (unsigned long long)ret_block); | 1753 | (unsigned long long)ret_block); |