pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.99k stars 79 forks source link

Use zfs opportunistic block cloning (like `cp --reflink=auto`) #279

Open kc9jud opened 1 month ago

kc9jud commented 1 month ago

For various technical reasons, it is not possible to reflink between different ZFS datasets. However, instead of calling ioctl(FICLONE) one can call copy_file_range() which ZFS will try to handle with block cloning, but not always. It might be useful to have fclones dedupe mimic the behavior of coreutils>=9.1 which tries ioctl(FICLONE) and then falls back to copy_file_range(), at least if the files are on a ZFS dataset.