]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
btrfs: offline dedupe
authorMark Fasheh <mfasheh@suse.de>
Tue, 6 Aug 2013 18:42:51 +0000 (11:42 -0700)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:05:00 +0000 (08:05 -0400)
commit416161db9b63e353a8fb79d1369779175102fca1
tree60627f898b85d3173e83222d12fc9f677e84730e
parent4b384318a74e38eb248f74f9a92a700d2ce841f1
btrfs: offline dedupe

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: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Zach Brown <zab@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c
include/uapi/linux/btrfs.h