]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r282482: cp: Remove fts sorting.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 14 May 2015 10:46:20 +0000 (10:46 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 14 May 2015 10:46:20 +0000 (10:46 +0000)
commit4157fa33fbb3968f2b24e67cff389ba89c499786
tree74ec94a519a2ff1ef23088a25c109bd0ce4e03ef
parentc62ce94d1cca1028f1dfc92ece7a6c6d3305ba69
MFC r282482: cp: Remove fts sorting.

In an attempt to improve performance, cp reordered directories first
(although the comment says directories last). This is not effective with new
UFS layout policies.

The sorting reorders multiple arguments passed to cp, which may be
undesirable.

Additionally, the comparison function does not induce a total order. Per
POSIX, this causes undefined behaviour in qsort().

NetBSD removed the sorting in 2009.

On filesystems that return directory entries in hash/btree order, sorting by
d_fileno before statting improves performance on large directories. However,
this can only be implemented in fts(3).

PR: 53475
Reviewed by: bde (in 2004)

git-svn-id: svn://svn.freebsd.org/base/stable/10@282890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/cp/cp.c