All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <Anand.Jain@oracle.com>
To: Gene Czarcinski <gene@czarc.net>
Cc: linux-btrfs@vger.kernel.org, Danny Kukawka <danny.kukawka@bisect.de>
Subject: Re: [PATCH] Btrfs-progs: v2 Fix minor problems in  btrfslabel.c
Date: Mon, 28 Jan 2013 10:32:31 +0800	[thread overview]
Message-ID: <5105E33F.8000607@oracle.com> (raw)
In-Reply-To: <1359223796-8132-1-git-send-email-gene@czarc.net>



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

  reply	other threads:[~2013-01-28  2:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-26 18:09 [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c Gene Czarcinski
2013-01-28  2:32 ` Anand Jain [this message]
2013-01-28 16:16 ` David Sterba
2013-01-28 17:19   ` Gene Czarcinski
2013-01-29  3:04   ` Jeff Liu

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=5105E33F.8000607@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=danny.kukawka@bisect.de \
    --cc=gene@czarc.net \
    --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 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.