diff --git a/include/blkdev.h b/include/blkdev.h index 3c0a28a..e2bbd9f 100644 --- a/include/blkdev.h +++ b/include/blkdev.h @@ -15,7 +15,9 @@ // a Linux driver for SchFS will see when it is handed /dev/sda2. #define BLKDEV_FIRST 4 -#define NBLKDEV 16 // so device numbers stay below SCHFS_DEV (64) +// Disks and partitions together. A laptop's NVMe drive alone often carries +// eight partitions, and a stick or an SD card more, so 16 ran out. +#define NBLKDEV 32 // device numbers 4..35, below SCHFS_DEV (64) // The GPT partition type of a SchFS volume, as it is written and printed: // 47138FA9-B79C-47A6-9F7D-AC1F7F572D5E. sgdisk and fdisk accept it as is. diff --git a/include/fat.h b/include/fat.h index c72214e..cde6b58 100644 --- a/include/fat.h +++ b/include/fat.h @@ -9,7 +9,7 @@ // Filesystem device numbers for mounted FAT volumes. Like SCHFS_DEV, runtime // identities for the inode cache that nothing on disk records. -#define FAT_VOL_SLOTS 4 +#define FAT_VOL_SLOTS 8 // 104..111 #define FAT_DEV 104 #define FAT_IS_DEV(d) ((d) >= FAT_DEV && (d) < FAT_DEV + FAT_VOL_SLOTS) diff --git a/include/file.h b/include/file.h index d74dd05..04ece42 100644 --- a/include/file.h +++ b/include/file.h @@ -139,7 +139,8 @@ struct inode { // /dev/hdb /mnt` ignored its source argument entirely and handed back whichever // disk the kernel had found at boot. Slot 0 is that boot volume, which is why // SCHFS_DEV alone still means "the root" everywhere that only ever wanted it. -#define SCHFS_VOL_SLOTS 4 +// Sixteen, which fills 64..79 up to PROCFS_DEV. +#define SCHFS_VOL_SLOTS 16 #define SCHFS_DEV 64 #define SCHFS_IS_VOL_DEV(d) \ ((d) >= SCHFS_DEV && (d) < SCHFS_DEV + SCHFS_VOL_SLOTS) @@ -152,10 +153,10 @@ struct inode { // a reader whichever was cached first. So a slot is a device: SCHFS_SNAP_DEV // through SCHFS_SNAP_DEV + SCHFS_SNAP_SLOTS - 1. // -// Four rather than one because "one at a time" is an odd thing to explain and -// the cost is two scratch pages per slot, allocated on first use. Four rather -// than many because each is a device number and they are a fixed, small space. -#define SCHFS_SNAP_SLOTS 4 +// More than one because "one at a time" is an odd thing to explain and +// the cost is two scratch pages per slot, allocated on first use. Not many +// because each is a device number and they are a fixed, small space. +#define SCHFS_SNAP_SLOTS 8 // 96..103, up to FAT_DEV #define SCHFS_SNAP_DEV 96 #define SCHFS_IS_SNAP_DEV(d) \ ((d) >= SCHFS_SNAP_DEV && (d) < SCHFS_SNAP_DEV + SCHFS_SNAP_SLOTS) diff --git a/kernel/dev/procfs.c b/kernel/dev/procfs.c index d3e2fd3..f114789 100644 --- a/kernel/dev/procfs.c +++ b/kernel/dev/procfs.c @@ -245,7 +245,7 @@ gen_mounts(struct sbuf *sb) // Every mount is in the table, /dev included. A fixed devtmpfs line here // listed it twice once init mounted it the ordinary way. - for (int i = 0; i < 16; i++) { + for (int i = 0; i < 32; i++) { if (mount_get(i, path, source, type, &fsdev) != 0) continue; // "/" is emitted last, below, so skip it if it somehow appears here. diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c index e143cca..b1d3b46 100644 --- a/kernel/fs/fs.c +++ b/kernel/fs/fs.c @@ -1584,7 +1584,7 @@ skipelem(char *path, char *name, int *toolong) // a subtree becomes a place you can walk into and never out of. // =========================================================================== -#define NMOUNT 8 +#define NMOUNT 32 static struct { struct spinlock lock;