Re: [PATCH][BTRFS-PROGS][V1] btrfs filesystem df

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux