summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2013-12-05 17:15:22 +0800
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-12-23 10:18:06 +0900
commitcfb271d485d0ec31eb92b51f4fbe54bf6542e8e6 (patch)
tree1565b575545b152af61ba0a18c2860070bd69348 /fs/f2fs/dir.c
parentb9987a277f1ec9dba203d04c3a20d967c01a1fba (diff)
downloadlinux-cfb271d485d0ec31eb92b51f4fbe54bf6542e8e6.tar.bz2
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/dir.c')
-rw-r--r--fs/f2fs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 594fc1bb64ef..0cc26ba07c3b 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -190,7 +190,7 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
unsigned int max_depth;
unsigned int level;
- if (namelen > F2FS_NAME_LEN)
+ if (unlikely(namelen > F2FS_NAME_LEN))
return NULL;
if (npages == 0)
@@ -461,7 +461,7 @@ int __f2fs_add_link(struct inode *dir, const struct qstr *name, struct inode *in
}
start:
- if (current_depth == MAX_DIR_HASH_DEPTH)
+ if (unlikely(current_depth == MAX_DIR_HASH_DEPTH))
return -ENOSPC;
/* Increase the depth, if required */