meven added a comment.
copy https://github.com/coreutils/coreutils/blob/master/src/copy.c#L301 use https://man7.org/linux/man-pages/man2/copy_file_range.2.html or https://github.com/coreutils/gnulib/blob/master/lib/full-write.h Did not know about copy_file_range, it was introduced in kernel 4.5 and improved/reworked in 5.3 apparently. It is simply newer than sendfile (but older than io_uring), it seems to be just almost a drop-in replacement for sendfile with reflink aka COW support for supporting fs built-in. That should be the next area for investigation, it is way simpler than our current reflink support, but it is Linux only. TASK DETAIL https://phabricator.kde.org/T12641 To: meven Cc: apol, dfaure, #frameworks, #dolphin, ognarb, broulik, meven, sdorishlab, badbunny, waitquietly, azyx, nikolaik, pberestov, iasensio, aprcela, fprice, LeGast00n, koehn, cblack, fbampaloukas, alexde, Codezela, feverfew, michaelh, ahmadsamir, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, rdieter, mikesomov, vkrause