hoytech/vmtouch — pull request #10 by C-Otto (2013-07-19 07:57:10+00:00)
Title: ignore hardlink duplicates by default

This introduces a new default behaviour that can be deactivated using the new switch '-h'.

Files that are hardlinked copies are now counted only once. As an example:

$ dd if=/dev/zero of=first bs=10M count=1
$ cp -al first second
$ vmtouch first second # new behaviour
Files: 1
Directories: 0
Resident Pages: 2560/2560 10M/10M 100%
Elapsed: 0.000571 seconds
$ ./vmtouch -h first second # old behaviour
Files: 2
Directories: 0
Resident Pages: 5120/5120 20M/20M 100%
Elapsed: 0.000803 seconds

As you can see, the old behaviour (after applying the patch possible with '-h') produces output which does not make a lot of sense, as only 10 MByte of real data are cached.