diff options
author | Haicheng Li <haicheng.li@linux.intel.com> | 2013-06-13 16:59:29 +0800 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-06-05 21:20:29 +0200 |
commit | 34eaf6bec420bd64a9241c5954e18d0ce8fb69e1 (patch) | |
tree | c172629e764cde447b6b1a7defbf5fccf840624a /fs/f2fs | |
parent | b9e2f6b68ef7b3b9d525238d3f588d7babb76ff2 (diff) | |
download | kernel_samsung_espresso10-34eaf6bec420bd64a9241c5954e18d0ce8fb69e1.zip kernel_samsung_espresso10-34eaf6bec420bd64a9241c5954e18d0ce8fb69e1.tar.gz kernel_samsung_espresso10-34eaf6bec420bd64a9241c5954e18d0ce8fb69e1.tar.bz2 |
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: Haicheng Li <haicheng.li@linux.intel.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8e45e70..f7189aa 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -496,8 +496,9 @@ int do_write_data_page(struct page *page) * If current allocation needs SSR, * it had better in-place writes for updated data. */ - if (old_blk_addr != NEW_ADDR && !is_cold_data(page) && - need_inplace_update(inode)) { + if (unlikely(old_blk_addr != NEW_ADDR && + !is_cold_data(page) && + need_inplace_update(inode))) { rewrite_data_page(F2FS_SB(inode->i_sb), page, old_blk_addr); } else { |