I’m not familiar with the feature at all but I wonder whether your suggested alternative API would be powerful enough to atomically do things like:
1. Find the latest three snapshots, and then
2. delete those three snapshots.
With a generic API, that’d take two calls, with a possible TOCTOU in between so it wouldn’t be atomic.
But if you send that same program to the ZFS subsystem, and have it evaluate and execute the script, the subsystem would be able to guarantee atomicity, right?
it seems pretty trivial to just have some kind of "begin/end atomic section" flag or function rather than jamming in a whole special purpose scripting enviroment.
But what is the API supposed to do when it comes across a `begin` flag? Stop all filesystem activity in all programs until yours sends the `end` flag? What if that flag never arrives, e.g. due to a bug in your client code?
delay all commits to disk until a fixed timeout is reached for command submission, if the timeout is reached the call returns failed, the same problem exists with this special purpose scripting environment just in other forms.
1. Find the latest three snapshots, and then 2. delete those three snapshots.
With a generic API, that’d take two calls, with a possible TOCTOU in between so it wouldn’t be atomic.
But if you send that same program to the ZFS subsystem, and have it evaluate and execute the script, the subsystem would be able to guarantee atomicity, right?