diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-03-28 23:33:17 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-04-01 20:56:27 -0400 |
commit | 2d7b822ad9daf0ea903accacaa89340ddd3f201f (patch) | |
tree | bd39738c9bdb003fdea4e897836595b2c8b1593b /fs/f2fs/segment.c | |
parent | cf0ee0f09bc09f54b9852dda1088b9cdcd4f8683 (diff) |
f2fs: use list_for_each_entry{_safe} for simplyfying code
This patch use list_for_each_entry{_safe} instead of list_for_each{_safe} for
simplfying code.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 570ab9a084c5..cb49e6390ffa 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -340,8 +340,7 @@ static void set_prefree_as_free_segments(struct f2fs_sb_info *sbi) | |||
340 | void clear_prefree_segments(struct f2fs_sb_info *sbi) | 340 | void clear_prefree_segments(struct f2fs_sb_info *sbi) |
341 | { | 341 | { |
342 | struct list_head *head = &(SM_I(sbi)->discard_list); | 342 | struct list_head *head = &(SM_I(sbi)->discard_list); |
343 | struct list_head *this, *next; | 343 | struct discard_entry *entry, *this; |
344 | struct discard_entry *entry; | ||
345 | struct dirty_seglist_info *dirty_i = DIRTY_I(sbi); | 344 | struct dirty_seglist_info *dirty_i = DIRTY_I(sbi); |
346 | unsigned long *prefree_map = dirty_i->dirty_segmap[PRE]; | 345 | unsigned long *prefree_map = dirty_i->dirty_segmap[PRE]; |
347 | unsigned int total_segs = TOTAL_SEGS(sbi); | 346 | unsigned int total_segs = TOTAL_SEGS(sbi); |
@@ -370,8 +369,7 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi) | |||
370 | mutex_unlock(&dirty_i->seglist_lock); | 369 | mutex_unlock(&dirty_i->seglist_lock); |
371 | 370 | ||
372 | /* send small discards */ | 371 | /* send small discards */ |
373 | list_for_each_safe(this, next, head) { | 372 | list_for_each_entry_safe(entry, this, head, list) { |
374 | entry = list_entry(this, struct discard_entry, list); | ||
375 | f2fs_issue_discard(sbi, entry->blkaddr, entry->len); | 373 | f2fs_issue_discard(sbi, entry->blkaddr, entry->len); |
376 | list_del(&entry->list); | 374 | list_del(&entry->list); |
377 | SM_I(sbi)->nr_discards -= entry->len; | 375 | SM_I(sbi)->nr_discards -= entry->len; |