• Mark Fasheh's avatar
    btrfs: offline dedupe · 416161db
    Mark Fasheh authored
    This patch adds an ioctl, BTRFS_IOC_FILE_EXTENT_SAME which will try to
    de-duplicate a list of extents across a range of files.
    
    Internally, the ioctl re-uses code from the clone ioctl. This avoids
    rewriting a large chunk of extent handling code.
    
    Userspace passes in an array of file, offset pairs along with a length
    argument. The ioctl will then (for each dedupe) do a byte-by-byte comparison
    of the user data before deduping the extent. Status and number of bytes
    deduped are returned for each operation.
    Signed-off-by: default avatarMark Fasheh <mfasheh@suse.de>
    Reviewed-by: default avatarZach Brown <zab@redhat.com>
    Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
    Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
    416161db
ioctl.c 106 KB