]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/gc.h
f2fs: make an accessor to get sections for particular block type
[karo-tx-linux.git] / fs / f2fs / gc.h
index b026d9354ccddf97bc8f82efbddd47bea8e2743f..c407a75a7daa833179f348007e7bd2d72ddd9faa 100644 (file)
@@ -8,7 +8,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#define GC_THREAD_NAME "f2fs_gc_task"
 #define GC_THREAD_MIN_WB_PAGES         1       /*
                                                 * a threshold to determine
                                                 * whether IO subsystem is idle
@@ -107,11 +106,7 @@ static inline int is_idle(struct f2fs_sb_info *sbi)
 
 static inline bool should_do_checkpoint(struct f2fs_sb_info *sbi)
 {
-       unsigned int pages_per_sec = sbi->segs_per_sec *
-                                       (1 << sbi->log_blocks_per_seg);
-       int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1)
-                       >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
-       int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1)
-                       >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
+       int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
+       int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
        return free_sections(sbi) <= (node_secs + 2 * dent_secs + 2);
 }