On Mon, Oct 15, 2012 at 07:09:23PM +0200, Bob Marley wrote: > I would really appreciate a systemcall (or ioctl or the like) to allow > deduplication of a block of a file against a block of another file. > (ok if blocks need to be aligned to filesystem blocks)
It exists, is called BTRFS_IOC_CLONE_RANGE (http://lxr.free-electrons.com/source/fs/btrfs/ioctl.h#L399) btrfs_ioctl_clone_range_args http://lxr.free-electrons.com/source/fs/btrfs/ioctl.h#L254 > The syscall should presumably check that the regions are really equal and > perform the deduplication atomically. > > This would be the start for a lot of deduplication algorithms in userspace. > It would be a killer feature for backup systems. It doesn't do any checks if the range contents match, but for a backup system, the ranges can be merged at a calm state, ie not new data in flight. david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html