Hi, I would like to implement cp --reflink support for ZFSOnLinux as my GSoC project.
cp --reflink is used to create a COW copy of a file, so the file will not take any disk space if it's not modified. This feature is very useful for cases like storing a lot of almost identical virtual machine images. Also this is a frequently requested feature for ZoL. [1][2][3] Currently only btrfs support this feature, so my goal it to bring it to ZoL as well. I think the only way to do it (without changing too many parts of ZoL) is to use the deduplication feature of zfs. A COW copy could be done by create a new entry in ddt for the old file, and create a new file which points to the ddt entry. Please let me know if this proposal makes sense, and if that's the right way to do it. Thanks. [1]: https://groups.google.com/a/zfsonlinux.org/forum/#!topic/zfs-discuss/mvGB7QEpt3w [2]: https://github.com/zfsonlinux/zfs/issues/405 [3]: https://github.com/zfsonlinux/zfs/issues/1063 -- Regards Yuxuan Shui