From patchwork Wed Aug 26 14:16:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaolei X-Patchwork-Id: 7077761 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C6DED9F374 for ; Wed, 26 Aug 2015 14:40:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BE1E208DA for ; Wed, 26 Aug 2015 14:40:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8F78208DE for ; Wed, 26 Aug 2015 14:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933019AbbHZORw (ORCPT ); Wed, 26 Aug 2015 10:17:52 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:38638 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932972AbbHZORv (ORCPT ); Wed, 26 Aug 2015 10:17:51 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100045506" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 26 Aug 2015 22:20:59 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t7QEHhcC027056 for ; Wed, 26 Aug 2015 22:17:43 +0800 Received: from localhost.localdomain (10.167.226.114) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.181.6; Wed, 26 Aug 2015 22:17:49 +0800 From: Zhao Lei To: CC: Zhao Lei Subject: [PATCH] btrfs-progs: remove code for setup mntid in cmd_subvol_show Date: Wed, 26 Aug 2015 22:16:14 +0800 Message-ID: <88362f08a12bcf5c094b57cca9424ef5438e3605.1440598568.git.zhaolei@cn.fujitsu.com> X-Mailer: git-send-email 1.8.5.1 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.3 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 We don't need to use value of mntid in cmd_subvol_show(), no need to get its value. Signed-off-by: Zhao Lei --- cmds-subvolume.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 20e2c01..75ecd45 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -939,7 +939,7 @@ static int cmd_subvol_show(int argc, char **argv) char uuidparse[BTRFS_UUID_UNPARSED_SIZE]; char *fullpath = NULL, *svpath = NULL, *mnt = NULL; char raw_prefix[] = "\t\t\t\t"; - u64 sv_id, mntid; + u64 sv_id; int fd = -1, mntfd = -1; int ret = 1; DIR *dirstream1 = NULL, *dirstream2 = NULL; @@ -999,12 +999,6 @@ static int cmd_subvol_show(int argc, char **argv) goto out; } - ret = btrfs_list_get_path_rootid(mntfd, &mntid); - if (ret) { - fprintf(stderr, "ERROR: can't get rootid for '%s'\n", mnt); - goto out; - } - if (sv_id == BTRFS_FS_TREE_OBJECTID) { printf("%s is btrfs root\n", fullpath); goto out;