aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-bio-prison.h
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2013-03-01 17:45:50 -0500
committerAlasdair G Kergon <agk@redhat.com>2013-03-01 17:45:50 -0500
commit025b96853fe0bdc977d88b4242ca5e1f19d9bb66 (patch)
tree5bf111eac74bb2798495fd4975b0d8df72c8d351 /drivers/md/dm-bio-prison.h
parent6beca5eb6e801aea810da6cbc4990d96e6c1c0bc (diff)
dm thin: remove cells from stack
This patch takes advantage of the new bio-prison interface where the memory is now passed in rather than using a mempool in bio-prison. This allows the map function to avoid performing potentially-blocking allocations that could lead to deadlocks: We want to avoid the cell allocation that is done in bio_detain. (The potential for mempool deadlocks still remains in other functions that use bio_detain.) Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-bio-prison.h')
-rw-r--r--drivers/md/dm-bio-prison.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/md/dm-bio-prison.h b/drivers/md/dm-bio-prison.h
index 11af2182101b..981a02d3a055 100644
--- a/drivers/md/dm-bio-prison.h
+++ b/drivers/md/dm-bio-prison.h
@@ -22,7 +22,6 @@
22 * subsequently unlocked the bios become available. 22 * subsequently unlocked the bios become available.
23 */ 23 */
24struct dm_bio_prison; 24struct dm_bio_prison;
25struct dm_bio_prison_cell;
26 25
27/* FIXME: this needs to be more abstract */ 26/* FIXME: this needs to be more abstract */
28struct dm_cell_key { 27struct dm_cell_key {
@@ -31,6 +30,17 @@ struct dm_cell_key {
31 dm_block_t block; 30 dm_block_t block;
32}; 31};
33 32
33/*
34 * Treat this as opaque, only in header so callers can manage allocation
35 * themselves.
36 */
37struct dm_bio_prison_cell {
38 struct hlist_node list;
39 struct dm_cell_key key;
40 struct bio *holder;
41 struct bio_list bios;
42};
43
34struct dm_bio_prison *dm_bio_prison_create(unsigned nr_cells); 44struct dm_bio_prison *dm_bio_prison_create(unsigned nr_cells);
35void dm_bio_prison_destroy(struct dm_bio_prison *prison); 45void dm_bio_prison_destroy(struct dm_bio_prison *prison);
36 46