Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cc4af56 authored by Gu Zheng's avatar Gu Zheng Committed by Jaegeuk Kim
Browse files

f2fs: code cleanup and simplify in func {find/add}_gc_inode



This patch simplifies list operations in find_gc_inode and add_gc_inode.
Just simple code cleanup.

Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
[Jaegeuk Kim: add description]
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 8736fbf0
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -321,29 +321,22 @@ static const struct victim_selection default_v_ops = {

static struct inode *find_gc_inode(nid_t ino, struct list_head *ilist)
{
	struct list_head *this;
	struct inode_entry *ie;

	list_for_each(this, ilist) {
		ie = list_entry(this, struct inode_entry, list);
	list_for_each_entry(ie, ilist, list)
		if (ie->inode->i_ino == ino)
			return ie->inode;
	}
	return NULL;
}

static void add_gc_inode(struct inode *inode, struct list_head *ilist)
{
	struct list_head *this;
	struct inode_entry *new_ie, *ie;
	struct inode_entry *new_ie;

	list_for_each(this, ilist) {
		ie = list_entry(this, struct inode_entry, list);
		if (ie->inode == inode) {
	if (inode == find_gc_inode(inode->i_ino, ilist)) {
		iput(inode);
		return;
	}
	}
repeat:
	new_ie = kmem_cache_alloc(winode_slab, GFP_NOFS);
	if (!new_ie) {