f2fs: adjust trace print in f2fs_get_victim() to cover all paths
authorSahitya Tummala <stummala@codeaurora.org>
Mon, 26 Nov 2018 08:01:42 +0000 (13:31 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 Nov 2018 00:38:49 +0000 (16:38 -0800)
Adjust the trace print in f2fs_get_victim() to cover GC done by
F2FS_IOC_GARBAGE_COLLECT_RANGE.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c

index 9a60801ab1c5353340dc045034b4c3f28c982bf5..71462f2e47d4603cf24ce186773f3a365b08b8f0 100644 (file)
@@ -420,11 +420,12 @@ got_result:
                                set_bit(secno, dirty_i->victim_secmap);
                }
 
+       }
+out:
+       if (p.min_segno != NULL_SEGNO)
                trace_f2fs_get_victim(sbi->sb, type, gc_type, &p,
                                sbi->cur_victim_sec,
                                prefree_segments(sbi), free_segments(sbi));
-       }
-out:
        mutex_unlock(&dirty_i->seglist_lock);
 
        return (p.min_segno == NULL_SEGNO) ? 0 : 1;