From: Martin Steigerwald <Martin@lichtvoll.de>
To: linux-btrfs@vger.kernel.org
Cc: Goffredo Baroncelli <kreijack@gmail.com>,
Bart Noordervliet <bart@noordervliet.net>,
Hugo Mills <hugo@carfax.org.uk>
Subject: Re: [PATCH][BTRFS-PROGS][V1] btrfs filesystem df
Date: Fri, 12 Oct 2012 11:42:32 +0200 [thread overview]
Message-ID: <201210121142.32974.Martin@lichtvoll.de> (raw)
In-Reply-To: <50746B51.9050800@gmail.com>
Hi Goffredo, Bart, Hugo,
Am Dienstag, 9. Oktober 2012 schrieb Goffredo Baroncelli:
> On 10/09/2012 02:51 PM, Bart Noordervliet wrote:
> > On Tue, Oct 9, 2012 at 1:38 PM, Goffredo
Baroncelli<kreijack@gmail.com> wrote:
> >> Hi Bart,
> >>
> >> I replayed in another email to Hugo about that. Basically I am not
> >> contrary to the change, only it is unrelated to my patches. In may
> >> patches I use the function pretty_sizes() which adds the suffix KB,
> >> MB, and this function was here from 2008....
> >
> > What we could do is change all callers to use pretty_sizes_r(), which
> > most already do. We could then add a mode flag for SI units, say
> > DF_HUMAN_SI_UNIT. I would then propose that we enable it by default,
> > like the human-readable mode itself, and create an option to disable
> > it.
> >
> > I like options a lot, but I like sensible defaults as well. We're
> > hoping btrfs will be the next major filesystem for linux. If we
> > succeed, it will have a long lifespan and be used on petabyte and
> > maybe exabyte storage systems. If we keep showing binary bytes, the
> > discrepancy between what the drive's box says and what 'df' says will
> > become ever larger.
>
> Pay attention to the fact that the hard-disk manufacturers use the SI
> units, but all the OS works in IEC (KiB, MiB...) units. E.g. btrfs
> allocates chunk in unit of 256MB; the chunks are divided in pages
> (4KiB). I am not fully convinced that we should use SI everywhere; may
> be that let the user to select in which unit system the result should
> be printed may be the best compromise.
I second this.
df -h is binary by default, du -h too. There is an option to change to
power to ten (--si).
LVM commands are binary by default as well.
KDE applications like Dolphin show KiB, MiB, GiB since quite some time.
For file sizes and if enabled for amount of free space as well.
Only fdisk / cfdisk / parted are using power of ten, but they are rarely
used.
If now btrfs filesystem df shows power of ten by default, a user could be
surprised why a 100 MiB file does not fit on a drive with 103 MB free.
So I do not see much sense in using power of ten in just one place. If
changing to power of ten by default, I think its good to do it everywhere.
And that would require some kind of coordinated effort. And it would break
scripts relying on binary output of df -h and du -h. I think its not wise
of scripts to do that, heck I am quite skeptical of parsing command output
thats formatted for the user at all, but…
Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
next prev parent reply other threads:[~2012-10-12 9:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 11:43 [PATCH][BTRFS-PROGS][V1] btrfs filesystem df Goffredo Baroncelli
2012-10-03 11:43 ` [PATCH 1/2] Update btrfs filesystem df command Goffredo Baroncelli
2012-10-03 15:02 ` Ilya Dryomov
2012-10-03 16:34 ` Goffredo Baroncelli
2012-10-03 17:20 ` Ilya Dryomov
2012-10-03 17:38 ` Goffredo Baroncelli
2012-10-03 17:09 ` Goffredo Baroncelli
2012-10-03 11:43 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-03 11:56 ` [PATCH][BTRFS-PROGS][V1] btrfs filesystem df Hugo Mills
2012-10-03 16:17 ` Goffredo Baroncelli
2012-10-03 16:34 ` Hugo Mills
2012-10-09 9:43 ` Bart Noordervliet
2012-10-09 11:38 ` Goffredo Baroncelli
2012-10-09 12:51 ` Bart Noordervliet
2012-10-09 18:22 ` Goffredo Baroncelli
2012-10-12 9:42 ` Martin Steigerwald [this message]
2012-10-03 15:01 ` Ilya Dryomov
2012-10-03 16:46 ` Goffredo Baroncelli
2012-10-03 17:46 ` Ilya Dryomov
2012-10-03 20:01 ` Goffredo Baroncelli
2012-10-03 20:24 ` Ilya Dryomov
2012-10-12 10:01 ` Martin Steigerwald
2012-10-12 9:55 ` Martin Steigerwald
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=201210121142.32974.Martin@lichtvoll.de \
--to=martin@lichtvoll.de \
--cc=bart@noordervliet.net \
--cc=hugo@carfax.org.uk \
--cc=kreijack@gmail.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 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).