]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9c11399e155bbd6b87ed89d95439c1c94760bee8
tree1d1d0655e2fc22e5b440202be4050fd083a66c04
parent68bbe381bf1c9cc1441cab4cda30a92483fcbc43
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