patch-1.3.53 linux/fs/inode.c

Next file: linux/fs/ncpfs/Makefile
Previous file: linux/fs/filesystems.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.52/linux/fs/inode.c linux/fs/inode.c
@@ -86,13 +86,13 @@
 	inode->i_next->i_prev = inode;
 }
 
-void grow_inodes(void)
+int grow_inodes(void)
 {
 	struct inode * inode;
 	int i;
 
 	if (!(inode = (struct inode*) get_free_page(GFP_KERNEL)))
-		return;
+		return -ENOMEM;
 
 	i=PAGE_SIZE / sizeof(struct inode);
 	nr_inodes += i;
@@ -103,6 +103,7 @@
 
 	for ( ; i ; i-- )
 		insert_inode_free(inode++);
+	return 0;
 }
 
 unsigned long inode_init(unsigned long start, unsigned long end)
@@ -443,7 +444,7 @@
 {
 	static int ino = 0;
 	struct inode * inode, * best;
-	unsigned long badness = ~0UL;
+	unsigned long badness = 1000;
 	int i;
 
 	if (nr_inodes < NR_INODE && nr_free_inodes < (nr_inodes >> 1))
@@ -461,10 +462,10 @@
 			}
 		}
 	}
-	if (badness > 20)
+	if (badness)
 		if (nr_inodes < NR_INODE) {
-			grow_inodes();
-			goto repeat;
+			if (grow_inodes() == 0)
+				goto repeat;
 		}
 	inode = best;
 	if (!inode) {

FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected] with Sam's (original) version
of this