All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: dave@jikos.cz, "Liu Bo" <liub.liubo@gmail.com>,
	"Gábor Nyers" <gnyers@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: How to find (out if) files sharing content?
Date: Tue, 06 Nov 2012 11:53:51 +0800	[thread overview]
Message-ID: <509889CF.30302@oracle.com> (raw)
In-Reply-To: <20121105224504.GN3102@twin.jikos.cz>

On 11/06/2012 06:45 AM, David Sterba wrote:
> On Wed, Oct 31, 2012 at 09:02:15PM +0800, Jeff Liu wrote:
>> I propose this because OCFS2 report shared space in this way combine with du(1).
>>
>> An old patch set to teach du(1) aware of reflinked file:
>> https://oss.oracle.com/pipermail/ocfs2-devel/2010-September/007293.html
> 
> Patch looks ok, the shared size is requested by an option.
> 
>> Do you means that the costs is very expensive for userland extent status checkup per file?
> 
> The most expensive part is IMO not in userspace, it does in-memory lookups.
> 
>>> And without any possibility to turn this off,I'm afraid this will render FIEMAP unusable in practice.
>> For OCFS2, the FIEMAP_EXTENT_SHARED flag will be set upon fiemap ioctl(2) if an extent
>> is OCFS2_EXT_REFCOUNTED(i.e. reflinked or cloned), which means that FIEMAP_EXTENT_SHARED
>> is not a persistent flag, but I have no idea how Btrfs would be in this point. :(
> 
> After some research, I think this could work for btrfs without
> unwanted performance penalties.
> 
> There's the fiemap::fm_flags field that can be extended to request the
> shared extent info from fiemap, so the information is not computed
> unconditionally (that was my concern before). The rest is only
> implementation details how to speed up the file extent -> refcount info
> lookups.
Thanks for your confirmation.

-Jeff
> 
> david
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


      reply	other threads:[~2012-11-06  3:54 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
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 [this message]

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=509889CF.30302@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=dave@jikos.cz \
    --cc=gnyers@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liub.liubo@gmail.com \
    /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.