From: Changman Lee Date: Thu, 21 Nov 2013 11:04:21 +0000 (+0900) Subject: f2fs: simplify IS_DATASEG and IS_NODESEG macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=61ae45c8803262a96f3af200489344f339992291;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git f2fs: simplify IS_DATASEG and IS_NODESEG macro It is not efficient comparing each segment type to find node or data. Signed-off-by: Changman Lee [Jaegeuk Kim: remove unnecessary white spaces] Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 269f690b4e24..38f6196493ff 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -20,13 +20,8 @@ #define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno) #define GET_R2L_SEGNO(free_i, segno) (segno + free_i->start_segno) -#define IS_DATASEG(t) \ - ((t == CURSEG_HOT_DATA) || (t == CURSEG_COLD_DATA) || \ - (t == CURSEG_WARM_DATA)) - -#define IS_NODESEG(t) \ - ((t == CURSEG_HOT_NODE) || (t == CURSEG_COLD_NODE) || \ - (t == CURSEG_WARM_NODE)) +#define IS_DATASEG(t) (t <= CURSEG_COLD_DATA) +#define IS_NODESEG(t) (t >= CURSEG_HOT_NODE) #define IS_CURSEG(sbi, seg) \ ((seg == CURSEG_I(sbi, CURSEG_HOT_DATA)->segno) || \