diff options
Diffstat (limited to 'fs/f2fs/gc.h')
| -rw-r--r-- | fs/f2fs/gc.h | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h index 6ff7ad38463e..b4a65be9f7d3 100644 --- a/fs/f2fs/gc.h +++ b/fs/f2fs/gc.h | |||
| @@ -35,11 +35,6 @@ struct f2fs_gc_kthread { | |||
| 35 | unsigned int gc_idle; | 35 | unsigned int gc_idle; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | struct inode_entry { | ||
| 39 | struct list_head list; | ||
| 40 | struct inode *inode; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct gc_inode_list { | 38 | struct gc_inode_list { |
| 44 | struct list_head ilist; | 39 | struct list_head ilist; |
| 45 | struct radix_tree_root iroot; | 40 | struct radix_tree_root iroot; |
| @@ -69,26 +64,26 @@ static inline block_t limit_free_user_blocks(struct f2fs_sb_info *sbi) | |||
| 69 | return (long)(reclaimable_user_blocks * LIMIT_FREE_BLOCK) / 100; | 64 | return (long)(reclaimable_user_blocks * LIMIT_FREE_BLOCK) / 100; |
| 70 | } | 65 | } |
| 71 | 66 | ||
| 72 | static inline long increase_sleep_time(struct f2fs_gc_kthread *gc_th, long wait) | 67 | static inline void increase_sleep_time(struct f2fs_gc_kthread *gc_th, |
| 68 | long *wait) | ||
| 73 | { | 69 | { |
| 74 | if (wait == gc_th->no_gc_sleep_time) | 70 | if (*wait == gc_th->no_gc_sleep_time) |
| 75 | return wait; | 71 | return; |
| 76 | 72 | ||
| 77 | wait += gc_th->min_sleep_time; | 73 | *wait += gc_th->min_sleep_time; |
| 78 | if (wait > gc_th->max_sleep_time) | 74 | if (*wait > gc_th->max_sleep_time) |
| 79 | wait = gc_th->max_sleep_time; | 75 | *wait = gc_th->max_sleep_time; |
| 80 | return wait; | ||
| 81 | } | 76 | } |
| 82 | 77 | ||
| 83 | static inline long decrease_sleep_time(struct f2fs_gc_kthread *gc_th, long wait) | 78 | static inline void decrease_sleep_time(struct f2fs_gc_kthread *gc_th, |
| 79 | long *wait) | ||
| 84 | { | 80 | { |
| 85 | if (wait == gc_th->no_gc_sleep_time) | 81 | if (*wait == gc_th->no_gc_sleep_time) |
| 86 | wait = gc_th->max_sleep_time; | 82 | *wait = gc_th->max_sleep_time; |
| 87 | 83 | ||
| 88 | wait -= gc_th->min_sleep_time; | 84 | *wait -= gc_th->min_sleep_time; |
| 89 | if (wait <= gc_th->min_sleep_time) | 85 | if (*wait <= gc_th->min_sleep_time) |
| 90 | wait = gc_th->min_sleep_time; | 86 | *wait = gc_th->min_sleep_time; |
| 91 | return wait; | ||
| 92 | } | 87 | } |
| 93 | 88 | ||
| 94 | static inline bool has_enough_invalid_blocks(struct f2fs_sb_info *sbi) | 89 | static inline bool has_enough_invalid_blocks(struct f2fs_sb_info *sbi) |
