In nbdcopy we can preserve the page cache while reading from local
files. This means (unlike O_DIRECT) using the page cache to our
advantage when a file is already present in memory. But also not
increasing the amount of file which is cached as we read it, or at
least, not by very much.
These two patches are an evolution of this patch:
https://listman.redhat.com/archives/libguestfs/2021-February/thread.html#...
Although the code is heavily conditional and so will only work on 64
bit Linux systems, I didn't bother adding a command line flag because
I feel the way this is written (modulo bugs) it should almost always
be advantageous.
Writes next -- but that's much more difficult.
Rich.