aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorChangman Lee <cm224.lee@samsung.com>2013-11-21 06:04:21 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-12-22 20:18:02 -0500
commit61ae45c8803262a96f3af200489344f339992291 (patch)
treec82f69d25b82224541defde11e1f749c4db009b8 /fs/f2fs/segment.h
parent7107e0a9b131f46785b853388fb263306721a986 (diff)
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 <cm224.lee@samsung.com> [Jaegeuk Kim: remove unnecessary white spaces] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h9
1 files changed, 2 insertions, 7 deletions
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 @@
20#define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno) 20#define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno)
21#define GET_R2L_SEGNO(free_i, segno) (segno + free_i->start_segno) 21#define GET_R2L_SEGNO(free_i, segno) (segno + free_i->start_segno)
22 22
23#define IS_DATASEG(t) \ 23#define IS_DATASEG(t) (t <= CURSEG_COLD_DATA)
24 ((t == CURSEG_HOT_DATA) || (t == CURSEG_COLD_DATA) || \ 24#define IS_NODESEG(t) (t >= CURSEG_HOT_NODE)
25 (t == CURSEG_WARM_DATA))
26
27#define IS_NODESEG(t) \
28 ((t == CURSEG_HOT_NODE) || (t == CURSEG_COLD_NODE) || \
29 (t == CURSEG_WARM_NODE))
30 25
31#define IS_CURSEG(sbi, seg) \ 26#define IS_CURSEG(sbi, seg) \
32 ((seg == CURSEG_I(sbi, CURSEG_HOT_DATA)->segno) || \ 27 ((seg == CURSEG_I(sbi, CURSEG_HOT_DATA)->segno) || \