From patchwork Mon Jan 19 06:45:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 5654981 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 184D1C058E for ; Mon, 19 Jan 2015 06:53:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5177620351 for ; Mon, 19 Jan 2015 06:53:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68E45202C8 for ; Mon, 19 Jan 2015 06:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751755AbbASGwb (ORCPT ); Mon, 19 Jan 2015 01:52:31 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:60017 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751221AbbASGrW (ORCPT ); Mon, 19 Jan 2015 01:47:22 -0500 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="56253739" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 19 Jan 2015 14:43:52 +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 t0J6khGm022572 for ; Mon, 19 Jan 2015 14:46:43 +0800 Received: from localhost.localdomain (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Mon, 19 Jan 2015 14:47:23 +0800 From: Qu Wenruo To: Subject: [PATCH v2 05/10] btrfs-progs: Switch btrfs-find-root to use the new open_ctree flags. Date: Mon, 19 Jan 2015 14:45:07 +0800 Message-ID: <1421649912-14539-6-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1421649912-14539-1-git-send-email-quwenruo@cn.fujitsu.com> References: <1421649912-14539-1-git-send-email-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.33] 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, T_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 Since in previous patches, we introduced the new open_ctree flag OPEN_CTREE_CHUNK_ONLY, switch btrfs-find-root to use it instead of the open_ctree_broken(). Signed-off-by: Qu Wenruo --- btrfs-find-root.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/btrfs-find-root.c b/btrfs-find-root.c index 6fa61cc..bc2b344 100644 --- a/btrfs-find-root.c +++ b/btrfs-find-root.c @@ -281,7 +281,6 @@ static int find_root(struct btrfs_root *root) int main(int argc, char **argv) { struct btrfs_root *root; - int dev_fd; int opt; int ret; @@ -309,14 +308,7 @@ int main(int argc, char **argv) exit(1); } - dev_fd = open(argv[optind], O_RDONLY); - if (dev_fd < 0) { - fprintf(stderr, "Failed to open device %s\n", argv[optind]); - exit(1); - } - - root = open_ctree_broken(dev_fd, argv[optind]); - close(dev_fd); + root = open_ctree(argv[optind], 0, OPEN_CTREE_CHUNK_ONLY); if (!root) { fprintf(stderr, "Open ctree failed\n");