linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][btrfs-progs] add command btrfs filesystem info
@ 2012-06-08 19:12 Goffredo Baroncelli
  2012-06-08 19:12 ` [PATCH 1/3] Btrfs-progs: make two utility functions globally available Goffredo Baroncelli
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Goffredo Baroncelli @ 2012-06-08 19:12 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Stefan Behrens

Hi all

the aim of this patch is to add the command "btrfs filesystem info" to 
show some filesystem information. Example:

$ sudo btrfs-progs/btrfs filesystem info /mnt/test
Path: /mnt/test
Max ID: 4
UUID: 1c7e4ba6-aebc-4b39-90ef-c61315fb74d1

Num devices: 3
  Dev ID: 2
  UUID: cdbda186-735e-49cd-babc-e84fffdb4105
  Bytes used: 511705088
  Total bytes: 1667235840
  Path: /dev/loop1
  Dev ID: 3
  UUID: a4cebf4e-f760-49a7-b960-142b2c14d9e6
  Bytes used: 0
  Total bytes: 1111490560
  Path: /dev/loop2
  Dev ID: 4
  UUID: 61bd5825-f86e-4708-8a5b-f48764b5c3a5
  Bytes used: 0
  Total bytes: 1111490560
  Path: /dev/loop3

I make that because it is not so trivial to get these information otherwise.

To get the information, I made public and used: scrub_device_info() and 
scrub_fs_info(). So, I moved the functions to the file utils.c changing 
scrub_ to get_. I was inspired by a patch of Stefan Behrens.

Next enhancements:
- remove the root privileges to launch the command (require change in
kernel space)
- show also the label of the filesystem (same as above)

Please review; as usual, comments are welcome.

You can pull the changes from the reposiotry
	http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git
branch 
	filesystem-info

BR
G.Baroncelli

 Makefile          |    8 +++---
 cmds-filesystem.c |   59 ++++++++++++++++++++++++++++++++++++++++++++
 cmds-scrub.c      |   72 +-----------------------------------------------------
 man/btrfs.8.in    |    8 ++++++
 utils.c           |   68 +++++++++++++++++++++++++++++++++++++++++++++++++++
 utils.h           |    4 +++
 6 files changed, 145 insertions(+), 74 deletions(-)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-09  5:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 19:12 [RFC][btrfs-progs] add command btrfs filesystem info Goffredo Baroncelli
2012-06-08 19:12 ` [PATCH 1/3] Btrfs-progs: make two utility functions globally available Goffredo Baroncelli
2012-06-08 19:12 ` [PATCH 2/3] Add btrfs filesystem info command Goffredo Baroncelli
2012-06-08 19:12 ` [PATCH 3/3] Add btrfs filesystem info man page Goffredo Baroncelli
2012-06-08 19:21   ` Jérôme Poulin
2012-06-09  5:36     ` Goffredo Baroncelli

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).