Date: Sun, 02 Nov 2008 02:27:59 +0200 From: Giorgos Keramidas <keramida@freebsd.org> To: Max Laier <max@love2party.net> Cc: freebsd-hackers@freebsd.org, koitsu@freebsd.org, pjd@freebsd.org, Pete French <petefrench@ticketswitch.com>, lhmwzy@gmail.com Subject: Re: du -A / -B options [Re: zfs quota question] Message-ID: <87zlkjvunk.fsf@kobe.laptop> References: <E1KnA2b-0007ls-8u@dilbert.ticketswitch.com> <200810071314.45922.max@love2party.net> <200811012114.43137.max@love2party.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Nov 2008 21:14:42 +0100, Max Laier <max@love2party.net> wrote: > Hi, > a thread on freebsd-stable@ [1] about problems with du(1) and > compressed zfs filesystems got me looking for a possible solution. > Attached is a diff for du(1) that adds two new options: > > -A to display the apparent size of the file instead of the used blocks. > -B bsize to specify a custom blocksize. In particular one <512byte That's nice :) % Index: du.1 % =================================================================== % --- du.1 (revision 184513) % +++ du.1 (working copy) % @@ -60,6 +61,14 @@ % .Pp % The options are as follows: % .Bl -tag -width indent % +.It Fl A % +Display the apparent size instead of the diskusage. 'disk usage' should be two words here. % +This can be helpful to find sparse files and when operating on % +compressed volumes. ``This can be helpful when operating on sparse files or compressed volumes'' maybe? The fact that a difference between plain `du' and `du -A' output may be a nice hack to find sparse files is a cool side-effect, but that's not really the main driving force behind the change, right? :) % Index: du.c % =================================================================== % --- du.c (revision 184513) % +++ du.c (working copy) % @@ -86,27 +86,39 @@ % FTS *fts; % FTSENT *p; % off_t savednumber = 0; % - long blocksize; % + long blocksize = 0; savednumber is one of the existing style bugs. We shouldn't copy it, but initialize `blocksize' further down, near `depth = INT_MAX' and the rest of the initializations. > Thoughts? FWIW, I like the new options :)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87zlkjvunk.fsf>