OpenZFS, a well-known and modern file system, evolved from the original ZFS developed for OpenSolaris and is now predominantly developed for FreeBSD and Linux. Its copy-on-write model enables powerful features such as an always-consistent on-disk state, along with rapid file system snapshots and clones. A frequently requested feature by users has been the ability to clone individual files, a need highlighted by the introduction of the copy_file_range(2) system call, which could leverage such functionality.
This presentation will delve into the implementation of block cloning in OpenZFS, outlining the challenges encountered and the solutions devised to overcome them, thus enhancing the system's capabilities and efficiency.