Commit b25958b6 authored by Haicheng Li's avatar Haicheng Li Committed by Jaegeuk Kim

f2fs: optimize do_write_data_page()

Since "need_inplace_update() == true" is a very rare case, using unlikely()
to give compiler a chance to optimize the code.
Signed-off-by: default avatarHaicheng Li <haicheng.li@linux.intel.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 8d8451af
...@@ -497,8 +497,9 @@ int do_write_data_page(struct page *page) ...@@ -497,8 +497,9 @@ int do_write_data_page(struct page *page)
* If current allocation needs SSR, * If current allocation needs SSR,
* it had better in-place writes for updated data. * it had better in-place writes for updated data.
*/ */
if (old_blk_addr != NEW_ADDR && !is_cold_data(page) && if (unlikely(old_blk_addr != NEW_ADDR &&
need_inplace_update(inode)) { !is_cold_data(page) &&
need_inplace_update(inode))) {
rewrite_data_page(F2FS_SB(inode->i_sb), page, rewrite_data_page(F2FS_SB(inode->i_sb), page,
old_blk_addr); old_blk_addr);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment