linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Javier González" <jg@lightnvm.io>
To: linux-block@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Javier González" <javier@cnexlabs.com>
Subject: [PATCH 11/11] lightnvm: pblk: use rqd->end_io for completion
Date: Fri, 15 Sep 2017 14:25:39 +0200	[thread overview]
Message-ID: <1505478339-13089-12-git-send-email-javier@cnexlabs.com> (raw)
In-Reply-To: <1505478339-13089-1-git-send-email-javier@cnexlabs.com>

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 <javier@cnexlabs.com>
---
 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 76c3b20dc3d5..5e6a881e3434 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 d7c90c303540..0299fc08291d 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;
-- 
2.7.4

      parent reply	other threads:[~2017-09-15 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 12:25 [PATCH 00/11] lightnvm: pblk: cleanup Javier González
2017-09-15 12:25 ` [PATCH 01/11] lightnvm: pblk: use constant for GC max inflight Javier González
2017-09-15 12:25 ` [PATCH 02/11] lightnvm: pblk: normalize ppa namings Javier González
2017-09-15 12:25 ` [PATCH 03/11] lightnvm: pblk: refactor read lba sanity check Javier González
2017-09-15 12:25 ` [PATCH 04/11] lightnvm: pblk: simplify data validity check on GC Javier González
2017-09-15 12:25 ` [PATCH 05/11] lightnvm: pblk: refactor read path " Javier González
2017-09-15 12:25 ` [PATCH 06/11] lightnvm: pblk: put bio on bio completion Javier González
2017-09-15 12:25 ` [PATCH 07/11] lightnvm: pblk: simplify path on REQ_PREFLUSH Javier González
2017-09-15 12:25 ` [PATCH 08/11] lightnvm: pblk: allocate bio size more accurately Javier González
2017-09-15 12:25 ` [PATCH 09/11] lightnvm: pblk: improve naming for internal req Javier González
2017-09-15 12:25 ` [PATCH 10/11] lightnvm: pblk: refactor rqd alloc/free Javier González
2017-09-15 12:25 ` Javier González [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505478339-13089-12-git-send-email-javier@cnexlabs.com \
    --to=jg@lightnvm.io \
    --cc=javier@cnexlabs.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).