Commit b7a813cf authored by Brian Gerst's avatar Brian Gerst Committed by Russell King

[PATCH] fs/inode.c list_del_init

A few cases of list_del(x) + INIT_LIST_HEAD(x) crept in recently which
can be replaced with list_del_init(x).
parent 856dd13d
...@@ -390,8 +390,7 @@ void prune_icache(int goal) ...@@ -390,8 +390,7 @@ void prune_icache(int goal)
if (atomic_read(&inode->i_count)) if (atomic_read(&inode->i_count))
continue; continue;
list_del(tmp); list_del(tmp);
list_del(&inode->i_hash); list_del_init(&inode->i_hash);
INIT_LIST_HEAD(&inode->i_hash);
list_add(tmp, freeable); list_add(tmp, freeable);
inode->i_state |= I_FREEING; inode->i_state |= I_FREEING;
count++; count++;
...@@ -777,8 +776,7 @@ void __insert_inode_hash(struct inode *inode, unsigned long hashval) ...@@ -777,8 +776,7 @@ void __insert_inode_hash(struct inode *inode, unsigned long hashval)
void remove_inode_hash(struct inode *inode) void remove_inode_hash(struct inode *inode)
{ {
spin_lock(&inode_lock); spin_lock(&inode_lock);
list_del(&inode->i_hash); list_del_init(&inode->i_hash);
INIT_LIST_HEAD(&inode->i_hash);
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
} }
...@@ -786,10 +784,8 @@ void generic_delete_inode(struct inode *inode) ...@@ -786,10 +784,8 @@ void generic_delete_inode(struct inode *inode)
{ {
struct super_operations *op = inode->i_sb->s_op; struct super_operations *op = inode->i_sb->s_op;
list_del(&inode->i_hash); list_del_init(&inode->i_hash);
INIT_LIST_HEAD(&inode->i_hash); list_del_init(&inode->i_list);
list_del(&inode->i_list);
INIT_LIST_HEAD(&inode->i_list);
inode->i_state|=I_FREEING; inode->i_state|=I_FREEING;
inodes_stat.nr_inodes--; inodes_stat.nr_inodes--;
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
......
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