Gene Czarcinski
2013-Jan-26 18:09 UTC
[PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c
Fixed indentation, replace spaces with tabs. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Rebased; fixed compiler warnings; added space after "if" Signed-off-by: Gene Czarcinski <gene@czarc.net> --- btrfslabel.c | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/btrfslabel.c b/btrfslabel.c index 88a5196..5a91fc4 100644 --- a/btrfslabel.c +++ b/btrfslabel.c @@ -48,42 +48,43 @@ static int change_label_unmounted(char *dev, char *nLabel) { - struct btrfs_root *root; - struct btrfs_trans_handle *trans; - - /* Open the super_block at the default location - * and as read-write. - */ - root = open_ctree(dev, 0, 1); - if (!root) /* errors are printed by open_ctree() */ - return; - - trans = btrfs_start_transaction(root, 1); - strncpy(root->fs_info->super_copy.label, nLabel, BTRFS_LABEL_SIZE); - root->fs_info->super_copy.label[BTRFS_LABEL_SIZE-1] = 0; - btrfs_commit_transaction(trans, root); - - /* Now we close it since we are done. */ - close_ctree(root); + struct btrfs_root *root; + struct btrfs_trans_handle *trans; + + /* Open the super_block at the default location + * and as read-write. + */ + root = open_ctree(dev, 0, 1); + if (!root) /* errors are printed by open_ctree() */ + return -1; + + trans = btrfs_start_transaction(root, 1); + strncpy(root->fs_info->super_copy.label, nLabel, BTRFS_LABEL_SIZE); + root->fs_info->super_copy.label[BTRFS_LABEL_SIZE-1] = 0; + btrfs_commit_transaction(trans, root); + + /* Now we close it since we are done. */ + close_ctree(root); + return 0; } int get_label_unmounted(char *dev) { - struct btrfs_root *root; + struct btrfs_root *root; - /* Open the super_block at the default location - * and as read-only. - */ - root = open_ctree(dev, 0, 0); + /* Open the super_block at the default location + * and as read-only. + */ + root = open_ctree(dev, 0, 0); - if(!root) - return -1; + if (!root) + return -1; - fprintf(stdout, "%s\n", root->fs_info->super_copy.label); + fprintf(stdout, "%s\n", root->fs_info->super_copy.label); - /* Now we close it since we are done. */ - close_ctree(root); - return 0; + /* Now we close it since we are done. */ + close_ctree(root); + return 0; } int get_label(char *btrfs_dev) -- 1.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Anand Jain
2013-Jan-28 02:32 UTC
Re: [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c
On 01/27/2013 02:09 AM, Gene Czarcinski wrote:> Fixed indentation, replace spaces with tabs. > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> > > Rebased; fixed compiler warnings; added space after "if" > Signed-off-by: Gene Czarcinski <gene@czarc.net>Reviewed-by: Anand Jain <anand.jain@oracle.com>> --- > btrfslabel.c | 57 +++++++++++++++++++++++++++++---------------------------- > 1 file changed, 29 insertions(+), 28 deletions(-) > > diff --git a/btrfslabel.c b/btrfslabel.c > index 88a5196..5a91fc4 100644 > --- a/btrfslabel.c > +++ b/btrfslabel.c > @@ -48,42 +48,43 @@ > > static int change_label_unmounted(char *dev, char *nLabel) > { > - struct btrfs_root *root; > - struct btrfs_trans_handle *trans; > - > - /* Open the super_block at the default location > - * and as read-write. > - */ > - root = open_ctree(dev, 0, 1); > - if (!root) /* errors are printed by open_ctree() */ > - return; > - > - trans = btrfs_start_transaction(root, 1); > - strncpy(root->fs_info->super_copy.label, nLabel, BTRFS_LABEL_SIZE); > - root->fs_info->super_copy.label[BTRFS_LABEL_SIZE-1] = 0; > - btrfs_commit_transaction(trans, root); > - > - /* Now we close it since we are done. */ > - close_ctree(root); > + struct btrfs_root *root; > + struct btrfs_trans_handle *trans; > + > + /* Open the super_block at the default location > + * and as read-write. > + */ > + root = open_ctree(dev, 0, 1); > + if (!root) /* errors are printed by open_ctree() */ > + return -1; > + > + trans = btrfs_start_transaction(root, 1); > + strncpy(root->fs_info->super_copy.label, nLabel, BTRFS_LABEL_SIZE); > + root->fs_info->super_copy.label[BTRFS_LABEL_SIZE-1] = 0; > + btrfs_commit_transaction(trans, root); > + > + /* Now we close it since we are done. */ > + close_ctree(root); > + return 0; > } > > int get_label_unmounted(char *dev) > { > - struct btrfs_root *root; > + struct btrfs_root *root; > > - /* Open the super_block at the default location > - * and as read-only. > - */ > - root = open_ctree(dev, 0, 0); > + /* Open the super_block at the default location > + * and as read-only. > + */ > + root = open_ctree(dev, 0, 0); > > - if(!root) > - return -1; > + if (!root) > + return -1; > > - fprintf(stdout, "%s\n", root->fs_info->super_copy.label); > + fprintf(stdout, "%s\n", root->fs_info->super_copy.label); > > - /* Now we close it since we are done. */ > - close_ctree(root); > - return 0; > + /* Now we close it since we are done. */ > + close_ctree(root); > + return 0; > } > > int get_label(char *btrfs_dev) >-- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
David Sterba
2013-Jan-28 16:16 UTC
Re: [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c
On Sat, Jan 26, 2013 at 01:09:56PM -0500, Gene Czarcinski wrote:> Fixed indentation, replace spaces with tabs. > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> > > Rebased; fixed compiler warnings; added space after "if" > Signed-off-by: Gene Czarcinski <gene@czarc.net> > --- > btrfslabel.c | 57 +++++++++++++++++++++++++++++----------------------------Jeff Liu has sent a series that updates the code and also fixes the formatting. And I''d prefer to take his series as a more extensive update. Also, btrfslabel.c is another file to be removed and its contents placed into the right locations, like cmds-filesystem.c or util.[ch] . I didn''t realize that during reviewing the label series. Jeff, I suggest to add a new patch that moves the functions out of btrfslabel.c, so you don''t have to rework the whole series again. thanks, david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Gene Czarcinski
2013-Jan-28 17:19 UTC
Re: [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c
On 01/28/2013 11:16 AM, David Sterba wrote:> On Sat, Jan 26, 2013 at 01:09:56PM -0500, Gene Czarcinski wrote: >> Fixed indentation, replace spaces with tabs. >> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> >> >> Rebased; fixed compiler warnings; added space after "if" >> Signed-off-by: Gene Czarcinski <gene@czarc.net> >> --- >> btrfslabel.c | 57 +++++++++++++++++++++++++++++---------------------------- > Jeff Liu has sent a series that updates the code and also fixes the > formatting. And I''d prefer to take his series as a more extensive > update. > > Also, btrfslabel.c is another file to be removed and its contents placed > into the right locations, like cmds-filesystem.c or util.[ch] . I didn''t > realize that during reviewing the label series. > > Jeff, I suggest to add a new patch that moves the functions out of > btrfslabel.c, so you don''t have to rework the whole series again. > > thanks, > david >No problem. I was just going over what was integration-20130126-fix1 and this seemed missing and also trivial. My suggestion/recommendation is that the current set be integrated into stable btrfs-progs and labeled "v0.20-rc2" and after 2/3/4/5 weeks if there is nothing major it should become "v0.20". There will always be more good patches but we need some additional points in btrfs-progs stable. Then the next set of updates to be integrated can proceed with that as a base ... patches such as "su show" and getting rid of the legacy/deprecated programs. Gene -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeff Liu
2013-Jan-29 03:04 UTC
Re: [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c
Hi David, On 01/29/2013 12:16 AM, David Sterba wrote:> On Sat, Jan 26, 2013 at 01:09:56PM -0500, Gene Czarcinski wrote: >> Fixed indentation, replace spaces with tabs. >> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> >> >> Rebased; fixed compiler warnings; added space after "if" >> Signed-off-by: Gene Czarcinski <gene@czarc.net> >> --- >> btrfslabel.c | 57 +++++++++++++++++++++++++++++---------------------------- > > Jeff Liu has sent a series that updates the code and also fixes the > formatting. And I''d prefer to take his series as a more extensive > update. > > Also, btrfslabel.c is another file to be removed and its contents placed > into the right locations, like cmds-filesystem.c or util.[ch] . I didn''t > realize that during reviewing the label series. > > Jeff, I suggest to add a new patch that moves the functions out of > btrfslabel.c, so you don''t have to rework the whole series again.I''ll deal with it later, Thanks for your kind suggestion. -Jeff -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html