Re: Data Deduplication with the help of an online filesystem check

Chris Mason
2009-04-29T15:45:15Z

On Wed, 2009-04-29 at 17:26 +0200, Thomas Glanzmann wrote:
> Hello Chris,
>
> > Your database should know, and the ioctl could check to see if the
> > source and destination already point to the same thing before doing
> > anything expensive.
>
> I see.
>
> > > So, if I only have file, offset, len and not the block number, is there
> > > a way from userland to tell if two blocks are already point to the same
> > > block?
>
> > You can use the fiemap ioctl.
>
> I see.
>
> One more question, in my dedup test VMs, I had a block that was often
> referenced these are the top block. The last one alone saves 3 Gbyte of
> data. My question is now, how often can a block in btrfs be refferenced?
>

The exact answer depends on if we are referencing it from a single file
or from multiple files. But either way it is roughly 2^32.

-chris