diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-08-04 10:10:07 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-08-04 13:20:53 -0700 |
commit | b65ee14818e67127aa242fe1dbd3711b9c095cc0 (patch) | |
tree | 7784dd17a2672c2e5860e5c2418b79e4245690be /fs/f2fs/gc.c | |
parent | 497a0930bb4bd148451e1af239a082e3916b681b (diff) | |
download | op-kernel-dev-b65ee14818e67127aa242fe1dbd3711b9c095cc0.zip op-kernel-dev-b65ee14818e67127aa242fe1dbd3711b9c095cc0.tar.gz |
f2fs: use for_each_set_bit to simplify the code
This patch uses for_each_set_bit to simplify some codes in f2fs.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index b90dbe5..d7947d9 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -186,7 +186,6 @@ static unsigned int get_max_cost(struct f2fs_sb_info *sbi, static unsigned int check_bg_victims(struct f2fs_sb_info *sbi) { struct dirty_seglist_info *dirty_i = DIRTY_I(sbi); - unsigned int hint = 0; unsigned int secno; /* @@ -194,11 +193,9 @@ static unsigned int check_bg_victims(struct f2fs_sb_info *sbi) * selected by background GC before. * Those segments guarantee they have small valid blocks. */ -next: - secno = find_next_bit(dirty_i->victim_secmap, TOTAL_SECS(sbi), hint++); - if (secno < TOTAL_SECS(sbi)) { + for_each_set_bit(secno, dirty_i->victim_secmap, TOTAL_SECS(sbi)) { if (sec_usage_check(sbi, secno)) - goto next; + continue; clear_bit(secno, dirty_i->victim_secmap); return secno * sbi->segs_per_sec; } |