Skip to content

Commit

Permalink
f2fs: use list_for_each rather than list_for_each_safe, in remove_orp…
Browse files Browse the repository at this point in the history
…han_inode()

As we remove the target single node, so list_for_each is enought, in order to
clean up, we use list_for_each_entry instead.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Gu Zheng authored and Jaegeuk Kim committed Jul 30, 2013
1 parent 2d219c5 commit 60ed9a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/f2fs/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,12 @@ void add_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)

void remove_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
{
struct list_head *this, *next, *head;
struct list_head *head;
struct orphan_inode_entry *orphan;

mutex_lock(&sbi->orphan_inode_mutex);
head = &sbi->orphan_inode_list;
list_for_each_safe(this, next, head) {
orphan = list_entry(this, struct orphan_inode_entry, list);
list_for_each_entry(orphan, head, list) {
if (orphan->ino == ino) {
list_del(&orphan->list);
kmem_cache_free(orphan_entry_slab, orphan);
Expand Down

0 comments on commit 60ed9a0

Please sign in to comment.