diff options
Diffstat (limited to 'fs/f2fs/gc.h')
-rw-r--r-- | fs/f2fs/gc.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h index 3abdf83b5c16..c407a75a7daa 100644 --- a/fs/f2fs/gc.h +++ b/fs/f2fs/gc.h | |||
@@ -106,11 +106,7 @@ static inline int is_idle(struct f2fs_sb_info *sbi) | |||
106 | 106 | ||
107 | static inline bool should_do_checkpoint(struct f2fs_sb_info *sbi) | 107 | static inline bool should_do_checkpoint(struct f2fs_sb_info *sbi) |
108 | { | 108 | { |
109 | unsigned int pages_per_sec = sbi->segs_per_sec * | 109 | int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES); |
110 | (1 << sbi->log_blocks_per_seg); | 110 | int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS); |
111 | int node_secs = ((get_pages(sbi, F2FS_DIRTY_NODES) + pages_per_sec - 1) | ||
112 | >> sbi->log_blocks_per_seg) / sbi->segs_per_sec; | ||
113 | int dent_secs = ((get_pages(sbi, F2FS_DIRTY_DENTS) + pages_per_sec - 1) | ||
114 | >> sbi->log_blocks_per_seg) / sbi->segs_per_sec; | ||
115 | return free_sections(sbi) <= (node_secs + 2 * dent_secs + 2); | 111 | return free_sections(sbi) <= (node_secs + 2 * dent_secs + 2); |
116 | } | 112 | } |