From patchwork Thu Jan 24 15:52:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Czarcinski X-Patchwork-Id: 2033091 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 D09FF3FDBC for ; Thu, 24 Jan 2013 15:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751831Ab3AXPxE (ORCPT ); Thu, 24 Jan 2013 10:53:04 -0500 Received: from eastrmfepo103.cox.net ([68.230.241.215]:37514 "EHLO eastrmfepo103.cox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749Ab3AXPxD (ORCPT ); Thu, 24 Jan 2013 10:53:03 -0500 Received: from eastrmimpo306 ([68.230.241.238]) by eastrmfepo103.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20130124155302.RPEF23841.eastrmfepo103.cox.net@eastrmimpo306> for ; Thu, 24 Jan 2013 10:53:02 -0500 Received: from falcon.lcl ([68.100.144.189]) by eastrmimpo306 with cox id rrsv1k00m45PsQc01rt17v; Thu, 24 Jan 2013 10:53:01 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020205.510158DD.014C,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.0 cv=RKMx7ve+ c=1 sm=1 a=xiXiwr23JuvKlkj6ngz4TA==:17 a=PpwGOjaE93EA:10 a=103jMkqsgCkA:10 a=BIJj-m-0AAAA:8 a=GGCSY4RF3lEA:10 a=n2UolTWMt36vOPMUsigA: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: Fix minor problems with btrfslabel.c Date: Thu, 24 Jan 2013 10:52:18 -0500 Message-Id: <1359042738-14522-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, also fixed compiler warnings Signed-off-by: Gene Czarcinski --- btrfslabel.c | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/btrfslabel.c b/btrfslabel.c index 88a5196..bea1f89 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)