Data element content management

Updated: April 19, 2023

Finally, your filesystem might just contain some actual files! There's no requirement to do this—you can have perfectly legal and useful filesystems that have only symlinks (and no files), for example.

Data element content management consists of binding data to the attributes structure, and providing some access to the data. There's a range of complexity involved here. In the RAM disk, the simplest thing to do is allocate or deallocate space as the size of the file changes (using a block allocator for efficiency), and store the new contents in the allocated space. It's more complicated if you're dealing with an actual disk-based filesystem, since you'll need to allocate blocks on disk, make records of which blocks you allocated, perhaps link them together, and so on. You can see the details of the io_read() handlers in both the RAM disk and the .tar filesystem, and the io_write() handler in the RAM disk filesystem (the .tar filesystem is read-only and therefore doesn't support writing).