From patchwork Fri Oct 13 12:46:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 10004557 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 30B2A60216 for ; Fri, 13 Oct 2017 12:55:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 228582902E for ; Fri, 13 Oct 2017 12:55:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 179E92905B; Fri, 13 Oct 2017 12:55:15 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 A296C2902E for ; Fri, 13 Oct 2017 12:55:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932089AbdJMMzN (ORCPT ); Fri, 13 Oct 2017 08:55:13 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55961 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758291AbdJMMrl (ORCPT ); Fri, 13 Oct 2017 08:47:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id u138so21645162wmu.4 for ; Fri, 13 Oct 2017 05:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cW+fUTSpxGwTskFDaSa1eolvdPBGqOCh83tKpVnZNYQ=; b=ATl5A1jeWi/NWcP9XrzxImDODJbdpEa4QirDmE5Z1YOJ2+g+dA7PJP3PUy3fFujK6o JcWy5iv8LjEA4Il0OKSELGUbhtkgHfM9eOyOK8QCVidtamMcJIUnGh4d55f+5REE1LdC CsG/Vq6qPPmMkf0WwdAc3KaSxiXV/Hb3LJMts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cW+fUTSpxGwTskFDaSa1eolvdPBGqOCh83tKpVnZNYQ=; b=ILwZ7UNKFBMb3L3EqfNB6CdV21DK0JTP8K3sEB6HioqmpIet5JufRx2cYBcNdsVE8Q FwaoxF5doReQqHrJOmCwyOeBpdQ4EAvVmY2LJHXq4CR618V+dlYubdqpKalUKYDGZr1D WGTTWgyuKhNdMMZQaBdVCOz9T7N4uTas8pbNkV0bsBXDIZ/GpH5l2P56co3WTNZyDftm LNdq1f+VHnd/PqPeK55lHJo9PFk1Dw61Oy9PEiCsCKq9l27pp2uYg7iJS3Yunt5YnV1a ZYZ3Gxr5hweLkRxbtWITGdt0ES/3dDPJXDp2qA4W/MQEgeXuN8Fmfmhb4lHnFPPFh1wc 5k4A== X-Gm-Message-State: AMCzsaX69h2K7jJQmm4vd21WYy13D301OugoD9aTTmOk35cS+NlMOUA7 pSde+wtG76dghLrWEazp9WFx/A== X-Google-Smtp-Source: AOwi7QD2Gbv1pfkix/ibqK196cGSZfw44f97qV1owBYgPNcZ/ULHh0tCcGvXQ7c5RGtLdhPf7k0AKA== X-Received: by 10.80.240.136 with SMTP id v8mr2061216edl.52.1507898860118; Fri, 13 Oct 2017 05:47:40 -0700 (PDT) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id p91sm735012edp.69.2017.10.13.05.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 05:47:39 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 35/58] lightnvm: pblk: remove redundant check on read path Date: Fri, 13 Oct 2017 14:46:24 +0200 Message-Id: <20171013124647.32668-36-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171013124647.32668-1-m@bjorling.me> References: <20171013124647.32668-1-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Javier González A partial read I/O in pblk is an I/O where some sectors reside in the write buffer in main memory and some are persisted on the device. Such an I/O must at least contain 2 lbas, therefore checking for the case where a single lba is mapped is not necessary. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c index 402f8ef..71c5850 100644 --- a/drivers/lightnvm/pblk-read.c +++ b/drivers/lightnvm/pblk-read.c @@ -235,7 +235,7 @@ static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd, rqd->end_io = pblk_end_io_sync; rqd->private = &wait; - if (unlikely(nr_secs > 1 && nr_holes == 1)) { + if (unlikely(nr_holes == 1)) { ppa_ptr = rqd->ppa_list; dma_ppa_list = rqd->dma_ppa_list; rqd->ppa_addr = rqd->ppa_list[0]; @@ -260,7 +260,7 @@ static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd, #endif } - if (unlikely(nr_secs > 1 && nr_holes == 1)) { + if (unlikely(nr_holes == 1)) { struct ppa_addr ppa; ppa = rqd->ppa_addr;