linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: Shilong Wang <wangshilong1991@gmail.com>
Cc: David Sterba <dsterba@suse.cz>,
	Wang Shilong <wangsl.fnst@cn.fujitsu.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v3 10/12] Btrfs-progs: add '--block-size' option to control print result
Date: Tue, 8 Oct 2013 18:01:57 +0100	[thread overview]
Message-ID: <20131008170157.GN28147@carfax.org.uk> (raw)
In-Reply-To: <CAP9B-Qm_PmpNiKk_jmvQvti5djvbtk-hbZgT9NjFqaYWGrpGeg@mail.gmail.com>

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

On Wed, Oct 09, 2013 at 12:54:03AM +0800, Shilong Wang wrote:
> Hi David,
> 
> 2013/10/8 David Sterba <dsterba@suse.cz>:
> > On Mon, Oct 07, 2013 at 03:21:46PM +0800, Wang Shilong wrote:
> >> You can use it like:
> >>       btrfs qgroup show --block-size=m <mnt>
> >>
> >> Here, block size supports k/K/m/M/g/G/t/T/p/P/e/E.

k = SI prefix, kilo
K = ? (IEEE prefix kibi?)
m = SI prefix, milli
M = SI prefix, mega
g = SI unit, grams
G = SI prefix, giga
t = ?
T = SI prefix, tera
p = SI prefix, pico
P = SI prefix, peta
e = ?
E = SI prefix, exa

   Some confusion here, I think. :)

> > There is no distinction between the 1000 and 1024 based prefixes, also
> > no way to get the raw values in bytes. I don't have a suggestion how to
> > do that, merely letting you know that this could go separately (this and
> > the "-h" patch, the rest shall be integrated).
> 
> I implement this like the command 'du'.
> 
> In default, we print result in bytes. And block size don't give a byte
> unit implicitly.

> Aslo i don't know why we need to distinct 1000 and 1024, i don't
> have any ideas about this.

   Because when you have a terabyte of data, the difference between
the two is 10%. If you're putting in this kind of infrastructure, it's
not much of an addition to report in either SI decimal or IEEE binary
scales.

> > Also, the numbers in the table should be aligned to the right:
> 
> Yes, this should be fixed.
> 
> Thanks,
> Wang
> >
> > $ btrfs qgroup show -h -p /mnt/
> > qgroupid rfer      excl      parent
> > -------- ----      ----      ------
> > 0/5      900.00KiB 900.00KiB ---
> > 0/267    688.00KiB 12.00KiB  1/5
> > 0/268    684.00KiB 8.00KiB   1/5
> > 0/269    6.71GiB   4.00KiB   1/1
> > 0/277    6.71GiB   4.00KiB   1/1
> > 0/278    39.74GiB  39.74GiB  1/2
> > 1/1      6.71GiB   6.71GiB   ---
> > 1/2      39.74GiB  39.74GiB  ---
> > 1/5      696.00KiB 696.00KiB ---

   Note that the SI mandate a space between the value and the unit.
Note also, for future reference, that SI use k for 10^3, whereas IEEE
use Ki for 2^10.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- I'll take your bet, but make it ten thousand francs. I'm only ---  
                       a _poor_ corrupt official.                        

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

  reply	other threads:[~2013-10-08 17:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07  7:21 [PATCH v3 00/12] enhance btrfs qgroup show command Wang Shilong
2013-10-07  7:21 ` [PATCH v3 01/12] Btrfs-progs: restructure show_qgroups Wang Shilong
2013-10-07  7:21 ` [PATCH v3 02/12] Btrfs-progs: introduces '-p' option to print the ID of the parent qgroups Wang Shilong
2013-10-08 15:06   ` David Sterba
2013-10-07  7:21 ` [PATCH v3 03/12] Btrfs-progs: introduces '-c' option to print the ID of the child qgroups Wang Shilong
2013-10-08 15:08   ` David Sterba
2013-10-07  7:21 ` [PATCH v3 04/12] Btrfs-progs: introduce '-r' option to print max referenced size of qgroups Wang Shilong
2013-10-07  7:21 ` [PATCH v3 05/12] Btrfs-progs: introduce '-e' option to print max exclusive " Wang Shilong
2013-10-07  7:21 ` [PATCH v3 06/12] Btrfs-progs: list all qgroups impact given path(include ancestral qgroups) Wang Shilong
2013-10-07  7:21 ` [PATCH v3 07/12] Btrfs-progs: list all qgroups impact given path(exclude " Wang Shilong
2013-10-07  7:21 ` [PATCH v3 08/12] Btrfs-progs: enhance btrfs qgroup show to sort qgroups Wang Shilong
2013-10-07  7:21 ` [PATCH v3 09/12] Btrfs-progs: enhance btrfs qgroup to print the result as a table Wang Shilong
2013-10-07  7:21 ` [PATCH v3 10/12] Btrfs-progs: add '--block-size' option to control print result Wang Shilong
2013-10-08 15:34   ` David Sterba
2013-10-08 16:27     ` Shilong Wang
2013-10-08 16:34       ` Shilong Wang
2013-10-08 16:34       ` David Sterba
2013-10-08 16:54     ` Shilong Wang
2013-10-08 17:01       ` Hugo Mills [this message]
2013-10-08 17:10         ` Hugo Mills
2013-10-07  7:21 ` [PATCH v3 11/12] Btrfs-progs: make pretty_size_snprintf() return len Wang Shilong
2013-10-07  7:21 ` [PATCH v3 12/12] Btrfs-progs: add '-h' options to print sizes in human readable format Wang Shilong

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=20131008170157.GN28147@carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@gmail.com \
    --cc=wangsl.fnst@cn.fujitsu.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).