From patchwork Tue Jun 13 09:19:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9783401 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 90DC4602DC for ; Tue, 13 Jun 2017 09:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C7028591 for ; Tue, 13 Jun 2017 09:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BA5428640; Tue, 13 Jun 2017 09:19:52 +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 22A4728591 for ; Tue, 13 Jun 2017 09:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbdFMJTu (ORCPT ); Tue, 13 Jun 2017 05:19:50 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:29819 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752543AbdFMJTr (ORCPT ); Tue, 13 Jun 2017 05:19:47 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="19973446" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 13 Jun 2017 17:19:42 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 96E8246B53F9; Tue, 13 Jun 2017 17:19:40 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 13 Jun 2017 17:19:42 +0800 From: Qu Wenruo To: CC: Subject: [PATCH 05/19] btrfs-progs: Refactor write_and_map_eb to use btrfs_fs_info Date: Tue, 13 Jun 2017 17:19:21 +0800 Message-ID: <20170613091935.23277-6-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170613091935.23277-1-quwenruo@cn.fujitsu.com> References: <20170613091935.23277-1-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: 96E8246B53F9.AF2B3 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@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 Signed-off-by: Qu Wenruo --- convert/main.c | 2 +- disk-io.c | 8 ++++---- disk-io.h | 2 +- mkfs/main.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/convert/main.c b/convert/main.c index bf050132..103cd5cd 100644 --- a/convert/main.c +++ b/convert/main.c @@ -370,7 +370,7 @@ static int migrate_one_reserved_range(struct btrfs_trans_handle *trans, eb->len = key.offset; /* Write the data */ - ret = write_and_map_eb(root, eb); + ret = write_and_map_eb(root->fs_info, eb); free(eb); if (ret < 0) break; diff --git a/disk-io.c b/disk-io.c index bf00e195..88e7c3f7 100644 --- a/disk-io.c +++ b/disk-io.c @@ -417,7 +417,7 @@ err: return ret; } -int write_and_map_eb(struct btrfs_root *root, struct extent_buffer *eb) +int write_and_map_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb) { int ret; int dev_nr; @@ -427,11 +427,11 @@ int write_and_map_eb(struct btrfs_root *root, struct extent_buffer *eb) dev_nr = 0; length = eb->len; - ret = btrfs_map_block(root->fs_info, WRITE, eb->start, &length, + ret = btrfs_map_block(fs_info, WRITE, eb->start, &length, &multi, 0, &raid_map); if (raid_map) { - ret = write_raid56_with_parity(root->fs_info, eb, multi, + ret = write_raid56_with_parity(fs_info, eb, multi, length, raid_map); BUG_ON(ret); } else while (dev_nr < multi->num_stripes) { @@ -464,7 +464,7 @@ int write_tree_block(struct btrfs_trans_handle *trans, btrfs_set_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN); csum_tree_block(root->fs_info, eb, 0); - return write_and_map_eb(root, eb); + return write_and_map_eb(root->fs_info, eb); } void btrfs_setup_root(struct btrfs_root *root, struct btrfs_fs_info *fs_info, diff --git a/disk-io.h b/disk-io.h index 6dab689f..96133d32 100644 --- a/disk-io.h +++ b/disk-io.h @@ -191,6 +191,6 @@ int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid); int write_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *eb); -int write_and_map_eb(struct btrfs_root *root, struct extent_buffer *eb); +int write_and_map_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb); #endif diff --git a/mkfs/main.c b/mkfs/main.c index 24a51cb4..df2af474 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -753,7 +753,7 @@ again: if (ret) goto end; - ret = write_and_map_eb(root, eb); + ret = write_and_map_eb(root->fs_info, eb); if (ret) { error("failed to write %s", path_name); goto end;