aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk-cache.c
diff options
context:
space:
mode:
authorHans Holmberg <hans.holmberg@cnexlabs.com>2018-06-01 10:41:13 -0400
committerJens Axboe <axboe@kernel.dk>2018-06-01 11:02:53 -0400
commitcc9c9a00b10eaf33abe1cece2c05ea34601af21b (patch)
treefb118d35b601bc76bb3281d2c26ed33eaeab0710 /drivers/lightnvm/pblk-cache.c
parentb06be2873d916e58c00ecfa664c22a75fa721260 (diff)
lightnvm: pblk: kick writer on new flush points
Unless we kick the writer directly when setting a new flush point, the user risks having to wait for up to one second (the default timeout for the write thread to be kicked) for the IO to complete. Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-cache.c')
-rw-r--r--drivers/lightnvm/pblk-cache.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/lightnvm/pblk-cache.c b/drivers/lightnvm/pblk-cache.c
index 29a23111b31c..b1c6d7eb6115 100644
--- a/drivers/lightnvm/pblk-cache.c
+++ b/drivers/lightnvm/pblk-cache.c
@@ -44,13 +44,15 @@ retry:
44 goto out; 44 goto out;
45 } 45 }
46 46
47 if (unlikely(!bio_has_data(bio)))
48 goto out;
49
50 pblk_ppa_set_empty(&w_ctx.ppa); 47 pblk_ppa_set_empty(&w_ctx.ppa);
51 w_ctx.flags = flags; 48 w_ctx.flags = flags;
52 if (bio->bi_opf & REQ_PREFLUSH) 49 if (bio->bi_opf & REQ_PREFLUSH) {
53 w_ctx.flags |= PBLK_FLUSH_ENTRY; 50 w_ctx.flags |= PBLK_FLUSH_ENTRY;
51 pblk_write_kick(pblk);
52 }
53
54 if (unlikely(!bio_has_data(bio)))
55 goto out;
54 56
55 for (i = 0; i < nr_entries; i++) { 57 for (i = 0; i < nr_entries; i++) {
56 void *data = bio_data(bio); 58 void *data = bio_data(bio);