summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-bio-prison.h
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-10-10 16:27:16 +0200
committerMike Snitzer <snitzer@redhat.com>2014-11-10 21:25:28 +0100
commit2d759a46b4d65e1392843cf9df7101897af87008 (patch)
tree7cca57c04d5d8e29ca7ae232fa52f2e8fa6883c3 /drivers/md/dm-bio-prison.h
parentdm thin: defer whole cells rather than individual bios (diff)
downloadlinux-2d759a46b4d65e1392843cf9df7101897af87008.tar.xz
linux-2d759a46b4d65e1392843cf9df7101897af87008.zip
dm thin: remap the bios in a cell immediately
This use of direct submission in process_prepared_mapping() reduces latency for submitting bios in a cell by avoiding adding those bios to the deferred list and waiting for the next iteration of the worker. But this direct submission exposes the potential for a race between releasing a cell and incrementing deferred set. Fix this by introducing dm_cell_visit_release() and refactoring inc_remap_and_issue_cell() accordingly. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-bio-prison.h')
-rw-r--r--drivers/md/dm-bio-prison.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/dm-bio-prison.h b/drivers/md/dm-bio-prison.h
index c0cddb118582..b03988667740 100644
--- a/drivers/md/dm-bio-prison.h
+++ b/drivers/md/dm-bio-prison.h
@@ -89,6 +89,14 @@ void dm_cell_release_no_holder(struct dm_bio_prison *prison,
void dm_cell_error(struct dm_bio_prison *prison,
struct dm_bio_prison_cell *cell, int error);
+/*
+ * Visits the cell and then releases. Guarantees no new inmates are
+ * inserted between the visit and release.
+ */
+void dm_cell_visit_release(struct dm_bio_prison *prison,
+ void (*visit_fn)(void *, struct dm_bio_prison_cell *),
+ void *context, struct dm_bio_prison_cell *cell);
+
/*----------------------------------------------------------------*/
/*