Skip to contentSkip to conversation

f2fs: simplify IS_DATASEG and IS_NODESEG macro

PATCH New Changman Lee 1 participant 1 message Nov 21, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: simplify IS_DATASEG and IS_NODESEG macro

It is not efficient comparing each segment type to find node or data.

---
 fs/f2fs/segment.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/f2fs/segment.h +2 -4
index 269f690..4ace569 100644
@@ -21,12 +21,10 @@
 #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))
+	(t <= CURSEG_COLD_DATA)
 
 #define IS_NODESEG(t)							\
-	((t == CURSEG_HOT_NODE) || (t == CURSEG_COLD_NODE) ||		\
-	(t == CURSEG_WARM_NODE))
+	(t >= CURSEG_HOT_NODE)
 
 #define IS_CURSEG(sbi, seg)						\
 	((seg == CURSEG_I(sbi, CURSEG_HOT_DATA)->segno) ||	\
Signature · 1 line
1.7.9.5