linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: Anand Jain <Anand.Jain@oracle.com>
Cc: Wang Shilong <wangshilong1991@gmail.com>,
	dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free
Date: Wed, 09 Oct 2013 16:35:58 +0800	[thread overview]
Message-ID: <5255156E.5010808@cn.fujitsu.com> (raw)
In-Reply-To: <52550DC3.8080807@oracle.com>

On 10/09/2013 04:03 PM, Anand Jain wrote:
> Wang,
>
>
>> 1. First to search inline extent_data
>> 2. Secondly search in extent tree to calculate (extent refs=1)
> but these extents will be of entire fs, how do you filter it for a subvol ?
Sorry, this could not be true as i have expected,(we have to iterate
extent tree with my approach)

If we considered both metadata and data for a subvolume, we just iterate
all the extent items in
the extent tree and add those extents into subvolume's sole size iff:

1> extent ref=1
2> backref root=subvol

However, this also may come very *slowly* when extent tree comes very large.

Thanks,
Wang
>  
>
> Thanks, Anand
>
>> This will avoid n*n rather than n+n which is better…
> --
> 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:[~2013-10-09  8:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 16:45 [PATCH] btrfs-progs: calculate disk space that a subvol could free Anand Jain
2013-09-27 19:10 ` Zach Brown
2013-09-28 17:19   ` Anand Jain
2013-09-29 15:02     ` Anand Jain
2013-10-01 13:25       ` David Sterba
2013-09-29 15:15 ` [PATCH V2] btrfs-progs: device add should check existing FS before adding Anand Jain
2013-09-29 15:26   ` Anand Jain
2013-09-29 15:25 ` [PATCH v2] btrfs-progs: calculate disk space that a subvol could free Anand Jain
2013-10-01 13:39   ` David Sterba
2013-10-01 14:05     ` Wang Shilong
2013-10-07  2:47       ` Anand Jain
2013-10-07  3:01         ` Wang Shilong
2013-10-07  3:22           ` Anand Jain
2013-10-08 16:49         ` David Sterba
2013-10-09 14:17           ` Wang Shilong
2013-10-10  3:35             ` Anand Jain
2013-10-10  3:33               ` Wang Shilong
2013-11-28 17:39                 ` Alex Lyakas
2013-11-29  1:34                   ` Wang Shilong
2013-11-29  1:57                     ` Anand Jain
2013-10-09  8:03       ` Anand Jain
2013-10-09  8:35         ` Wang Shilong [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=5255156E.5010808@cn.fujitsu.com \
    --to=wangsl.fnst@cn.fujitsu.com \
    --cc=Anand.Jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@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 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).