aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-10-23 07:09:06 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-25 21:26:10 -0400
commitf7899bd5472e8e99741369b4a32eca44e5282a85 (patch)
tree01297ddbb1bbeb0409f4f6bba81fbb3150794033 /fs
parentad5e195ac9fdf4e2b28b8cf14937e5b9384dac2e (diff)
fs: move i_count increments into find_inode/find_inode_fast
Now that iunique is not abusing find_inode anymore we can move the i_ref increment back to where it belongs. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/inode.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/inode.c b/fs/inode.c
index a8035e8576df..78c41c626cdc 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -634,9 +634,6 @@ static struct shrinker icache_shrinker = {
634static void __wait_on_freeing_inode(struct inode *inode); 634static void __wait_on_freeing_inode(struct inode *inode);
635/* 635/*
636 * Called with the inode lock held. 636 * Called with the inode lock held.
637 * NOTE: we are not increasing the inode-refcount, you must call __iget()
638 * by hand after calling find_inode now! This simplifies iunique and won't
639 * add any additional branch in the common code.
640 */ 637 */
641static struct inode *find_inode(struct super_block *sb, 638static struct inode *find_inode(struct super_block *sb,
642 struct hlist_head *head, 639 struct hlist_head *head,
@@ -656,9 +653,10 @@ repeat:
656 __wait_on_freeing_inode(inode); 653 __wait_on_freeing_inode(inode);
657 goto repeat; 654 goto repeat;
658 } 655 }
659 break; 656 __iget(inode);
657 return inode;
660 } 658 }
661 return node ? inode : NULL; 659 return NULL;
662} 660}
663 661
664/* 662/*
@@ -681,9 +679,10 @@ repeat:
681 __wait_on_freeing_inode(inode); 679 __wait_on_freeing_inode(inode);
682 goto repeat; 680 goto repeat;
683 } 681 }
684 break; 682 __iget(inode);
683 return inode;
685 } 684 }
686 return node ? inode : NULL; 685 return NULL;
687} 686}
688 687
689static inline void 688static inline void
@@ -828,7 +827,6 @@ static struct inode *get_new_inode(struct super_block *sb,
828 * us. Use the old inode instead of the one we just 827 * us. Use the old inode instead of the one we just
829 * allocated. 828 * allocated.
830 */ 829 */
831 __iget(old);
832 spin_unlock(&inode_lock); 830 spin_unlock(&inode_lock);
833 destroy_inode(inode); 831 destroy_inode(inode);
834 inode = old; 832 inode = old;
@@ -875,7 +873,6 @@ static struct inode *get_new_inode_fast(struct super_block *sb,
875 * us. Use the old inode instead of the one we just 873 * us. Use the old inode instead of the one we just
876 * allocated. 874 * allocated.
877 */ 875 */
878 __iget(old);
879 spin_unlock(&inode_lock); 876 spin_unlock(&inode_lock);
880 destroy_inode(inode); 877 destroy_inode(inode);
881 inode = old; 878 inode = old;
@@ -989,7 +986,6 @@ static struct inode *ifind(struct super_block *sb,
989 spin_lock(&inode_lock); 986 spin_lock(&inode_lock);
990 inode = find_inode(sb, head, test, data); 987 inode = find_inode(sb, head, test, data);
991 if (inode) { 988 if (inode) {
992 __iget(inode);
993 spin_unlock(&inode_lock); 989 spin_unlock(&inode_lock);
994 if (likely(wait)) 990 if (likely(wait))
995 wait_on_inode(inode); 991 wait_on_inode(inode);
@@ -1022,7 +1018,6 @@ static struct inode *ifind_fast(struct super_block *sb,
1022 spin_lock(&inode_lock); 1018 spin_lock(&inode_lock);
1023 inode = find_inode_fast(sb, head, ino); 1019 inode = find_inode_fast(sb, head, ino);
1024 if (inode) { 1020 if (inode) {
1025 __iget(inode);
1026 spin_unlock(&inode_lock); 1021 spin_unlock(&inode_lock);
1027 wait_on_inode(inode); 1022 wait_on_inode(inode);
1028 return inode; 1023 return inode;