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>
This commit is contained in:
Haicheng Li 2013-06-13 16:59:29 +08:00 коммит произвёл Jaegeuk Kim
Родитель 8d8451af68
Коммит b25958b6ec
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -497,8 +497,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 {