Closed jsvaerke closed 2 years ago
TerarkDB build is failing because of addition of new files. I think we need to fix that before merging.
The terarkdb smoke test fails, but that'll be resolved by https://github.com/bytedance/terarkdb/pull/244 , we also need some testing for zonefs in the ci(will be addressed separately)
This change series introduces support for using zonefs to access a zoned block device in ZenFS. When using zonefs, the zones of a ZBD are exposed as individual files in a file system, e.g., sequential zone 5 is accessed through the path/seq/5. This makes read and write access somewhat different from the existing raw block device approach, where LBAs spanning the entire block device are used to specify a target range.
To continue to support the notion of a contiguous LBA space, the approach taken with zonefs is to map all sequential zones into into a contiguous LBA space such that sequential zone N has the LBA range [ N; (N + 1) [.
Read and write methods convert from this LBA space to offsets within zone files. A consequence of this is that all file operations now need to happen within the zoned block device support, and that raw FDs cannot be exposed to the FS and IO components anymore.
The use of zonefs is supported through a new URL: zenfs://zonefs:
identifying a zonefs mountpoint. zonefs volumes should be mounted with the option "explicit-open", e.g.,
sudo mount -o explicit-open /dev/nvme0n2 /mnt
after having created a zonefs filesystem on a device:
sudo mkzonefs /dev/nvme0n2
The zenfs utility has been extended to accept either a zoned device or a zonefs mountpoint (using --zonefs=).
The change series is structured as follows: 1) Use of FDs outside of the ZonedBlockDevice are removed 2) ZonedBlockDevice is restructured such that all zbdlib specifics are moved to a ZonedBlockDeviceBackend object. 3) Support for the new URL for zonefs and the zenfs utility option is introduced. 4) zonefs support is added.
Closes #173