From patchwork Tue Jun 13 09:19:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9783399 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 536B16038E for ; Tue, 13 Jun 2017 09:19:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49FB2285E9 for ; Tue, 13 Jun 2017 09:19:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EFE22867B; Tue, 13 Jun 2017 09:19:51 +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 B4CDA28640 for ; Tue, 13 Jun 2017 09:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752570AbdFMJTt (ORCPT ); Tue, 13 Jun 2017 05:19:49 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:26681 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752549AbdFMJTr (ORCPT ); Tue, 13 Jun 2017 05:19:47 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="19973451" 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 BAD2846B53FB; Tue, 13 Jun 2017 17:19:41 +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:43 +0800 From: Qu Wenruo To: CC: Subject: [PATCH 07/19] btrfs-progs: btrfstune: Refactor change_devices_uuid to use btrfs_fs_info Date: Tue, 13 Jun 2017 17:19:23 +0800 Message-ID: <20170613091935.23277-8-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: BAD2846B53FB.A1D95 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 --- btrfstune.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/btrfstune.c b/btrfstune.c index 580fb401..2d85b041 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -177,10 +177,9 @@ out: return ret; } -static int change_device_uuid(struct btrfs_root *root, struct extent_buffer *eb, +static int change_device_uuid(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int slot) { - struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_dev_item *di; int ret = 0; @@ -216,7 +215,7 @@ static int change_devices_uuid(struct btrfs_fs_info *fs_info) if (key.type != BTRFS_DEV_ITEM_KEY || key.objectid != BTRFS_DEV_ITEMS_OBJECTID) goto next; - ret = change_device_uuid(root, path.nodes[0], path.slots[0]); + ret = change_device_uuid(fs_info, path.nodes[0], path.slots[0]); if (ret < 0) goto out; next: