aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/inode.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/fs/inode.c b/fs/inode.c
index c03089421b6f..81508b0a3a70 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -685,25 +685,21 @@ ino_t iunique(struct super_block *sb, ino_t max_reserved)
685{ 685{
686 static ino_t counter; 686 static ino_t counter;
687 struct inode *inode; 687 struct inode *inode;
688 struct hlist_head * head; 688 struct hlist_head *head;
689 ino_t res; 689 ino_t res;
690
690 spin_lock(&inode_lock); 691 spin_lock(&inode_lock);
691retry: 692 do {
692 if (counter > max_reserved) { 693 if (counter <= max_reserved)
693 head = inode_hashtable + hash(sb,counter); 694 counter = max_reserved + 1;
694 res = counter++; 695 res = counter++;
696 head = inode_hashtable + hash(sb, res);
695 inode = find_inode_fast(sb, head, res); 697 inode = find_inode_fast(sb, head, res);
696 if (!inode) { 698 } while (inode != NULL);
697 spin_unlock(&inode_lock); 699 spin_unlock(&inode_lock);
698 return res;
699 }
700 } else {
701 counter = max_reserved + 1;
702 }
703 goto retry;
704
705}
706 700
701 return res;
702}
707EXPORT_SYMBOL(iunique); 703EXPORT_SYMBOL(iunique);
708 704
709struct inode *igrab(struct inode *inode) 705struct inode *igrab(struct inode *inode)