echo "run test script"
rm -f fs.bin
-# we need 1536 x 0.5 kbyte data blocks for 192 x 4 = 768 kbytes of swap data,
-# add 6 FULL indirect blocks, 32 partial indirect/double indirect, 1 root dir,
-# thus data part of volume will need 1575 blocks, so use 25 blocks of inodes
-../mkfs fs.bin 25 1600
+# need 1536 x 0.5 kbyte for 192 x 4 = 768 kbytes, plus 1 x 0.5 kbyte root dir
+../mkfs fs.bin 63 1600
./process_test_run 16 64 fs.bin 8 384 <process_test.txt
echo "run test script"
rm -f fs.bin
-# we need 1536 x 0.5 kbyte data blocks for 192 x 4 = 768 kbytes of swap data,
-# add 6 FULL indirect blocks, 32 partial indirect/double indirect, 1 root dir,
-# thus data part of volume will need 1575 blocks, so use 25 blocks of inodes
-../mkfs fs.bin 25 1600
+# need 1536 x 0.5 kbyte for 192 x 4 = 768 kbytes, plus 1 x 0.5 kbyte root dir
+../mkfs fs.bin 63 1600
./process_test_run 16 64 fs.bin 8 <process_test.txt
echo "run test script"
#./process_test_run 16 64 192 8 384 384 <process_test.txt
rm -f fs.bin
-# we need 1536 x 0.5 kbyte data blocks for 192 x 4 = 768 kbytes of swap data,
-# add 6 FULL indirect blocks, 32 partial indirect/double indirect, 1 root dir,
-# thus data part of volume will need 1575 blocks, so use 25 blocks of inodes
-./mkfs fs.bin 25 1600
+# need 1536 x 0.5 kbyte for 192 x 4 = 768 kbytes, plus 1 x 0.5 kbyte root dir
+./mkfs fs.bin 63 1600
./process_test_run 16 64 fs.bin 8 384 384 <process_test.txt
// basically the inverse of the above, estimates size of files that could be
// created if space is divided into at most n files, but a bit conservatively
-static long estimate_free(int n) {
+static long estimate_free(/*int n*/) {
int blocks;
// at most one partial indirect and double indirect block per file
- blocks = fs_tab[0].s_tfree - (n << 1);
+ blocks = fs_tab[0].s_tfree - 2/*(n << 1)*/;
// max number of FULL indirect blocks (ignore the 18 direct blocks)
blocks -= blocks / (DISK_INDIRECT_SIZE + 1);
return (long)blocks << DISK_BLOCK_SHIFT;
#ifdef INODE_SWAP
process_avail =
((long)(CORE_AVAIL - spare) << BLOCK_SHIFT) +
- estimate_free(n_processes);
+ ((long)fs_tab[0].s_tfree << DISK_BLOCK_SHIFT);
#ifdef PREALLOCATE_CORE
core_table_avail = (long)core_table.avail << BLOCK_SHIFT;
if (process_avail > core_table_avail)
// calculate amount to swap out
#if !defined(PREALLOCATE_SWAP) || defined(INDIRECT_SWAP)
#ifdef INODE_SWAP
- blocks = (int)(estimate_free(1) >> BLOCK_SHIFT);
+ blocks = (int)(estimate_free(/*1*/) >> BLOCK_SHIFT);
#else
blocks = SWAP_AVAIL;
#endif
// calculate amount to swap out
#if !defined(PREALLOCATE_SWAP) || defined(INDIRECT_SWAP)
#ifdef INODE_SWAP
- blocks = (int)(estimate_free(1) >> BLOCK_SHIFT);
+ blocks = (int)(estimate_free(/*1*/) >> BLOCK_SHIFT);
#else
blocks = SWAP_AVAIL;
#endif