]> Zhao Yanbai Git Server - minix.git/commitdiff
revert mkfs change; might run out of inodes, but large number of inodes
authorBen Gras <ben@minix3.org>
Tue, 29 Sep 2009 12:14:35 +0000 (12:14 +0000)
committerBen Gras <ben@minix3.org>
Tue, 29 Sep 2009 12:14:35 +0000 (12:14 +0000)
makes mkfs not want to mkfs large filesystems.

find optimal formula (e.g. dynamic capping of no. of inodes) later.

commands/simple/mkfs.c

index 39a04410fe9326873b820ead614a2c805b95efb1..7fb72f5aa0403300ad88731d8226c67787d2ffae 100755 (executable)
@@ -266,9 +266,12 @@ char *argv[];
                if (blocks == 0) pexit("Can't open prototype file");
        }
        if (i == 0) {
-               u32_t kb = div64u(mul64u(blocks, block_size), 1024);
-               i = kb / 2;
-               if (kb >= 100000) i = kb / 4;
+               i = blocks / 2;
+               if (blocks >= 20000) i = blocks / 3;
+               if (blocks >= 40000) i = blocks / 4;
+               if (blocks >= 60000) i = blocks / 5;
+               if (blocks >= 80000) i = blocks / 6;
+               if (blocks >= 100000) i = blocks / 7;
 
                /* round up to fill inode block */
                i += inodes_per_block - 1;