On 0 inode use filesystems
There are various ways to handle a 0 inode use filesystem, obviously the first detail being that no filesystem can get away with acutual 0 inode use, but in this instance(s) we are talking about file and folder entries that use 0 inodes in their data section (compared to most other filesystems).
After spending a bit of time looking over the filesystems described on OSDev.org wiki and in the bootboot project , I found SFS (SimpleFileSystem) which could be used as a basis. Ideally it needs some extensions, specifically POSIX ones (soft/hard links, attributes, time slots), at least for multi-part directory levels, but this is only for easier administration (and maybe for better security).
The SFS is considered an ideal starting point for various reasons, the main ones being:
- there is no sub-directory architecture, every entry is in one root table (the index section).
- it can support implied directories, where a directory entry only consists of a file endpoint.
- can easily support (because of reduced filesystem structure usage) search enhancements.
- the root table extends inversely from the end of the volume on the media, back towards the superblock and data sections.
- can support small (1.44Mb floppies), large (4Gb volume) and huge (176 ZetaBytes) media allocations, because default blocksize and inode are described with 64bit numbers.
SFS is essentially a write once filesystem, that can support updating by default (as opposed to say ISO9660). The root table is simple enough to be relaid back to the media (in an optimised way), without the need to reorganise the associated data inodes or disturb index inodes.
The simple idea of one place for everything also describes its primary drawback, lookup speed. (At least on Linux) the VFS setup allows creation of hash to help with lookups that are already held for an open file/folder. But from the driver side, any reqular (nay advanced) search ro sort algorythim will greatly improve initial lookup of new (ie not in cache) items.
That (traditional search/sort) lookup combined with segmented hash of index entries (in the root table) would greatly speed up the physical media lookup and access times. With 0 inode use this can be stored easily in the data section, or any other free space section on the volume (after the superblock). There is already defined in the SFS specification an allowance for reserved blocks which are traditionally (in the use of SFS) used for boot loader stages. This area could be co-oped for a segmented hash lookup table if the index were optimized with contiguous entries (from a text/human point of view).
Reminder here we are specifically looking at IPv4 (later IPv6) file entries that use 0 inodes (no content), and multi-segment directory structures (/a/b/c/abc.com) as used by a service for data, user, domain segmentaion (and security). So besides my use case (IPv4 counters), there are fileserver domain path uses (FTP, Nginx, Apache, etc), user path uses (same + others), and (linux) user password segregation uses ( Owl tcb ).
That said before I do anything here I’ll be finishing the github repo for the firewall part done so far, which has been in use for 1 month as of tomorrow, and got its final tweak earlier today.
As far as dvelopement of a 0 node filesystem, I can see a suite for filesystems to cater for various use cases, as some are not 0 inode (like I am useing atm, each IPv4 recodes the date it was blocked), and others would only use them if journaling was available.
FWIW: I’ll be proto-typing on RPi OS for simplicity and portability, and testing on ATARI ST EmuTOS+MiNT (ARAnyM) (for size and speed constraints) - at least thats the plan ATM.
Cheers
Paul
FYI referecnce: an old Owl tcb article