summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2013-06-08 21:25:40 +0900
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-06-14 09:04:42 +0900
commitd7cc950b4c910e4440485be784493880a0d09086 (patch)
treead61daad74fa7f6fd0153cf9597bfc8b2e0710b4 /fs/nfs/pnfs.h
parent6a3e8ef0de1e548d1cf9bcf51d9b7b6f4141fec5 (diff)
f2fs: optimise the truncate_data_blocks_range() range
The function truncate_data_blocks_range() decrements the valid block count of inode via dec_valid_block_count(). Since this function updates the i_blocks field of inode, we can update this field once we have calculated total the number of blocks to be freed. Therefore we can decrement valid blocks outside of the for loop. if (nr_free) { + dec_valid_block_count(sbi, dn->inode, nr_free); set_page_dirty(dn->node_page); sync_inode_page(dn); } 'nr_free' tells the total number of blocks freed. So, we can just directly pass this value to dec_valid_block_count() and update the i_blocks. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Pankaj Kumar <pankaj.km@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
0 files changed, 0 insertions, 0 deletions