From patchwork Wed Jul 23 05:47:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 4608851 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A3A909F375 for ; Wed, 23 Jul 2014 05:48:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6503201BF for ; Wed, 23 Jul 2014 05:47:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2133A201C7 for ; Wed, 23 Jul 2014 05:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753988AbaGWFrn (ORCPT ); Wed, 23 Jul 2014 01:47:43 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:32809 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751583AbaGWFrm (ORCPT ); Wed, 23 Jul 2014 01:47:42 -0400 X-IronPort-AV: E=Sophos;i="5.00,931,1396972800"; d="scan'208";a="33667145" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 23 Jul 2014 13:44:54 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s6N5lcZd029306 for ; Wed, 23 Jul 2014 13:47:39 +0800 Received: from adam-work.lan (10.167.226.24) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Wed, 23 Jul 2014 13:47:45 +0800 From: Qu Wenruo To: Subject: [PATCH 3/4] btrfs-progs: Fix wrong indent in btrfs-progs. Date: Wed, 23 Jul 2014 13:47:36 +0800 Message-ID: <1406094457-3100-3-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1406094457-3100-1-git-send-email-quwenruo@cn.fujitsu.com> References: <1406094457-3100-1-git-send-email-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.24] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When editing cmds-filesystem.c, I found cmd_filesystem_df() uses 7 spaces as indent instead of 1 tab (or 8 spaces). which makes indent quite embarrassing. Such problem is especillay hard to detect when reviewing patches, since the leading '+' makes a tab only 7 spaces long, makeing 7 spaces look the same with a tab. This patch fixes all the 7 spaces indent. Signed-off-by: Qu Wenruo --- cmds-filesystem.c | 79 +++++++++++++++++++++++++++---------------------------- ctree.h | 15 ++++++----- utils.c | 10 +++---- 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index bf87bbe..108d9b7 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -114,23 +114,23 @@ static const char * const filesystem_cmd_group_usage[] = { }; static const char * const cmd_filesystem_df_usage[] = { - "btrfs filesystem df ", - "Show space usage information for a mount point", - NULL + "btrfs filesystem df ", + "Show space usage information for a mount point", + NULL }; static void print_df(struct btrfs_ioctl_space_args *sargs) { - u64 i; - struct btrfs_ioctl_space_info *sp = sargs->spaces; - - for (i = 0; i < sargs->total_spaces; i++, sp++) { - printf("%s, %s: total=%s, used=%s\n", - group_type_str(sp->flags), - group_profile_str(sp->flags), - pretty_size(sp->total_bytes), - pretty_size(sp->used_bytes)); - } + u64 i; + struct btrfs_ioctl_space_info *sp = sargs->spaces; + + for (i = 0; i < sargs->total_spaces; i++, sp++) { + printf("%s, %s: total=%s, used=%s\n", + group_type_str(sp->flags), + group_profile_str(sp->flags), + pretty_size(sp->total_bytes), + pretty_size(sp->used_bytes)); + } } static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) @@ -183,33 +183,32 @@ static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret) static int cmd_filesystem_df(int argc, char **argv) { - struct btrfs_ioctl_space_args *sargs = NULL; - int ret; - int fd; - char *path; - DIR *dirstream = NULL; - - if (check_argc_exact(argc, 2)) - usage(cmd_filesystem_df_usage); - - path = argv[1]; - - fd = open_file_or_dir(path, &dirstream); - if (fd < 0) { - fprintf(stderr, "ERROR: can't access '%s'\n", path); - return 1; - } - ret = get_df(fd, &sargs); - - if (!ret && sargs) { - print_df(sargs); - free(sargs); - } else { - fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); - } - - close_file_or_dir(fd, dirstream); - return !!ret; + struct btrfs_ioctl_space_args *sargs = NULL; + int ret; + int fd; + char *path; + DIR *dirstream = NULL; + + if (check_argc_exact(argc, 2)) + usage(cmd_filesystem_df_usage); + + path = argv[1]; + + fd = open_file_or_dir(path, &dirstream); + if (fd < 0) { + fprintf(stderr, "ERROR: can't access '%s'\n", path); + return 1; + } + ret = get_df(fd, &sargs); + if (!ret && sargs) { + print_df(sargs); + free(sargs); + } else { + fprintf(stderr, "ERROR: get_df failed %s\n", strerror(-ret)); + } + + close_file_or_dir(fd, dirstream); + return !!ret; } static int match_search_item_kernel(__u8 *fsid, char *mnt, char *label, diff --git a/ctree.h b/ctree.h index 35d3633..83d85b3 100644 --- a/ctree.h +++ b/ctree.h @@ -939,10 +939,10 @@ struct btrfs_block_group_cache { }; struct btrfs_extent_ops { - int (*alloc_extent)(struct btrfs_root *root, u64 num_bytes, - u64 hint_byte, struct btrfs_key *ins); - int (*free_extent)(struct btrfs_root *root, u64 bytenr, - u64 num_bytes); + int (*alloc_extent)(struct btrfs_root *root, u64 num_bytes, + u64 hint_byte, struct btrfs_key *ins); + int (*free_extent)(struct btrfs_root *root, u64 bytenr, + u64 num_bytes); }; struct btrfs_device; @@ -2117,9 +2117,10 @@ BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_exclusive, static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb, struct btrfs_item *e) { - unsigned long offset; - offset = offsetof(struct btrfs_file_extent_item, disk_bytenr); - return btrfs_item_size(eb, e) - offset; + unsigned long offset; + + offset = offsetof(struct btrfs_file_extent_item, disk_bytenr); + return btrfs_item_size(eb, e) - offset; } /* this returns the number of file bytes represented by the inline item. diff --git a/utils.c b/utils.c index b96d5b4..8befd57 100644 --- a/utils.c +++ b/utils.c @@ -1467,15 +1467,15 @@ char *__strncpy__null(char *dest, const char *src, size_t n) */ static int check_label(const char *input) { - int len = strlen(input); + int len = strlen(input); - if (len > BTRFS_LABEL_SIZE - 1) { + if (len > BTRFS_LABEL_SIZE - 1) { fprintf(stderr, "ERROR: Label %s is too long (max %d)\n", input, BTRFS_LABEL_SIZE - 1); - return -1; - } + return -1; + } - return 0; + return 0; } static int set_label_unmounted(const char *dev, const char *label)