Minoru / plentyfs

A proof-of-concept for a read-only filesystem with random contents generated on demand.
Other
37 stars 1 forks source link

Generate directory trees #12

Open Minoru opened 3 years ago

Minoru commented 3 years ago

Right now, PlentyFS contains just one directory with a fixed number of files. Ideally, it should generate a random hierarchy instead.

This is trickier than generating random files because:

  1. all the filesystem entries have to have unique inode numbers assigned to them;
  2. there is a global limit on the amount of data in the whole filesystem (#9) and each file (#10). The limits are statistical, i.e. PlentyFS is allowed to deviate from them, but it should strive to meet them;
  3. there is a global limit of how many entries each directory can have (#11).

This makes directories inter-dependent, and thus much harder to generate piecemeal. I've no idea how to do this yet.

Generating the whole hierarchy at once and holding it in memory might be an acceptable first approximation, but it won't work if we want billions of files (1 billion 64-bit inodes = 7.5 gigabytes of data, but we also need meta-data of what inodes are directories containing which file inodes).