summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk-rb.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2017-06-30 17:56:40 +0200
committerJens Axboe <axboe@kernel.dk>2017-06-30 19:08:18 +0200
commitee8d5c1ad54e48ec44b6ae9cf91144fcab6ebf83 (patch)
treecd5e6be51067d2eb47fa42c031a723644593d94f /drivers/lightnvm/pblk-rb.c
parentlightnvm: pblk: use vmalloc for GC data buffer (diff)
downloadlinux-ee8d5c1ad54e48ec44b6ae9cf91144fcab6ebf83.tar.xz
linux-ee8d5c1ad54e48ec44b6ae9cf91144fcab6ebf83.zip
lightnvm: pblk: remove target using async. I/Os
When removing a pblk instance, pad the current line using asynchronous I/O. This reduces the removal time from ~1 minute in the worst case to a couple of seconds. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <matias@cnexlabs.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-rb.c')
-rw-r--r--drivers/lightnvm/pblk-rb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c
index 2dda874af890..7300be98e831 100644
--- a/drivers/lightnvm/pblk-rb.c
+++ b/drivers/lightnvm/pblk-rb.c
@@ -180,6 +180,14 @@ unsigned int pblk_rb_read_count(struct pblk_rb *rb)
return pblk_rb_ring_count(mem, subm, rb->nr_entries);
}
+unsigned int pblk_rb_sync_count(struct pblk_rb *rb)
+{
+ unsigned int mem = READ_ONCE(rb->mem);
+ unsigned int sync = READ_ONCE(rb->sync);
+
+ return pblk_rb_ring_count(mem, sync, rb->nr_entries);
+}
+
unsigned int pblk_rb_read_commit(struct pblk_rb *rb, unsigned int nr_entries)
{
unsigned int subm;