From: Liu Bo <bo.li.liu@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org, pth@suse.de,
sf@suse.de, jeff.liu@oracle.com
Subject: Re: [RFC PATCH] Btrfs: export btrfs space shared info to userspace
Date: Thu, 29 Aug 2013 11:06:49 +0800 [thread overview]
Message-ID: <20130829030648.GB22790@localhost.localdomain> (raw)
In-Reply-To: <20130828172938.GF23113@twin.jikos.cz>
On Wed, Aug 28, 2013 at 07:29:38PM +0200, David Sterba wrote:
> On Fri, Aug 16, 2013 at 04:27:28PM +0800, Liu Bo wrote:
> > Similar to ocfs2, btrfs also supports that extents can be shared by
> > different inodes, and there are some userspace tools requesting
> > for this kind of 'space shared infomation'.[1]
> >
> > ocfs2 uses flag FIEMAP_EXTENT_SHARED, so does btrfs.
>
> Looks ok to me.
>
> > + int ref_cnt = 0;
>
> I think using long is cleaner here, it always fits into (void*), int
> does not.
Good point.
>
> > + /*
> > + * As btrfs supports shared space, this information
> > + * can be exported to userspace tools via
> > + * flag FIEMAP_EXTENT_SHARED.
> > + */
> > + ret = iterate_inodes_from_logical(
> > + em->block_start,
> > + BTRFS_I(inode)->root->fs_info,
> > + path, count_ext_ref, &ref_cnt);
> > + if (ret < 0)
> > + goto out_free;
> > +
> > + if (ref_cnt > 1)
> > + flags |= FIEMAP_EXTENT_SHARED;
>
> AFAICS, e2fsprogs filefrag does not yet know about FIEMAP_EXTENT_SHARED.
With checking filefrag's code, it's easy to make filefrag aware of this
flag.
I'll make a patch for filefrag unless someone has already done it, thanks.
-liubo
prev parent reply other threads:[~2013-08-29 3:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 8:27 [RFC PATCH] Btrfs: export btrfs space shared info to userspace Liu Bo
2013-08-28 17:29 ` David Sterba
2013-08-29 3:06 ` Liu Bo [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=20130829030648.GB22790@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=dsterba@suse.cz \
--cc=jeff.liu@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=pth@suse.de \
--cc=sf@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).