Commit f7899bd5472e8e99741369b4a32eca44e5282a85
Committed by
Al Viro
1 parent
ad5e195ac9
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 6 additions and 11 deletions Side-by-side Diff
fs/inode.c
... | ... | @@ -634,9 +634,6 @@ |
634 | 634 | static void __wait_on_freeing_inode(struct inode *inode); |
635 | 635 | /* |
636 | 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 | */ |
641 | 638 | static struct inode *find_inode(struct super_block *sb, |
642 | 639 | struct hlist_head *head, |
643 | 640 | |
... | ... | @@ -656,9 +653,10 @@ |
656 | 653 | __wait_on_freeing_inode(inode); |
657 | 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 | /* |
665 | 663 | |
... | ... | @@ -681,9 +679,10 @@ |
681 | 679 | __wait_on_freeing_inode(inode); |
682 | 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 | |
689 | 688 | static inline void |
... | ... | @@ -828,7 +827,6 @@ |
828 | 827 | * us. Use the old inode instead of the one we just |
829 | 828 | * allocated. |
830 | 829 | */ |
831 | - __iget(old); | |
832 | 830 | spin_unlock(&inode_lock); |
833 | 831 | destroy_inode(inode); |
834 | 832 | inode = old; |
... | ... | @@ -875,7 +873,6 @@ |
875 | 873 | * us. Use the old inode instead of the one we just |
876 | 874 | * allocated. |
877 | 875 | */ |
878 | - __iget(old); | |
879 | 876 | spin_unlock(&inode_lock); |
880 | 877 | destroy_inode(inode); |
881 | 878 | inode = old; |
... | ... | @@ -989,7 +986,6 @@ |
989 | 986 | spin_lock(&inode_lock); |
990 | 987 | inode = find_inode(sb, head, test, data); |
991 | 988 | if (inode) { |
992 | - __iget(inode); | |
993 | 989 | spin_unlock(&inode_lock); |
994 | 990 | if (likely(wait)) |
995 | 991 | wait_on_inode(inode); |
... | ... | @@ -1022,7 +1018,6 @@ |
1022 | 1018 | spin_lock(&inode_lock); |
1023 | 1019 | inode = find_inode_fast(sb, head, ino); |
1024 | 1020 | if (inode) { |
1025 | - __iget(inode); | |
1026 | 1021 | spin_unlock(&inode_lock); |
1027 | 1022 | wait_on_inode(inode); |
1028 | 1023 | return inode; |