Commit d009e569 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove anon_hash_chain

From: James Morris <jmorris@intercode.com.au>

This patch against current bk removes anon_hash_chain from fs/inode.c, as
all inodes in the 2.5 kernel must be associated with a superblock, and the
anon hash is no longer needed.

(akpm: Well there's one inode with a null i_sb: swapper_inode.  But it
shouldn't get here and if it does, we'll fix it by other means).
parent 2631b953
...@@ -71,7 +71,6 @@ static unsigned int i_hash_shift; ...@@ -71,7 +71,6 @@ static unsigned int i_hash_shift;
LIST_HEAD(inode_in_use); LIST_HEAD(inode_in_use);
LIST_HEAD(inode_unused); LIST_HEAD(inode_unused);
static struct hlist_head *inode_hashtable; static struct hlist_head *inode_hashtable;
static HLIST_HEAD(anon_hash_chain); /* for inodes with NULL i_sb */
/* /*
* A simple spinlock to protect the list manipulations. * A simple spinlock to protect the list manipulations.
...@@ -918,15 +917,12 @@ EXPORT_SYMBOL(iget_locked); ...@@ -918,15 +917,12 @@ EXPORT_SYMBOL(iget_locked);
* @hashval: unsigned long value used to locate this object in the * @hashval: unsigned long value used to locate this object in the
* inode_hashtable. * inode_hashtable.
* *
* Add an inode to the inode hash for this superblock. If the inode * Add an inode to the inode hash for this superblock.
* has no superblock it is added to a separate anonymous chain.
*/ */
void __insert_inode_hash(struct inode *inode, unsigned long hashval) void __insert_inode_hash(struct inode *inode, unsigned long hashval)
{ {
struct hlist_head *head = &anon_hash_chain; struct hlist_head *head = inode_hashtable + hash(inode->i_sb, hashval);
if (inode->i_sb)
head = inode_hashtable + hash(inode->i_sb, hashval);
spin_lock(&inode_lock); spin_lock(&inode_lock);
hlist_add_head(&inode->i_hash, head); hlist_add_head(&inode->i_hash, head);
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
...@@ -936,7 +932,7 @@ void __insert_inode_hash(struct inode *inode, unsigned long hashval) ...@@ -936,7 +932,7 @@ void __insert_inode_hash(struct inode *inode, unsigned long hashval)
* remove_inode_hash - remove an inode from the hash * remove_inode_hash - remove an inode from the hash
* @inode: inode to unhash * @inode: inode to unhash
* *
* Remove an inode from the superblock or anonymous hash. * Remove an inode from the superblock.
*/ */
void remove_inode_hash(struct inode *inode) void remove_inode_hash(struct inode *inode)
......
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