Commit 27d2e5e5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fs/inode.c list_head cleanup

Teach inode.c about list_move().
parent ed678f13
...@@ -216,10 +216,8 @@ void __iget(struct inode * inode) ...@@ -216,10 +216,8 @@ void __iget(struct inode * inode)
return; return;
} }
atomic_inc(&inode->i_count); atomic_inc(&inode->i_count);
if (!(inode->i_state & (I_DIRTY|I_LOCK))) { if (!(inode->i_state & (I_DIRTY|I_LOCK)))
list_del(&inode->i_list); list_move(&inode->i_list, &inode_in_use);
list_add(&inode->i_list, &inode_in_use);
}
inodes_stat.nr_unused--; inodes_stat.nr_unused--;
} }
...@@ -304,8 +302,7 @@ static int invalidate_list(struct list_head *head, struct super_block * sb, stru ...@@ -304,8 +302,7 @@ static int invalidate_list(struct list_head *head, struct super_block * sb, stru
invalidate_inode_buffers(inode); invalidate_inode_buffers(inode);
if (!atomic_read(&inode->i_count)) { if (!atomic_read(&inode->i_count)) {
hlist_del_init(&inode->i_hash); hlist_del_init(&inode->i_hash);
list_del(&inode->i_list); list_move(&inode->i_list, dispose);
list_add(&inode->i_list, dispose);
inode->i_state |= I_FREEING; inode->i_state |= I_FREEING;
count++; count++;
continue; continue;
...@@ -1017,10 +1014,8 @@ static void generic_forget_inode(struct inode *inode) ...@@ -1017,10 +1014,8 @@ static void generic_forget_inode(struct inode *inode)
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
if (!hlist_unhashed(&inode->i_hash)) { if (!hlist_unhashed(&inode->i_hash)) {
if (!(inode->i_state & (I_DIRTY|I_LOCK))) { if (!(inode->i_state & (I_DIRTY|I_LOCK)))
list_del(&inode->i_list); list_move(&inode->i_list, &inode_unused);
list_add(&inode->i_list, &inode_unused);
}
inodes_stat.nr_unused++; inodes_stat.nr_unused++;
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
if (!sb || (sb->s_flags & MS_ACTIVE)) if (!sb || (sb->s_flags & MS_ACTIVE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment