aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-03-15 05:25:18 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-05-09 04:15:28 -0400
commit6d7e32f56806ad58006720ed98a433b2047444da (patch)
tree3b4231bb929e0381ab69ede1204d622b08fea176 /drivers/block/drbd
parent6809384c7152c34e74e29a4033826a300eb94f11 (diff)
drbd: Keep a reference to barrier acked requests
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_int.h1
-rw-r--r--drivers/block/drbd/drbd_main.c23
-rw-r--r--drivers/block/drbd/drbd_req.h1
3 files changed, 23 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 2be057b8f568..5bb5114dd23c 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1022,6 +1022,7 @@ struct drbd_conf {
1022 struct drbd_tl_epoch *newest_tle; 1022 struct drbd_tl_epoch *newest_tle;
1023 struct drbd_tl_epoch *oldest_tle; 1023 struct drbd_tl_epoch *oldest_tle;
1024 struct list_head out_of_sequence_requests; 1024 struct list_head out_of_sequence_requests;
1025 struct list_head barrier_acked_requests;
1025 struct hlist_head *tl_hash; 1026 struct hlist_head *tl_hash;
1026 unsigned int tl_hash_s; 1027 unsigned int tl_hash_s;
1027 1028
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index a15135b9b60a..8e489a6d022e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -208,6 +208,7 @@ static int tl_init(struct drbd_conf *mdev)
208 mdev->oldest_tle = b; 208 mdev->oldest_tle = b;
209 mdev->newest_tle = b; 209 mdev->newest_tle = b;
210 INIT_LIST_HEAD(&mdev->out_of_sequence_requests); 210 INIT_LIST_HEAD(&mdev->out_of_sequence_requests);
211 INIT_LIST_HEAD(&mdev->barrier_acked_requests);
211 212
212 mdev->tl_hash = NULL; 213 mdev->tl_hash = NULL;
213 mdev->tl_hash_s = 0; 214 mdev->tl_hash_s = 0;
@@ -311,7 +312,7 @@ void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr,
311 These have been list_move'd to the out_of_sequence_requests list in 312 These have been list_move'd to the out_of_sequence_requests list in
312 _req_mod(, barrier_acked) above. 313 _req_mod(, barrier_acked) above.
313 */ 314 */
314 list_del_init(&b->requests); 315 list_splice_init(&b->requests, &mdev->barrier_acked_requests);
315 316
316 nob = b->next; 317 nob = b->next;
317 if (test_and_clear_bit(CREATE_BARRIER, &mdev->flags)) { 318 if (test_and_clear_bit(CREATE_BARRIER, &mdev->flags)) {
@@ -343,7 +344,7 @@ bail:
343 * @what: The action/event to perform with all request objects 344 * @what: The action/event to perform with all request objects
344 * 345 *
345 * @what might be one of connection_lost_while_pending, resend, fail_frozen_disk_io, 346 * @what might be one of connection_lost_while_pending, resend, fail_frozen_disk_io,
346 * restart_frozen_disk_io. 347 * restart_frozen_disk_io, abort_disk_io.
347 */ 348 */
348static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) 349static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
349{ 350{
@@ -411,6 +412,24 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
411 b = tmp; 412 b = tmp;
412 list_splice(&carry_reads, &b->requests); 413 list_splice(&carry_reads, &b->requests);
413 } 414 }
415
416 /* Actions operating on the disk state, also want to work on
417 requests that got barrier acked. */
418 switch (what) {
419 case abort_disk_io:
420 case fail_frozen_disk_io:
421 case restart_frozen_disk_io:
422 list_for_each_safe(le, tle, &mdev->barrier_acked_requests) {
423 req = list_entry(le, struct drbd_request, tl_requests);
424 _req_mod(req, what);
425 }
426
427 case connection_lost_while_pending:
428 case resend:
429 break;
430 default:
431 dev_err(DEV, "what = %d in _tl_restart()\n", what);
432 }
414} 433}
415 434
416 435
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h
index 68a234a5fdc5..74c5b9f14d61 100644
--- a/drivers/block/drbd/drbd_req.h
+++ b/drivers/block/drbd/drbd_req.h
@@ -105,6 +105,7 @@ enum drbd_req_event {
105 read_completed_with_error, 105 read_completed_with_error,
106 read_ahead_completed_with_error, 106 read_ahead_completed_with_error,
107 write_completed_with_error, 107 write_completed_with_error,
108 abort_disk_io,
108 completed_ok, 109 completed_ok,
109 resend, 110 resend,
110 fail_frozen_disk_io, 111 fail_frozen_disk_io,