aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-05-27 09:07:43 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-10-14 08:25:20 -0400
commit288f422ec13667de40b278535d2a5fb5c77352c4 (patch)
treefc8f594c05b05637a5052a41c603bbdad6f8641e /drivers/block/drbd/drbd_req.c
parent7e602c0aaf3e686c36cc742119f0f53f42e9befe (diff)
drbd: Track all IO requests on the TL, not writes only
With that the drbd_fail_pending_reads() function becomes obsolete. 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_req.c')
-rw-r--r--drivers/block/drbd/drbd_req.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 976d7941f71e..4a30e2cae56d 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -59,17 +59,19 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req)
59static void _req_is_done(struct drbd_conf *mdev, struct drbd_request *req, const int rw) 59static void _req_is_done(struct drbd_conf *mdev, struct drbd_request *req, const int rw)
60{ 60{
61 const unsigned long s = req->rq_state; 61 const unsigned long s = req->rq_state;
62
63 /* remove it from the transfer log.
64 * well, only if it had been there in the first
65 * place... if it had not (local only or conflicting
66 * and never sent), it should still be "empty" as
67 * initialized in drbd_req_new(), so we can list_del() it
68 * here unconditionally */
69 list_del(&req->tl_requests);
70
62 /* if it was a write, we may have to set the corresponding 71 /* if it was a write, we may have to set the corresponding
63 * bit(s) out-of-sync first. If it had a local part, we need to 72 * bit(s) out-of-sync first. If it had a local part, we need to
64 * release the reference to the activity log. */ 73 * release the reference to the activity log. */
65 if (rw == WRITE) { 74 if (rw == WRITE) {
66 /* remove it from the transfer log.
67 * well, only if it had been there in the first
68 * place... if it had not (local only or conflicting
69 * and never sent), it should still be "empty" as
70 * initialized in drbd_req_new(), so we can list_del() it
71 * here unconditionally */
72 list_del(&req->tl_requests);
73 /* Set out-of-sync unless both OK flags are set 75 /* Set out-of-sync unless both OK flags are set
74 * (local only or remote failed). 76 * (local only or remote failed).
75 * Other places where we set out-of-sync: 77 * Other places where we set out-of-sync:
@@ -517,8 +519,6 @@ void __req_mod(struct drbd_request *req, enum drbd_req_event what,
517 D_ASSERT(test_bit(CREATE_BARRIER, &mdev->flags) == 0); 519 D_ASSERT(test_bit(CREATE_BARRIER, &mdev->flags) == 0);
518 520
519 req->epoch = mdev->newest_tle->br_number; 521 req->epoch = mdev->newest_tle->br_number;
520 list_add_tail(&req->tl_requests,
521 &mdev->newest_tle->requests);
522 522
523 /* increment size of current epoch */ 523 /* increment size of current epoch */
524 mdev->newest_tle->n_writes++; 524 mdev->newest_tle->n_writes++;
@@ -634,6 +634,9 @@ void __req_mod(struct drbd_request *req, enum drbd_req_event what,
634 break; 634 break;
635 635
636 case barrier_acked: 636 case barrier_acked:
637 if (!(req->rq_state & RQ_WRITE))
638 break;
639
637 if (req->rq_state & RQ_NET_PENDING) { 640 if (req->rq_state & RQ_NET_PENDING) {
638 /* barrier came in before all requests have been acked. 641 /* barrier came in before all requests have been acked.
639 * this is bad, because if the connection is lost now, 642 * this is bad, because if the connection is lost now,
@@ -892,6 +895,9 @@ allocate_barrier:
892 remote = 0; 895 remote = 0;
893 } 896 }
894 897
898
899 list_add_tail(&req->tl_requests, &mdev->newest_tle->requests);
900
895 /* NOTE remote first: to get the concurrent write detection right, 901 /* NOTE remote first: to get the concurrent write detection right,
896 * we must register the request before start of local IO. */ 902 * we must register the request before start of local IO. */
897 if (remote) { 903 if (remote) {