From patchwork Thu Jan 11 05:08:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 10156969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB2D1605BA for ; Thu, 11 Jan 2018 05:10:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACFAF26255 for ; Thu, 11 Jan 2018 05:10:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1CBB286B1; Thu, 11 Jan 2018 05:10:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B20626255 for ; Thu, 11 Jan 2018 05:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753744AbeAKFKE (ORCPT ); Thu, 11 Jan 2018 00:10:04 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:44389 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753706AbeAKFKC (ORCPT ); Thu, 11 Jan 2018 00:10:02 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="35160288" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 11 Jan 2018 13:09:50 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 7938B48AEA0C for ; Thu, 11 Jan 2018 13:09:50 +0800 (CST) Received: from localhost.localdomain (10.167.226.155) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 11 Jan 2018 13:09:53 +0800 From: Lu Fengqi To: Subject: [PATCH 03/67] btrfs-progs: add the stack prefix for block_group_flags set/get function Date: Thu, 11 Jan 2018 13:08:35 +0800 Message-ID: <20180111050939.21251-4-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180111050939.21251-1-lufq.fnst@cn.fujitsu.com> References: <20180111050939.21251-1-lufq.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.155] X-yoursite-MailScanner-ID: 7938B48AEA0C.AD444 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.fnst@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The block_group_flags set/get function defined by BTRFS_SETGET_STACK_FUNCS macro is missing the prefix stack. Signed-off-by: Lu Fengqi --- btrfs-fragments.c | 2 +- chunk-recover.c | 2 +- cmds-check.c | 6 +++--- convert/common.c | 2 +- ctree.h | 2 +- extent-tree.c | 6 +++--- print-tree.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/btrfs-fragments.c b/btrfs-fragments.c index db79f969..91b683de 100644 --- a/btrfs-fragments.c +++ b/btrfs-fragments.c @@ -261,7 +261,7 @@ list_fragments(int fd, u64 flags, char *dir) bg = (struct btrfs_block_group_item *) (args.buf + off); - bgflags = btrfs_block_group_flags(bg); + bgflags = btrfs_stack_block_group_flags(bg); bgused = btrfs_stack_block_group_used(bg); printf("found block group %lld len %lld " diff --git a/chunk-recover.c b/chunk-recover.c index 31de1354..cfcf97d4 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -1374,7 +1374,7 @@ static int __insert_block_group(struct btrfs_trans_handle *trans, btrfs_set_stack_block_group_used(&bg_item, used); btrfs_set_stack_block_group_chunk_objectid(&bg_item, used); - btrfs_set_block_group_flags(&bg_item, chunk_rec->type_flags); + btrfs_set_stack_block_group_flags(&bg_item, chunk_rec->type_flags); key.objectid = chunk_rec->offset; key.type = BTRFS_BLOCK_GROUP_ITEM_KEY; key.offset = chunk_rec->length; diff --git a/cmds-check.c b/cmds-check.c index 9acf673f..207a927d 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -12956,7 +12956,7 @@ static int check_block_group_item(struct btrfs_fs_info *fs_info, bi = btrfs_item_ptr(eb, slot, struct btrfs_block_group_item); read_extent_buffer(eb, &bg_item, (unsigned long)bi, sizeof(bg_item)); used = btrfs_stack_block_group_used(&bg_item); - bg_flags = btrfs_block_group_flags(&bg_item); + bg_flags = btrfs_stack_block_group_flags(&bg_item); chunk_key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID; chunk_key.type = BTRFS_CHUNK_ITEM_KEY; @@ -13158,11 +13158,11 @@ static int check_chunk_item(struct btrfs_fs_info *fs_info, struct btrfs_block_group_item); read_extent_buffer(leaf, &bg_item, (unsigned long)bi, sizeof(bg_item)); - if (btrfs_block_group_flags(&bg_item) != type) { + if (btrfs_stack_block_group_flags(&bg_item) != type) { error( "chunk[%llu %llu) related block group item flags mismatch, wanted: %llu, have: %llu", chunk_key.offset, chunk_end, type, - btrfs_block_group_flags(&bg_item)); + btrfs_stack_block_group_flags(&bg_item)); err |= REFERENCER_MISSING; } } diff --git a/convert/common.c b/convert/common.c index 8dbad917..e288d129 100644 --- a/convert/common.c +++ b/convert/common.c @@ -673,7 +673,7 @@ static void insert_temp_block_group(struct extent_buffer *buf, btrfs_set_item_offset(buf, btrfs_item_nr(*slot), *itemoff); btrfs_set_item_size(buf, btrfs_item_nr(*slot), sizeof(bgi)); - btrfs_set_block_group_flags(&bgi, flag); + btrfs_set_stack_block_group_flags(&bgi, flag); btrfs_set_stack_block_group_used(&bgi, used); btrfs_set_stack_block_group_chunk_objectid(&bgi, BTRFS_FIRST_CHUNK_TREE_OBJECTID); diff --git a/ctree.h b/ctree.h index 71635318..d4254b67 100644 --- a/ctree.h +++ b/ctree.h @@ -1569,7 +1569,7 @@ BTRFS_SETGET_FUNCS(disk_block_group_chunk_objectid, struct btrfs_block_group_item, chunk_objectid, 64); BTRFS_SETGET_FUNCS(disk_block_group_flags, struct btrfs_block_group_item, flags, 64); -BTRFS_SETGET_STACK_FUNCS(block_group_flags, +BTRFS_SETGET_STACK_FUNCS(stack_block_group_flags, struct btrfs_block_group_item, flags, 64); /* struct btrfs_free_space_info */ diff --git a/extent-tree.c b/extent-tree.c index 033bf53b..9ca0339e 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -3275,7 +3275,7 @@ int btrfs_read_block_groups(struct btrfs_root *root) continue; } - cache->flags = btrfs_block_group_flags(&cache->item); + cache->flags = btrfs_stack_block_group_flags(&cache->item); bit = 0; if (cache->flags & BTRFS_BLOCK_GROUP_DATA) { bit = BLOCK_GROUP_DATA; @@ -3330,7 +3330,7 @@ btrfs_add_block_group(struct btrfs_fs_info *fs_info, u64 bytes_used, u64 type, btrfs_set_stack_block_group_chunk_objectid(&cache->item, chunk_objectid); cache->flags = type; - btrfs_set_block_group_flags(&cache->item, type); + btrfs_set_stack_block_group_flags(&cache->item, type); account_super_bytes(fs_info, cache); ret = update_space_info(fs_info, cache->flags, size, bytes_used, @@ -3440,7 +3440,7 @@ int btrfs_make_block_groups(struct btrfs_trans_handle *trans, btrfs_set_stack_block_group_used(&cache->item, 0); btrfs_set_stack_block_group_chunk_objectid(&cache->item, chunk_objectid); - btrfs_set_block_group_flags(&cache->item, group_type); + btrfs_set_stack_block_group_flags(&cache->item, group_type); cache->flags = group_type; diff --git a/print-tree.c b/print-tree.c index 6c5aaea4..96cca9d5 100644 --- a/print-tree.c +++ b/print-tree.c @@ -997,7 +997,7 @@ static void print_block_group_item(struct extent_buffer *eb, read_extent_buffer(eb, &bg_item, (unsigned long)bgi, sizeof(bg_item)); memset(flags_str, 0, sizeof(flags_str)); - bg_flags_to_str(btrfs_block_group_flags(&bg_item), flags_str); + bg_flags_to_str(btrfs_stack_block_group_flags(&bg_item), flags_str); printf("\t\tblock group used %llu chunk_objectid %llu flags %s\n", (unsigned long long)btrfs_stack_block_group_used(&bg_item), (unsigned long long)btrfs_stack_block_group_chunk_objectid(&bg_item),