diff options
author | Haicheng Li <haicheng.li@linux.intel.com> | 2013-06-13 04:59:29 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-06-13 20:04:44 -0400 |
commit | b25958b6ecf1dce087e62b9aa27cf8f2fe9b5c86 (patch) | |
tree | a4213d64c10bd7994e8fefce1bf1f64cd81c9288 /fs/f2fs/data.c | |
parent | 8d8451af6875f8841dc20987d1363405020a9172 (diff) |
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/data.c')
-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 5b145fcc2864..6d4a743caf86 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -497,8 +497,9 @@ int do_write_data_page(struct page *page) | |||
497 | * If current allocation needs SSR, | 497 | * If current allocation needs SSR, |
498 | * it had better in-place writes for updated data. | 498 | * it had better in-place writes for updated data. |
499 | */ | 499 | */ |
500 | if (old_blk_addr != NEW_ADDR && !is_cold_data(page) && | 500 | if (unlikely(old_blk_addr != NEW_ADDR && |
501 | need_inplace_update(inode)) { | 501 | !is_cold_data(page) && |
502 | need_inplace_update(inode))) { | ||
502 | rewrite_data_page(F2FS_SB(inode->i_sb), page, | 503 | rewrite_data_page(F2FS_SB(inode->i_sb), page, |
503 | old_blk_addr); | 504 | old_blk_addr); |
504 | } else { | 505 | } else { |