diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-06 09:54:52 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-09 00:16:31 -0500 |
commit | 5a3cd99285dc793a4022fa75ceeb323eb6d29ac9 (patch) | |
tree | 84d6be981f67655016a62febd87f89bec53c89b3 /fs | |
parent | b18825a7c8e37a7cf6abb97a12a6ad71af160de7 (diff) | |
download | linux-5a3cd99285dc793a4022fa75ceeb323eb6d29ac9.tar.gz linux-5a3cd99285dc793a4022fa75ceeb323eb6d29ac9.tar.bz2 linux-5a3cd99285dc793a4022fa75ceeb323eb6d29ac9.zip |
iget/iget5: don't bother with ->i_lock until we find a match
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/inode.c | 20 | ||||
-rw-r--r-- | fs/ntfs/inode.c | 2 |
2 files changed, 7 insertions, 15 deletions
diff --git a/fs/inode.c b/fs/inode.c index b33ba8e021cc..bf7a8b3ab937 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -773,15 +773,11 @@ static struct inode *find_inode(struct super_block *sb, repeat: hlist_for_each_entry(inode, head, i_hash) { - spin_lock(&inode->i_lock); - if (inode->i_sb != sb) { - spin_unlock(&inode->i_lock); + if (inode->i_sb != sb) continue; - } - if (!test(inode, data)) { - spin_unlock(&inode->i_lock); + if (!test(inode, data)) continue; - } + spin_lock(&inode->i_lock); if (inode->i_state & (I_FREEING|I_WILL_FREE)) { __wait_on_freeing_inode(inode); goto repeat; @@ -804,15 +800,11 @@ static struct inode *find_inode_fast(struct super_block *sb, repeat: hlist_for_each_entry(inode, head, i_hash) { - spin_lock(&inode->i_lock); - if (inode->i_ino != ino) { - spin_unlock(&inode->i_lock); + if (inode->i_ino != ino) continue; - } - if (inode->i_sb != sb) { - spin_unlock(&inode->i_lock); + if (inode->i_sb != sb) continue; - } + spin_lock(&inode->i_lock); if (inode->i_state & (I_FREEING|I_WILL_FREE)) { __wait_on_freeing_inode(inode); goto repeat; diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 2778b0255dc6..ffb9b3675736 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -55,7 +55,7 @@ * * Return 1 if the attributes match and 0 if not. * - * NOTE: This function runs with the inode->i_lock spin lock held so it is not + * NOTE: This function runs with the inode_hash_lock spin lock held so it is not * allowed to sleep. */ int ntfs_test_inode(struct inode *vi, ntfs_attr *na) |