Commit 46385c84 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

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: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent d64957c9
...@@ -441,7 +441,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -441,7 +441,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
req->rq_state &= ~RQ_LOCAL_PENDING; req->rq_state &= ~RQ_LOCAL_PENDING;
_req_may_be_done_not_susp(req, m); _req_may_be_done_not_susp(req, m);
put_ldev(mdev);
break; break;
case abort_disk_io: case abort_disk_io:
...@@ -458,7 +457,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -458,7 +457,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
__drbd_chk_io_error(mdev, false); __drbd_chk_io_error(mdev, false);
_req_may_be_done_not_susp(req, m); _req_may_be_done_not_susp(req, m);
put_ldev(mdev);
break; break;
case read_ahead_completed_with_error: case read_ahead_completed_with_error:
...@@ -466,7 +464,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -466,7 +464,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
req->rq_state |= RQ_LOCAL_COMPLETED; req->rq_state |= RQ_LOCAL_COMPLETED;
req->rq_state &= ~RQ_LOCAL_PENDING; req->rq_state &= ~RQ_LOCAL_PENDING;
_req_may_be_done_not_susp(req, m); _req_may_be_done_not_susp(req, m);
put_ldev(mdev);
break; break;
case read_completed_with_error: case read_completed_with_error:
...@@ -478,7 +475,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -478,7 +475,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
D_ASSERT(!(req->rq_state & RQ_NET_MASK)); D_ASSERT(!(req->rq_state & RQ_NET_MASK));
__drbd_chk_io_error(mdev, false); __drbd_chk_io_error(mdev, false);
put_ldev(mdev);
goto_queue_for_net_read: goto_queue_for_net_read:
......
...@@ -244,6 +244,7 @@ void drbd_endio_pri(struct bio *bio, int error) ...@@ -244,6 +244,7 @@ void drbd_endio_pri(struct bio *bio, int error)
spin_lock_irqsave(&mdev->req_lock, flags); spin_lock_irqsave(&mdev->req_lock, flags);
__req_mod(req, what, &m); __req_mod(req, what, &m);
spin_unlock_irqrestore(&mdev->req_lock, flags); spin_unlock_irqrestore(&mdev->req_lock, flags);
put_ldev(mdev);
if (m.bio) if (m.bio)
complete_master_bio(mdev, &m); complete_master_bio(mdev, &m);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment