From patchwork Fri Oct 13 12:46:21 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: 10004577 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 39E1E60216 for ; Fri, 13 Oct 2017 12:56:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C8182902E for ; Fri, 13 Oct 2017 12:56:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 210742905C; Fri, 13 Oct 2017 12:56:43 +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=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 ACF462902E for ; Fri, 13 Oct 2017 12:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758318AbdJMM42 (ORCPT ); Fri, 13 Oct 2017 08:56:28 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53863 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758273AbdJMMri (ORCPT ); Fri, 13 Oct 2017 08:47:38 -0400 Received: by mail-wm0-f65.google.com with SMTP id q132so21530049wmd.2 for ; Fri, 13 Oct 2017 05:47:37 -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=Lm0AfcKY847eTPWuK2QbBHtXhMM+NSSbSkr6SLyofgM=; b=bnJkxxaPASY77Xd4S1JGJ1sxZ09yhmnxul3IBzHwjhJc2oKcSTf9ehVP8nA+eISYP+ Uo050jzEEf8WXSxWG8GGOLpUPO9dlB7VlnaT8JbV8qw25pykiu+Thw2r4RsTUHSTX47+ tmxK5V4SRXWnhF5EywA27qxygzcFT8Mmrp1kg= 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=Lm0AfcKY847eTPWuK2QbBHtXhMM+NSSbSkr6SLyofgM=; b=di+zwlBtpGZceVa6yN8cKufZk8NW7mF4ro/zz1H/Qtn5RlYDWg/f07SWEYd7GKuiJR +vvjDosKwiOFEFyIvOKk990s9RehsvLU1Ciwt8fujFG5YPHDf1zisF/r/7hwXalzUwNx 2TtNyvGLW/UW0Xpt3SmeX5Yc1F/8F4m3KZczMrKX/9c3Qk72qXvlY+CV8TYYtKf43gZr sMnO/2AzJSzSZJnZxSldVfi6kDbEJpMjIp7RHmtQwLkKDJHxgIB9x0TpQVu9CESBsAGl l9UTpAK4fAg93EojSxYDML1WvgpU+oFv8VT7C/rcFAw6H95ZbsSMZmujXxKSPzIC021x VFxA== X-Gm-Message-State: AMCzsaX7sdAd8E17FTFFXiCB1leh8ziXm7ZdLdXW42fjB5UxBciHr/OI QpYfaBTq47UZHXcA9o7Fa8pI6Q== X-Google-Smtp-Source: AOwi7QDeBcdKfqwfd+CkKWzeBIPYuzD3J/Yiho/hV7/39hs2ouGjrJ+PwEGAyKM2cmxfg9N4IAUSdw== X-Received: by 10.80.177.27 with SMTP id k27mr2006418edd.159.1507898857237; Fri, 13 Oct 2017 05:47:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 05:47:36 -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 32/58] lightnvm: pblk: use rqd->end_io for completion Date: Fri, 13 Oct 2017 14:46:21 +0200 Message-Id: <20171013124647.32668-33-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 For consistency with the rest of pblk, use rqd->end_io to point to the function taking care of ending the request on the completion path. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 7 ------- drivers/lightnvm/pblk-read.c | 5 ++--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 0de3875..08d166a 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -261,13 +261,6 @@ void pblk_write_should_kick(struct pblk *pblk) pblk_write_kick(pblk); } -void pblk_end_bio_sync(struct bio *bio) -{ - struct completion *waiting = bio->bi_private; - - complete(waiting); -} - void pblk_end_io_sync(struct nvm_rq *rqd) { struct completion *waiting = rqd->private; diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c index d7c90c3..0299fc0 100644 --- a/drivers/lightnvm/pblk-read.c +++ b/drivers/lightnvm/pblk-read.c @@ -170,13 +170,12 @@ static int pblk_fill_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd, new_bio->bi_iter.bi_sector = 0; /* internal bio */ bio_set_op_attrs(new_bio, REQ_OP_READ, 0); - new_bio->bi_private = &wait; - new_bio->bi_end_io = pblk_end_bio_sync; rqd->bio = new_bio; rqd->nr_ppas = nr_holes; rqd->flags = pblk_set_read_mode(pblk, PBLK_READ_RANDOM); - rqd->end_io = NULL; + rqd->end_io = pblk_end_io_sync; + rqd->private = &wait; if (unlikely(nr_secs > 1 && nr_holes == 1)) { ppa_ptr = rqd->ppa_list;