[PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-23 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain --- btrfs-list.c | 25 +++- btrfs-list.h | 3 +- cmds-subvolume.c | 176 ++- man/btrfs.

[PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-25 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain --- btrfs-list.c | 25 +++- btrfs-list.h | 3 +- cmds-subvolume.c | 172 ++- man/btrfs.

[PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-25 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain --- btrfs-list.c | 25 +++- btrfs-list.h | 3 +- cmds-subvolume.c | 172 ++- man/btrfs.

[PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-27 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain --- btrfs-list.c | 25 +++-- btrfs-list.h | 3 +- cmds-subvolume.c | 155 +-- man/btrfs

[PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-27 Thread Anand Jain
This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Signed-off-by: Anand Jain --- btrfs-list.c | 25 +++-- btrfs-list.h | 3 +- cmds-subvolume.c | 155 +-- man/btrfs

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-23 Thread Eric Sandeen
On 1/23/13 2:12 AM, Anand Jain wrote: > This adds show sub-command to the btrfs subvol cli > to display detailed inforamtion of the given subvol > or snapshot. Couple things below. > Signed-off-by: Anand Jain > --- > btrfs-list.c | 25 +++- > btrfs-list.h | 3 +- > cmds-subvolume

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-24 Thread Zach Brown
> > + if (sv_id == 5) { > > + printf("%s is btrfs root\n", fullpath); > > + close(fd); > > + close(mntfd); > > + free(mnt); > > + free(fullpath); > > + return 1; > > Just wondering, at this point might a "goto out;" be cleaner error >

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-24 Thread Chris Mason
On Thu, Jan 24, 2013 at 12:42:38PM -0700, Zach Brown wrote: > > > > + if (sv_id == 5) { > > > + printf("%s is btrfs root\n", fullpath); > > > + close(fd); > > > + close(mntfd); > > > + free(mnt); > > > + free(fullpath); > > > + return 1; > > > > Jus

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-24 Thread Zach Brown
> > Use safe unwinding in one exit path at the end, please. It's less > > maddening to audit and less likely to fail over time. > > Really, goto is your friend ;) I'm not going to use the word frenemy. I'm just not :). - z -- To unsubscribe from this list: send the line "unsubscribe linux-btrf

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-25 Thread Anand Jain
Eric. All accepted. Thanks for the review. Anand On 01/24/2013 01:06 PM, Eric Sandeen wrote: On 1/23/13 2:12 AM, Anand Jain wrote: This adds show sub-command to the btrfs subvol cli to display detailed inforamtion of the given subvol or snapshot. Couple things below. Signed-off-by: Anand

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 17:30:39 +0800, Anand Jain wrote: > This adds show sub-command to the btrfs subvol cli > to display detailed inforamtion of the given subvol > or snapshot. > > Signed-off-by: Anand Jain > --- > btrfs-list.c | 25 +++- > btrfs-list.h | 3 +- > cmds-subvolume.c |

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-27 Thread Anand Jain
Stefan, Thanks for the review. if (sv_id == BTRFS_FS_TREE_OBJECTID) { oh yes. The common way to handle it is: static int cmd_subvol_show(int argc, char **argv) { int mntfd = -1; int fd = -1; char *mnt = NULL; char *fullpath = NULL; ... everywhere,