aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-01-16 09:04:33 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-05-09 09:16:51 -0400
commit46385c84acd6654d3a38c9c7af1921dbded74aa2 (patch)
tree352c84f1e31a15bd50d3993b71f20d93357372d4 /drivers/block/drbd
parentd64957c9a9757642f59aa4a63dadf159b2694bab (diff)
drbd: move put_ldev from __req_mod() to the endio callback
One invocation in the endio handler is good enough, we don't need mention it for each of the different ways it calls __req_mod(). 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_req.c4
-rw-r--r--drivers/block/drbd/drbd_worker.c1
2 files changed, 1 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index cd7687fad9e6..340d57b98565 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -441,7 +441,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
441 req->rq_state &= ~RQ_LOCAL_PENDING; 441 req->rq_state &= ~RQ_LOCAL_PENDING;
442 442
443 _req_may_be_done_not_susp(req, m); 443 _req_may_be_done_not_susp(req, m);
444 put_ldev(mdev);
445 break; 444 break;
446 445
447 case abort_disk_io: 446 case abort_disk_io:
@@ -458,7 +457,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
458 457
459 __drbd_chk_io_error(mdev, false); 458 __drbd_chk_io_error(mdev, false);
460 _req_may_be_done_not_susp(req, m); 459 _req_may_be_done_not_susp(req, m);
461 put_ldev(mdev);
462 break; 460 break;
463 461
464 case read_ahead_completed_with_error: 462 case read_ahead_completed_with_error:
@@ -466,7 +464,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
466 req->rq_state |= RQ_LOCAL_COMPLETED; 464 req->rq_state |= RQ_LOCAL_COMPLETED;
467 req->rq_state &= ~RQ_LOCAL_PENDING; 465 req->rq_state &= ~RQ_LOCAL_PENDING;
468 _req_may_be_done_not_susp(req, m); 466 _req_may_be_done_not_susp(req, m);
469 put_ldev(mdev);
470 break; 467 break;
471 468
472 case read_completed_with_error: 469 case read_completed_with_error:
@@ -478,7 +475,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
478 D_ASSERT(!(req->rq_state & RQ_NET_MASK)); 475 D_ASSERT(!(req->rq_state & RQ_NET_MASK));
479 476
480 __drbd_chk_io_error(mdev, false); 477 __drbd_chk_io_error(mdev, false);
481 put_ldev(mdev);
482 478
483 goto_queue_for_net_read: 479 goto_queue_for_net_read:
484 480
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 14aa4a2d4dc4..620c70ff2231 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -244,6 +244,7 @@ void drbd_endio_pri(struct bio *bio, int error)
244 spin_lock_irqsave(&mdev->req_lock, flags); 244 spin_lock_irqsave(&mdev->req_lock, flags);
245 __req_mod(req, what, &m); 245 __req_mod(req, what, &m);
246 spin_unlock_irqrestore(&mdev->req_lock, flags); 246 spin_unlock_irqrestore(&mdev->req_lock, flags);
247 put_ldev(mdev);
247 248
248 if (m.bio) 249 if (m.bio)
249 complete_master_bio(mdev, &m); 250 complete_master_bio(mdev, &m);