After running Clang’s analyzer on it there were quite a few places where there were mis-matched store sizes and signs. I updated them so that the underlying code more closely-matches the OS APIs and the type change happens at the FUSE connection.
In this way, if FUSE ever updates the API to actually match the APIs of modern OSes, it’s a fix in one place.
Also, I updated read/write to return the total read/write value the OS returned rather than blindly return the request count.
This feature mimics the standard mhddfs behavior but is more thorough.
If a write fails and the errno is set to ENOSPC then mergerfs will (if
the feature is enabled) attempt to move the file to the drive with
the most free space but only if it has enough room for the file plus
the amount to be written. If that transfer is successful it will then
unlink the original file and attempt the previously failed write again.
The copy includes copying the path and file including the acls, owners,
attributes, extended attributes, and timestamps.