diff options
author | Chao Yu <chao2.yu@samsung.com> | 2013-12-05 04:15:22 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-22 20:18:06 -0500 |
commit | cfb271d485d0ec31eb92b51f4fbe54bf6542e8e6 (patch) | |
tree | 1565b575545b152af61ba0a18c2860070bd69348 /fs/f2fs/data.c | |
parent | b9987a277f1ec9dba203d04c3a20d967c01a1fba (diff) |
f2fs: add unlikely() macro for compiler optimization
As we know, some of our branch condition will rarely be true. So we could add
'unlikely' to let compiler optimize these code, by this way we could drop
unneeded 'jump' assemble code to improve performance.
change log:
o add *unlikely* as many as possible across the whole source files at once
suggested by Jaegeuk Kim.
Suggested-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 4e2fc09f0e4f..2ce5a9ef508b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -251,7 +251,7 @@ int reserve_new_block(struct dnode_of_data *dn) | |||
251 | 251 | ||
252 | if (is_inode_flag_set(F2FS_I(dn->inode), FI_NO_ALLOC)) | 252 | if (is_inode_flag_set(F2FS_I(dn->inode), FI_NO_ALLOC)) |
253 | return -EPERM; | 253 | return -EPERM; |
254 | if (!inc_valid_block_count(sbi, dn->inode, 1)) | 254 | if (unlikely(!inc_valid_block_count(sbi, dn->inode, 1))) |
255 | return -ENOSPC; | 255 | return -ENOSPC; |
256 | 256 | ||
257 | trace_f2fs_reserve_new_block(dn->inode, dn->nid, dn->ofs_in_node); | 257 | trace_f2fs_reserve_new_block(dn->inode, dn->nid, dn->ofs_in_node); |
@@ -711,7 +711,7 @@ static int f2fs_write_data_page(struct page *page, | |||
711 | 711 | ||
712 | zero_user_segment(page, offset, PAGE_CACHE_SIZE); | 712 | zero_user_segment(page, offset, PAGE_CACHE_SIZE); |
713 | write: | 713 | write: |
714 | if (sbi->por_doing) { | 714 | if (unlikely(sbi->por_doing)) { |
715 | err = AOP_WRITEPAGE_ACTIVATE; | 715 | err = AOP_WRITEPAGE_ACTIVATE; |
716 | goto redirty_out; | 716 | goto redirty_out; |
717 | } | 717 | } |