dm: support barriers on simple devices
Implement barrier support for single device DM devices This patch implements barrier support in DM for the common case of dm linear just remapping a single underlying device. In this case we can safely pass the barrier through because there can be no reordering between devices. NB. Any DM device might cease to support barriers if it gets reconfigured so code must continue to allow for a possible -EOPNOTSUPP on every barrier bio submitted. - agk Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:

committad av
Alasdair G Kergon

förälder
7d76345da6
incheckning
ab4c142488
@@ -835,7 +835,11 @@ static int __split_bio(struct mapped_device *md, struct bio *bio)
|
||||
ci.map = dm_get_table(md);
|
||||
if (unlikely(!ci.map))
|
||||
return -EIO;
|
||||
|
||||
if (unlikely(bio_barrier(bio) && !dm_table_barrier_ok(ci.map))) {
|
||||
dm_table_put(ci.map);
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
ci.md = md;
|
||||
ci.bio = bio;
|
||||
ci.io = alloc_io(md);
|
||||
@@ -919,15 +923,6 @@ static int dm_request(struct request_queue *q, struct bio *bio)
|
||||
struct mapped_device *md = q->queuedata;
|
||||
int cpu;
|
||||
|
||||
/*
|
||||
* There is no use in forwarding any barrier request since we can't
|
||||
* guarantee it is (or can be) handled by the targets correctly.
|
||||
*/
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
||||
down_read(&md->io_lock);
|
||||
|
||||
cpu = part_stat_lock();
|
||||
|
Referens i nytt ärende
Block a user