From patchwork Thu Jul 17 02:40:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Hecheng X-Patchwork-Id: 4572501 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1A0769F26C for ; Thu, 17 Jul 2014 02:46:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E5C32018A for ; Thu, 17 Jul 2014 02:46:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88CC3201B9 for ; Thu, 17 Jul 2014 02:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752762AbaGQCqe (ORCPT ); Wed, 16 Jul 2014 22:46:34 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:4426 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752548AbaGQCqc (ORCPT ); Wed, 16 Jul 2014 22:46:32 -0400 X-IronPort-AV: E=Sophos;i="5.00,906,1396972800"; d="scan'208";a="33386627" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 17 Jul 2014 10:43:46 +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 s6H2kThq028192 for ; Thu, 17 Jul 2014 10:46:29 +0800 Received: from localhost.localdomain (10.167.226.111) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 17 Jul 2014 10:46:41 +0800 From: Gui Hecheng To: CC: Gui Hecheng Subject: [PATCH 2/4] btrfs-progs: remove unnecessary judgment for fd in scrub Date: Thu, 17 Jul 2014 10:40:37 +0800 Message-ID: <1405564839-28702-2-git-send-email-guihc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1405564839-28702-1-git-send-email-guihc.fnst@cn.fujitsu.com> References: <1405564839-28702-1-git-send-email-guihc.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.111] 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, 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 The scrub_read_file function is always on a branch, which has (fd >= 0), so there is not need to judgment the pasted in arg. Signed-off-by: Gui Hecheng --- cmds-scrub.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index f9e2b40..a604b25 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -474,9 +474,6 @@ static struct scrub_file_record **scrub_read_file(int fd, int report_errors) char empty_uuid[BTRFS_FSID_SIZE] = {0}; struct scrub_file_record **p = NULL; - if (fd < 0) - return ERR_PTR(-EINVAL); - again: old_avail = avail - i; BUG_ON(old_avail < 0);