aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-07-17 17:06:12 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:57:58 -0500
commit71fc7eedb37585ab2f1bec2e615202908bd4f4b7 (patch)
tree59fba526f8c01569245af7d8e8bec585c8cfe0a5 /drivers/block/drbd/drbd_main.c
parent1b7ab15b11716d075b3dca34cf41e8d7aba3cba2 (diff)
drbd: Turn tl_apply() into tl_abort_disk_io()
There is no need to overly generalize this function; it only makes the code harder to understand. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index f1d696ab6e83..137935037664 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -484,28 +484,23 @@ void tl_restart(struct drbd_tconn *tconn, enum drbd_req_event what)
484} 484}
485 485
486/** 486/**
487 * tl_apply() - Applies an event to all requests for a certain mdev in the TL 487 * tl_abort_disk_io() - Abort disk I/O for all requests for a certain mdev in the TL
488 * @mdev: DRBD device. 488 * @mdev: DRBD device.
489 * @what: The action/event to perform with all request objects
490 *
491 * @what might ony be ABORT_DISK_IO.
492 */ 489 */
493void tl_apply(struct drbd_conf *mdev, enum drbd_req_event what) 490void tl_abort_disk_io(struct drbd_conf *mdev)
494{ 491{
495 struct drbd_tconn *tconn = mdev->tconn; 492 struct drbd_tconn *tconn = mdev->tconn;
496 struct drbd_tl_epoch *b; 493 struct drbd_tl_epoch *b;
497 struct list_head *le, *tle; 494 struct list_head *le, *tle;
498 struct drbd_request *req; 495 struct drbd_request *req;
499 496
500 D_ASSERT(what == ABORT_DISK_IO);
501
502 spin_lock_irq(&tconn->req_lock); 497 spin_lock_irq(&tconn->req_lock);
503 b = tconn->oldest_tle; 498 b = tconn->oldest_tle;
504 while (b) { 499 while (b) {
505 list_for_each_safe(le, tle, &b->requests) { 500 list_for_each_safe(le, tle, &b->requests) {
506 req = list_entry(le, struct drbd_request, tl_requests); 501 req = list_entry(le, struct drbd_request, tl_requests);
507 if (req->w.mdev == mdev) 502 if (req->w.mdev == mdev)
508 _req_mod(req, what); 503 _req_mod(req, ABORT_DISK_IO);
509 } 504 }
510 b = b->next; 505 b = b->next;
511 } 506 }
@@ -513,7 +508,7 @@ void tl_apply(struct drbd_conf *mdev, enum drbd_req_event what)
513 list_for_each_safe(le, tle, &tconn->barrier_acked_requests) { 508 list_for_each_safe(le, tle, &tconn->barrier_acked_requests) {
514 req = list_entry(le, struct drbd_request, tl_requests); 509 req = list_entry(le, struct drbd_request, tl_requests);
515 if (req->w.mdev == mdev) 510 if (req->w.mdev == mdev)
516 _req_mod(req, what); 511 _req_mod(req, ABORT_DISK_IO);
517 } 512 }
518 513
519 spin_unlock_irq(&tconn->req_lock); 514 spin_unlock_irq(&tconn->req_lock);