f2fs: disable roll-forward when active_logs = 2
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 6 Nov 2014 04:05:53 +0000 (20:05 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 6 Nov 2014 04:05:53 +0000 (20:05 -0800)
The roll-forward mechanism should be activated when the number of active
logs is not 2.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c
fs/f2fs/segment.c

index 46311e7b388a3ae84e54cb7ffc5ca72e147c158d..54722a0a5be58c6b8e83fb447c70c23b5110aa85 100644 (file)
@@ -132,6 +132,8 @@ static inline bool need_do_checkpoint(struct inode *inode)
                need_cp = true;
        else if (test_opt(sbi, FASTBOOT))
                need_cp = true;
+       else if (sbi->active_logs == 2)
+               need_cp = true;
 
        return need_cp;
 }
index 2fb3d7f71c4ec738e17772397661e051b372838e..16721b5dffa442f2643f656c7a8fe8c463f807ba 100644 (file)
@@ -1090,8 +1090,8 @@ static int __get_segment_type_4(struct page *page, enum page_type p_type)
                else
                        return CURSEG_COLD_DATA;
        } else {
-               if (IS_DNODE(page) && !is_cold_node(page))
-                       return CURSEG_HOT_NODE;
+               if (IS_DNODE(page) && is_cold_node(page))
+                       return CURSEG_WARM_NODE;
                else
                        return CURSEG_COLD_NODE;
        }