Is there a way on #ZFS or #BTRFS to create a file that is the concatenation of two files?
So, cat a b > ab, but only taking up metadata?
Is the best way to just do the write and then ask the kernel to deduplicate it, and pray that it doesn't flush to disk in the meantime?
This would be really useful for serving smaller chunks of packages on #NixOS or #Guix, but also potentially on other distros as well, or even for general download optimization. (cc #bittorrent ?)
edit: Thanks, apparently there is an ioctl for this:
https://man7.org/linux/man-pages/man2/ioctl_ficlonerange.2.html