Email or username:

Password:

Forgot your password?
Top-level
sam

Portage uses copy_file_range and friends when merging packages to the live filesystem when it can by providing wrappers of some Python stdlib functions.

If XFS (or another "good" backing fs is used), it can take advantage of it for you.

We've found a bunch of bugs over the years through this, in various filesystems, actually!

Take a look at wiki.gentoo.org/wiki/User:Sam/ for a list.

7 comments
sam

Fortunately, other libraries are starting to allow transparent use!

Jannik Glückert recently implemented support in libstdc++ [0][1] which will arrive in GCC 14.

[0] gcc.gnu.org/git/?p=gcc.git;a=c
[1] gcc.gnu.org/git/?p=gcc.git;a=c

sam

glib will do the same in >=2.78 thanks to gitlab.gnome.org/GNOME/glib/-/.

EDIT: I forgot to mention, KDE's kio handles it too. So, together, the respective KDE and GNOME file managers and such should be fine.

sam

And last but in no way least, GNU coreutils 9.0 defaults to --reflink=auto for cp and install.

Let me know if there's other software out there which supports this transparently.

sam

Reflinks aren't particularly new, and nor is copy_file_range or even sendfile (see the GCC commits), but it's interesting how often these improvements are sittong on the table waiting for someone to claim them.

Check the guts of your favourite libraries, you might be surprised!

sam

Bonus: I should say, zfs doesn't yet support this in a release on Linux, surprisingly.

Support was recently added on master in github.com/openzfs/zfs/pull/13 but only for FreeBSD. I believe Linux support is in the works.

sam

Bonus2: Portage >=3.0.48 won't overwrite identical files on the target filesystem as well: bugs.gentoo.org/722270. Thanks to Michael Egger for the contribution!

Go Up