All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: "Gábor Nyers" <gnyers@suse.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: How to find (out if) files sharing content?
Date: Tue, 30 Oct 2012 15:39:22 +0000	[thread overview]
Message-ID: <20121030153922.GA11422@carfax.org.uk> (raw)
In-Reply-To: <20121030162005.0308d5a2@lupus.demo.lan>

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

On Tue, Oct 30, 2012 at 04:20:05PM +0100, Gábor Nyers wrote:
> Hi,
> 
> How could one find out if 2 files share any extents on a btrfs file system?
> 
> A more generic variation of the above: How to list files on the same
> file system/subvolume sharing content?

   You have direct (read-only) access to the metadata trees through
the TREE_SEARCH ioctl. It should be possible to walk through the
extents of a given file, and (I think) follow back-refs from the
extent back to the other files that share it.

   There's no simple code to do that right now, though.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- And what rough beast,  its hour come round at last / slouches ---  
                     towards Bethlehem,  to be born?                     

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2012-10-30 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 15:20 How to find (out if) files sharing content? Gábor Nyers
2012-10-30 15:39 ` Hugo Mills [this message]
2012-10-30 15:58   ` Jan Schmidt
2012-10-31  0:40 ` Liu Bo
2012-10-31  2:30   ` Jeff Liu
2012-10-31 11:31     ` David Sterba
2012-10-31 13:02       ` Jeff Liu
2012-11-05 22:45         ` David Sterba
2012-11-06  3:53           ` Jeff Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121030153922.GA11422@carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=gnyers@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.