westerndigitalcorporation / zonefs-tools

Linux zonefs userland tools
GNU General Public License v2.0
17 stars 10 forks source link

how does zonefs actually write data? #2

Closed ZhuWeiLin0 closed 1 year ago

ZhuWeiLin0 commented 1 year ago

Hello, I'm a newbie to ZNS and the file system. I have two questions for zonefs:

  1. how are data written to a zone? Does zonefs use vfs_write or any other write function provided by Linux?
  2. I did not find any data structures that indicate a zone's lifetime. As we know, data with different lifetimes should be stored in different zones. How does zonefs achieve that?

any help is deeply thanked !

damien-lemoal commented 1 year ago

With zonefs, one file == one zone, so there is no intelligence in zonefs regarding data placement: the user application needs to choose the right file/zone to write data. zonefs is also fully integrated within the VFS layer so all regular system calls works as expected, modulo the append-write only constraint for sequential zone files. Please read the documentation that comes with the kerenl (Documentation/filesystems/zonefs.rst) and here: https://zonedstorage.io/docs/linux/fs#zone-files