]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cp: use copy_file_range(2)
authorAlan Somers <asomers@FreeBSD.org>
Thu, 10 Sep 2020 02:48:55 +0000 (02:48 +0000)
committerAlan Somers <asomers@FreeBSD.org>
Thu, 10 Sep 2020 02:48:55 +0000 (02:48 +0000)
commitc01816a97fd516359000b1f0635f320b77ec0b00
tree6a247f8e46add2a2f72da79d1fa74b069af65255
parent5c74d551d2c5618b41e741eaa3af84bfc7d79c88
cp: use copy_file_range(2)

This has three advantages over write(2)/read(2):

* Fewer context switches and data copies
* Mostly preserves a file's sparseness
* On some file systems (currently NFS 4.2) the file system will perform the
  copy in an especially efficient way.

Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26377
bin/cp/utils.c