From patchwork Sat Jan 26 18:09:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Czarcinski X-Patchwork-Id: 2050061 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 82C983FDBC for ; Sat, 26 Jan 2013 18:10:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753379Ab3AZSKK (ORCPT ); Sat, 26 Jan 2013 13:10:10 -0500 Received: from eastrmfepo202.cox.net ([68.230.241.217]:42326 "EHLO eastrmfepo202.cox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753241Ab3AZSKI (ORCPT ); Sat, 26 Jan 2013 13:10:08 -0500 Received: from eastrmimpo210 ([68.230.241.225]) by eastrmfepo202.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20130126181006.XKXL6475.eastrmfepo202.cox.net@eastrmimpo210> for ; Sat, 26 Jan 2013 13:10:06 -0500 Received: from falcon.lcl ([68.100.144.189]) by eastrmimpo210 with cox id siA01k00B45PsQc01iA6F4; Sat, 26 Jan 2013 13:10:06 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020209.51041BFE.00A8,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=KYVQQHkD c=1 sm=1 a=xiXiwr23JuvKlkj6ngz4TA==:17 a=hoIbuwTH6bQA:10 a=103jMkqsgCkA:10 a=BIJj-m-0AAAA:8 a=6HfYzl0JHMAA:10 a=fdRyzCpWf2nKzClvOWoA:9 a=7ilESPL-aKkA:10 a=LUue1KWhiSUA:10 a=xiXiwr23JuvKlkj6ngz4TA==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (CRAM-MD5) smtp.auth=gczarcinski@cox.net From: Gene Czarcinski To: linux-btrfs@vger.kernel.org Cc: Gene Czarcinski , Danny Kukawka Subject: [PATCH] Btrfs-progs: v2 Fix minor problems in btrfslabel.c Date: Sat, 26 Jan 2013 13:09:56 -0500 Message-Id: <1359223796-8132-1-git-send-email-gene@czarc.net> X-Mailer: git-send-email 1.8.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Fixed indentation, replace spaces with tabs. Signed-off-by: Danny Kukawka Rebased; fixed compiler warnings; added space after "if" Signed-off-by: Gene Czarcinski Reviewed-by: Anand Jain --- 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)