dm: implement basic barrier support
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 8 Apr 2009 23:27:16 +0000 (00:27 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Wed, 8 Apr 2009 23:27:16 +0000 (00:27 +0100)
commitaf7e466a1acededbc10beaba9eec8531d561c566
tree1d1d0655e2fc22e5b440202be4050fd083a66c04
parent92c639021ca6e962645114f02e356e7feb131d0b
dm: implement basic barrier support

Barriers are submitted to a worker thread that issues them in-order.

The thread is modified so that when it sees a barrier request it waits
for all pending IO before the request then submits the barrier and
waits for it.  (We must wait, otherwise it could be intermixed with
following requests.)

Errors from the barrier request are recorded in a per-device barrier_error
variable. There may be only one barrier request in progress at once.

For now, the barrier request is converted to a non-barrier request when
sending it to the underlying device.

This patch guarantees correct barrier behavior if the underlying device
doesn't perform write-back caching. The same requirement existed before
barriers were supported in dm.

Bottom layer barrier support (sending barriers by target drivers) and
handling devices with write-back caches will be done in further patches.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm.c