RE: [PATCH] f2fs: add unlikely() macro for compiler more aggressively

Chao Yu
2013-12-06T08:35:32Z

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com]
> Sent: Friday, December 06, 2013 2:15 PM
> Cc: Jaegeuk Kim; linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net; Chao Yu
> Subject: [PATCH] f2fs: add unlikely() macro for compiler more aggressively
>
> This patch adds unlikely() macro into the most of codes.
> The basic rule is to add that when:
> - checking unusual errors,
> - checking page mappings,
> - and the other unlikely conditions.

Looks nice to me!

>
> Cc: Chao Yu <chao2.yu@samsung.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>

> ---
> fs/f2fs/checkpoint.c | 22 ++++++----
> fs/f2fs/data.c | 63 +++++++++++++--------------
> fs/f2fs/dir.c | 10 ++---
> fs/f2fs/file.c | 23 +++++-----
> fs/f2fs/gc.c | 19 ++++-----
> fs/f2fs/inode.c | 12 +++---
> fs/f2fs/namei.c | 24 ++++++-----
> fs/f2fs/node.c | 117 +++++++++++++++++++++++++++------------------------
> fs/f2fs/recovery.c | 10 ++---
> fs/f2fs/segment.c | 42 +++++++++---------
> fs/f2fs/super.c | 83 ++++++++++++++++++------------------
> fs/f2fs/xattr.c | 28 ++++++------
> 12 files changed, 234 insertions(+), 219 deletions(-)

[snip]

> @@ -808,11 +808,11 @@ retry:
> brelse(*raw_super_buf);
> f2fs_msg(sb, KERN_ERR, "Can't find a valid F2FS filesystem "
> "in %dth superblock", block + 1);
> - if(block == 0) {
> + if(unlikely(block != 0)) {

Original code has style problem:
Space is required before the open parenthesis '('.
Thanks.