linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@gmail.com>
To: Anand jain <Anand.Jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 4/4] Btrfs-progs: add btrfs subvol show cli
Date: Sat, 13 Oct 2012 22:21:54 +0200	[thread overview]
Message-ID: <5079CD62.4070206@gmail.com> (raw)
In-Reply-To: <1350019254-22036-5-git-send-email-Anand.Jain@oracle.com>

On 2012-10-12 07:20, Anand jain wrote:
> From: Anand Jain<anand.jain@oracle.com>
>
> This will add a sub command to show information about a subvol.
> eg:
> btrfs su show /btrfs/sssv3
> /btrfs/sssv3
> 	uuid: 		c5d646b5-a749-c646-b082-6d9a3ca870be
> 	Parent uuid: 	34bc8edd-113f-5141-a814-f6dfae069b01
> 	Creation time: 	2012-10-12 11:37:00
>

> +
> +/*	if in case we decide to have more available data
> +	to be shown we can use it as below.
> +
> +	printf("Object ID: %llu", get_ri.root_id);
> +	printf("\n");
> +	printf("Generation: %llu", get_ri.gen);
> +	printf("\n");
> +	printf("OGeneration: %llu", get_ri.ogen);
> +	printf("\n");
> +	printf("Parent: %llu", get_ri.ref_tree);
> +	printf("\n");
> +	printf("Top Level: %llu", get_ri.top_id);
> +	printf("\n");
> +*/

Please, add a switch to show this further data. Does the flags contains 
sensible data ?

> +
> +	/* clean up */
> +	if (get_ri.path)
> +		free(get_ri.path);
> +	if (get_ri.name)
> +		free(get_ri.name);
> +	if (get_ri.full_path)
> +		free(get_ri.full_path);
> +
> +	close(fd);
> +	free(mnt);
> +	return 0;
> +}
> +
>   const struct cmd_group subvolume_cmd_group = {
>   	subvolume_cmd_group_usage, NULL, {
>   		{ "create", cmd_subvol_create, cmd_subvol_create_usage, NULL, 0 },
> @@ -714,6 +826,7 @@ const struct cmd_group subvolume_cmd_group = {
>   		{ "set-default", cmd_subvol_set_default,
>   			cmd_subvol_set_default_usage, NULL, 0 },
>   		{ "find-new", cmd_find_new, cmd_find_new_usage, NULL, 0 },
> +		{ "show", cmd_subvol_show, cmd_subvol_show_usage, NULL, 0 },
>   		{ 0, 0, 0, 0, 0 }
>   	}
>   };
> diff --git a/man/btrfs.8.in b/man/btrfs.8.in
> index 9222580..57c25b0 100644
> --- a/man/btrfs.8.in
> +++ b/man/btrfs.8.in
> @@ -17,6 +17,8 @@ btrfs \- control a btrfs filesystem
>   .PP
>   \fBbtrfs\fP \fBsubvolume get-default\fP\fI<path>\fP
>   .PP
> +\fBbtrfs\fP \fBsubvolume show\fP\fI<path>\fP
> +.PP
>   \fBbtrfs\fP \fBfilesystem defragment\fP -c[zlib|lzo] [-l \fIlen\fR] \
>   [-s \fIstart\fR] [-t \fIsize\fR] -[vf]<\fIfile\fR>|<\fIdir\fR>  \
>   [<\fIfile\fR>|<\fIdir\fR>...]
> @@ -160,6 +162,10 @@ Get the default subvolume of the filesystem \fI<path>\fR. The output format
>   is similar to \fBsubvolume list\fR command.
>   .TP
>
> +\fBsubvolume show\fR\fI<path>\fR
> +Show information of a given subvolume in the \fI<path>\fR.
> +.TP

It is possible to allow "btrfs subvolume show" to process multiple paths ?

	btrfs sub show <subv1> [<subvol2> ... ]

> +
>   \fBfilesystem defragment\fP -c[zlib|lzo] [-l \fIlen\fR] [-s \fIstart\fR] \
>   [-t \fIsize\fR] -[vf]<\fIfile\fR>|<\fIdir\fR>  [<\fIfile\fR>|<\fIdir\fR>...]
>


  reply	other threads:[~2012-10-13 20:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12  5:20 [PATCH 0/4] Add show sub command to btrfs subvolume Anand jain
2012-10-12  5:20 ` [PATCH 1/4] Btrfs-progs: introduce btrfs_get_subvols function Anand jain
2012-10-12  5:20 ` [PATCH 2/4] Btrfs-progs: need struct root_info to be accesible Anand jain
2012-10-12  5:20 ` [PATCH 3/4] Btrfs-progs: method to fetch root info for subvol Anand jain
2012-10-12  5:20 ` [PATCH 4/4] Btrfs-progs: add btrfs subvol show cli Anand jain
2012-10-13 20:21   ` Goffredo Baroncelli [this message]
2012-10-13 20:11 ` [PATCH 0/4] Add show sub command to btrfs subvolume Goffredo Baroncelli
2012-10-15  9:03   ` Anand Jain

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=5079CD62.4070206@gmail.com \
    --to=kreijack@gmail.com \
    --cc=Anand.Jain@oracle.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).