[PATCH v2 0/5] Implement reflink support
bshanks at codeweavers.com
Thu Aug 5 00:05:40 CDT 2021
> On Aug 4, 2021, at 9:40 AM, Alex Xu (Hello71) <alex_y_xu at yahoo.ca> wrote:
> Over the years, Wine prefixes have gotten bigger and bigger, for a
> number of reasons. Creating a new Wine prefix for each application is
> still the current recommendation, as despite the best efforts of Wine
> developers, some applications still require system-wide workarounds.
> This leads to significant bloat for each application installed. With a
> MinGW build of Wine without Mono or Gecko, new 32-bit prefixes are over
> 150 MB, and new 64-bit prefixes are over 300 MB. The vast majority of
> these files are byte-for-byte identical to Wine's central DLL copies.
> This patch set implements reflink support in Wine via the
> copy_file_range syscall. The reasons for selecting copy_file_range over
> FICLONE are outlined in patch 2. A previous unpublished version of this
> patch set used FICLONERANGE, but it was less convenient to use from
> setupapi and has inferior system support.
This is a separate issue from your patch, but it would be nice if we could implement this functionality on macOS as well. Unfortunately macOS doesn’t support copy_file_range(). The lowest-level interface for CoW clones is clonefile(), which can only create new files, not replace parts of existing ones: <https://www.unix.com/man-page/mojave/2/fclonefileat/>
I’m not sure if there’s any clear way to use that from Wine.
More information about the wine-devel