"Alex Xu (Hello71)" alex_y_xu@yahoo.ca writes:
Excerpts from Fabian Maurer's message of January 27, 2022 5:24 pm:
Hello,
first, thanks for working on this, would be a welcome improvement! Do I understand that right that it wouldn't work for ext4 and there's not really anything we could do to support it?
Regards, Fabian Maurer
ext4 does not support reflink, so copy_file_range cannot reduce disk space usage. However, it will still allow the kernel to do the file copy itself, avoiding copying the data to userspace.
Full reflink functionality with arbitrary offsets and overwrite is non-trivial to implement in the filesystem. However, we really only need the limited functionality of a whole-file reflink. This could be simulated using a hard or symbolic link which gets broken by Wine when any write occurs. However, as with reparse points, this requires modifying every file access that Wine makes, which would be a significant undertaking.
I'm not convinced that it would be that hard, and if it can work it would clearly be a better approach. Prefix size is a real problem, but I don't think reflinks are the answer.