dm snapshot: rework writing to origin
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 10 Dec 2009 23:52:30 +0000 (23:52 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 10 Dec 2009 23:52:30 +0000 (23:52 +0000)
commit515ad66cc4c82f210d726340349c8f7c1ec6b125
treee6ae5591a7906f3ce9ae0fb0a62419acffcdcbcd
parentd698aa4500aa3ca9559142060caf0f79da998744
dm snapshot: rework writing to origin

To track the completion of exceptions relating to the same location on
the device, the current code selects one exception as primary_pe, links
the other exceptions to it and uses reference counting to wait until all
the reallocations are complete.

It is considered too complicated to extend this code to handle the new
snapshot-merge target, where sets of non-overlapping chunks would also
need to become linked.

Instead, a simpler (but less efficient) approach is taken.  Bios are
linked to one exception.  When it completes, bios are simply retried,
and if other related exceptions are still outstanding, they'll get
queued again to wait for another one.

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