]> git.ipfire.org Git - thirdparty/util-linux.git/commit - configure.ac
hardlink: rewrite files content comparison
authorKarel Zak <kzak@redhat.com>
Fri, 29 Oct 2021 11:42:58 +0000 (13:42 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 29 Oct 2021 11:42:58 +0000 (13:42 +0200)
commit259bed153a9e97d3eec0f7d90ed0cef6fa407332
tree42db5b1a68e948afd3bd632e1b4fcb0355948bfa
parentee2d371c615f5f8617fb67fad8c61f062c41da89
hardlink: rewrite files content comparison

Example:

 # hardlink --ignore-time --dry-run /var/lib

Old version, based on memcmp(), nothing cached:

 Mode:           dry-run
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       204.557185 seconds

New version, --method=memcmp, 32 bytes cached:

 Mode:           dry-run
 Method:         memcmp
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       5.248426 seconds

New version, zero-copy (Linux crypto API), sha1, crc32 and sha256:

 Mode:           dry-run
 Method:         sha1
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       2.870973 seconds

 Mode:           dry-run
 Method:         crc32
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       2.582651 seconds

 Mode:           dry-run
 Method:         sha256
 Files:          93453
 Linked:         36172 files
 Compared:       0 xattrs
 Compared:       25755615 files
 Saved:          80.11 MiB
 Duration:       3.152825 seconds

The default is sha256 to be robust..

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
misc-utils/Makemodule.am
misc-utils/hardlink.1.adoc
misc-utils/hardlink.c