All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Mark Fasheh <mfasheh@suse.de>
Cc: David Sterba <dsterba@suse.cz>,
	btrfs <linux-btrfs@vger.kernel.org>,
	Jeff Mahoney <jeffm@suse.com>
Subject: Re: [PATCH][RFC] btrfs-progs: add 'du' command
Date: Wed, 29 Apr 2015 19:19:18 +0200	[thread overview]
Message-ID: <20150429171918.GC4996@twin.jikos.cz> (raw)
In-Reply-To: <20150423211206.GQ17170@wotan.suse.de>

On Thu, Apr 23, 2015 at 02:12:06PM -0700, Mark Fasheh wrote:
> This patch adds a 'du' subcommand to btrfs. 'btrfs fi du' will
> calculate disk usage of the target files using fiemap. For individual
> files, it will report a count of total bytes, and exclusive (not
> shared) bytes. We also calculate a 'set shared' value which is
> described below.

The functionality is useful, I personally like it and have seen people
on irc to ask about this.

The question is whether we want to add this to a btrfs command or to the
'du' utility itself. AFAICS it's not built around FIEMAP, so I guess
this would be an intrusive change.

> Following this paragraph is a very simple example. I started with a
> clean btrfs fs in which i copied vmlinuz from /boot. I then made a
> snapshot of the fs root in 'snap1'. After the snapshot, I made a 2nd
> copy of vmlinuz into the main fs to give us some not-shared data. The
> output below shows a sum of all the space, and a 'set shared' with len
> exactly equal to that of the single shared file.
> 
> # btrfs fi du .
> total	exclusive	set shared	filename
> 4362240	0			./vmlinuz-4.0.0-rc7
> 4362240	0			./snap1/vmlinuz-4.0.0-rc7
> 4362240	0			./snap1
> 4362240	4362240			./vmlinuz-4.0.0-rc7.copy
> 13086720	4362240	4362240	.

I guess the next thing people will want to see is the compressed size.

> A git tree of the patches can be found here:
> 
> https://github.com/markfasheh/btrfs-progs-patches/tree/du

The file interval_tree.h seems missing and build fails.

  reply	other threads:[~2015-04-29 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 21:12 [PATCH][RFC] btrfs-progs: add 'du' command Mark Fasheh
2015-04-29 17:19 ` David Sterba [this message]
2015-05-05 19:46   ` Mark Fasheh
2015-05-13 15:35     ` David Sterba

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=20150429171918.GC4996@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=jeffm@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mfasheh@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.