Merge branch 'i2c/for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[cascardo/linux.git] / fs / f2fs / gc.h
index 6ff7ad3..b4a65be 100644 (file)
@@ -35,11 +35,6 @@ struct f2fs_gc_kthread {
        unsigned int gc_idle;
 };
 
-struct inode_entry {
-       struct list_head list;
-       struct inode *inode;
-};
-
 struct gc_inode_list {
        struct list_head ilist;
        struct radix_tree_root iroot;
@@ -69,26 +64,26 @@ static inline block_t limit_free_user_blocks(struct f2fs_sb_info *sbi)
        return (long)(reclaimable_user_blocks * LIMIT_FREE_BLOCK) / 100;
 }
 
-static inline long increase_sleep_time(struct f2fs_gc_kthread *gc_th, long wait)
+static inline void increase_sleep_time(struct f2fs_gc_kthread *gc_th,
+                                                               long *wait)
 {
-       if (wait == gc_th->no_gc_sleep_time)
-               return wait;
+       if (*wait == gc_th->no_gc_sleep_time)
+               return;
 
-       wait += gc_th->min_sleep_time;
-       if (wait > gc_th->max_sleep_time)
-               wait = gc_th->max_sleep_time;
-       return wait;
+       *wait += gc_th->min_sleep_time;
+       if (*wait > gc_th->max_sleep_time)
+               *wait = gc_th->max_sleep_time;
 }
 
-static inline long decrease_sleep_time(struct f2fs_gc_kthread *gc_th, long wait)
+static inline void decrease_sleep_time(struct f2fs_gc_kthread *gc_th,
+                                                               long *wait)
 {
-       if (wait == gc_th->no_gc_sleep_time)
-               wait = gc_th->max_sleep_time;
+       if (*wait == gc_th->no_gc_sleep_time)
+               *wait = gc_th->max_sleep_time;
 
-       wait -= gc_th->min_sleep_time;
-       if (wait <= gc_th->min_sleep_time)
-               wait = gc_th->min_sleep_time;
-       return wait;
+       *wait -= gc_th->min_sleep_time;
+       if (*wait <= gc_th->min_sleep_time)
+               *wait = gc_th->min_sleep_time;
 }
 
 static inline bool has_enough_invalid_blocks(struct f2fs_sb_info *sbi)