From patchwork Wed Sep 6 10:51:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 9940399 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 05DCA602CC for ; Wed, 6 Sep 2017 10:56:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF98428B98 for ; Wed, 6 Sep 2017 10:56:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4CEB28BA5; Wed, 6 Sep 2017 10:56:20 +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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 9967228B98 for ; Wed, 6 Sep 2017 10:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753525AbdIFKyF (ORCPT ); Wed, 6 Sep 2017 06:54:05 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36267 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753389AbdIFKwy (ORCPT ); Wed, 6 Sep 2017 06:52:54 -0400 Received: by mail-wm0-f43.google.com with SMTP id i145so28016413wmf.1 for ; Wed, 06 Sep 2017 03:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FgF6ON1UsyDF0iUbN4fBrmK97PLMfH/onTOPKqVxoYA=; b=Wfz+3TWtOZf3d9GYbO5LkKzY2GGYqlLSfFR5YMiKXtFCfStF095onEwWGXSRKFdBms 0/mTrQmARIzNvtTdOG84lcpX9nvOxxuCVFgUkUTxkTrfopncb4pTH6+H7dVJCnxh/PlJ MXZ8JSFSxdQhceinWPpgEsetjUKMYz0MxmIuUs94Y+cbNSiDDbNJdg7dd2f4SRSlRpDi rPcHPZDwhN8YQ+ZrMh8awZgz1q6Z/0wmzIXS5BDUVUUp/nvckoeyG31r3q5uXc7lilHO 60nAsdwbYHfjym1va42esy3Mlp64Qep678ej/JggnHuY3Hy7wNRHCmC9UONPsdOee00u jCNw== 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=FgF6ON1UsyDF0iUbN4fBrmK97PLMfH/onTOPKqVxoYA=; b=EeI9aZ/QR/Dey3KTn/nyWXzRvW3O7KG7iGYVQ616RvmKE2dr+gSkf+JIQ1hi/B+w++ ZyqEQBXlKoeZEeoQhbMEiq/tlHDntWgXyC2AOGtMWjZHU/Et4Pp0kVMRgByDBJQSKuA9 jxOdTrbmLzXX5/8HOMhIX//PFJJ66sbTY1eF/EPAGmLOFDrlTZEU/gu1oZM41ZRWoSM8 wAa1tZvKvA7olYBq5CeV1RqdcKQOtm719n5i/gVtJfDZfL/WO4CxVKCjLeTVXm3ip2xs BH22mW7SUp1nvqGIw0mxMmzvLci1hg8g2jIKcA3sK/7zfjYdCdbrrcau61eC36deV/Jb FMNA== X-Gm-Message-State: AHPjjUhcOrS3dlR19pcuYZ67lnvX+NkufzVeiC8LV2mNWEv22iGdS7rp WKesvJY6gDXi9VuC X-Google-Smtp-Source: ADKCNb5UmeWJ+LTocGX/TCgDeKVF2tZ5ZiifVk1ld3nVzfQcvuWMlqUSQENup2Kxe3XNDFe0lzweeQ== X-Received: by 10.80.225.131 with SMTP id k3mr5684766edl.218.1504695173488; Wed, 06 Sep 2017 03:52:53 -0700 (PDT) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id b8sm1044007edi.46.2017.09.06.03.52.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Sep 2017 03:52:53 -0700 (PDT) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io, 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: [PATCH 18/18] lightnvm: pblk: remove unnecessary check Date: Wed, 6 Sep 2017 12:51:11 +0200 Message-Id: <1504695071-25928-19-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504695071-25928-1-git-send-email-javier@cnexlabs.com> References: <1504695071-25928-1-git-send-email-javier@cnexlabs.com> 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 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 f43d78e4ce78..46a37d51fa4d 100644 --- a/drivers/lightnvm/pblk-read.c +++ b/drivers/lightnvm/pblk-read.c @@ -242,7 +242,7 @@ static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd, rqd->flags = pblk_set_read_mode(pblk, PBLK_READ_RANDOM); rqd->end_io = NULL; - 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]; @@ -267,7 +267,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;