Re: [PROGS PATCH] Import btrfs-extent-same

Mark Fasheh
Tue, 13 Aug 2013 19:35:15 -0000

Hey Dave,

On Tue, Aug 06, 2013 at 05:31:12PM +0200, David Sterba
wrote:
> On Thu, Jun 27, 2013 at 12:38:19AM +0200, Gabriel de Perthuis wrote:
> > Originally from
> >
https://github.com/markfasheh/duperemove/blob/master/btrfs-extent-same.c
>
> Can you (or Mark) please turn it into a subcommand of dedup? The idea is
> to merge both in-bound and out-bound dedup into one command, eg.
>
>  btrfs dedup files dir/*

I can handle this - it''s pretty easy but we have to talk about what
we''re
expecting here.

Specifically, the btrfs-extent-same.c software is just a wrapper around the
ioctl. It never does actual reads of the files or data comparisons, etc. The
syntax you describe above seems like it wants an actual "scan these files
and dedupe them" which is a whole other ball game.

So I would suggest maybe something like the syhntax of btrfs-extent-same.c:

btrfs dedupe files len file1 loff1 file2 loff2 ...

Sound reasonable?
	--Mark

--
Mark Fasheh