This release took much longer that planned due to #210— more details below.
Memory
How ZenFS handles linear memory has been significantly changed. First off, everything linear memory related was split off from Utilium into a new package called Memium. A number of changes were made, like structs becoming "live" views, rather than the buffers and values only changing at (de)serialization. The "live" structs change was made in order to fix #210, since prior to the change, SingleBuffer would not update when changes were made in another realm. Numerous parts of ZenFS have also been rewritten in order to work with the new behavior. This includes Inode being changed to a fixed size of 4096 bytes and changes to the Port backend's serialization and deserialization logic. The inode format is now version 5.
Errors and Logging
Since Memium has some error handling and logging, the error and logging code has been split off into the Kerium package, which allows for multiple packages to work with the log and share similar errors. Additionally, many ZenFS errors now have the same behavior and messages as libuv errors on Linux, better emulating native behavior. You can read more about changes to exceptions and logging in Kerium's release notes. Some other changes to errors include a fix for readlink not throwing EINVAL if the path was not a symlink (#215) and a fix for rename not throwing EISDIR/ENOTDIR correctly.
Flags and FS Attributes
This release changes InodeFlags to follow S_* instead of FS_*_FL, since this better follows on things are done on Linux. The FS_*_FL-style flags have been added to ioctl.ts as the FileFlag enum.
FileSystem attributes have also had some minor changes:
- Removed
no_buffer_resize(unused) - Renamed
no_asynctono_async_preload - Added
no_atime - Added
no_suid - Added
sync(immediate changes)
Also, the no_id_tables attribute has been added to StoreFS. This forces all inode lookups to use the file system instead of the ID tables. This is much slower, but required for cross-realm file systems.
Tests
- Tests have been cleaned up a lot.
- A new
SingleBuffertest has been added for use withSharedArrayBuffer(#211) - The short verbose flag for
zenfs-testhas been changed from-wto-v- Originally,
-vwasn't used to allow for a potential short version option or to alleviate confusion.-vended up being less ambiguous.
- Originally,
- Slightly improved the read tests
- Missing
awaits have been added toassert.rejectscalls - The default log level for tests has been changed to
ERR
Misc
-
The
syncandsyncSyncmethods ofFileSystemweren't actually changed in 2.0. This release fixes that. -
Calls to
touchin xattr functions usedpickto only changeattributes. This had a bad side effect and was removed. -
IndexFSnow checks if directories are empty before removing them. If not,ENOTEMPTYis thrown. -
CopyOnWritewould change the mode of files stated or copied to the writable file system to be writable by everyone (i.e.|= 0o222). This behavior was removed. -
The
longargument toMetadataEntry'stoStringmethod has been removed, since it was only used byMetadataBlockand had special behavior. -
The timeout created for
PortRPC requests is now cleared when the request is settled. -
A check for whether a directory is being renamed to a file inside itself has been added to the VFS.
-
CreationOptionsnow extendsPartial<InodeLike>, which reflects the actual behavior ofStoreFS. -
A use-after-free style overwrite in
SingleBufferhas been fixed. -
The ordering of paths in
mkdirSynchas been fixed. -
Incorrect path string slicing in
mkdirandmkdirSyncwas fixed. -
Incorrect usage of
Atomics.waitwas fixed.