aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-09-08 17:20:21 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-10-14 12:38:40 -0400
commitfb22c402ffdf61dd121795b5809de587185d5240 (patch)
tree7c3de5410eff21b3a3b105dc63d5e2034f2c7c63 /drivers/block/drbd/drbd_req.c
parent78db89287ce0f146a1f2a019a0b243ea4557caac (diff)
drbd: Track the reasons to suspend IO in dedicated state bits
There are three ways to get IO suspended: * Loss of any access to data * Fence-peer-handler running * User requested to suspend IO Track those in different bits, so that one condition clearing its state bit does not interfere with the other two conditions. Only when the user resumes IO he overrules all three bits. The fact is hidden from the user, he sees only a single suspend bit. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index af608b39c4e0..9e91a2545fc8 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -287,7 +287,7 @@ static void _req_may_be_done_not_susp(struct drbd_request *req, struct bio_and_e
287{ 287{
288 struct drbd_conf *mdev = req->mdev; 288 struct drbd_conf *mdev = req->mdev;
289 289
290 if (!mdev->state.susp) 290 if (!is_susp(mdev->state))
291 _req_may_be_done(req, m); 291 _req_may_be_done(req, m);
292} 292}
293 293
@@ -812,7 +812,7 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio)
812 (mdev->state.pdsk == D_INCONSISTENT && 812 (mdev->state.pdsk == D_INCONSISTENT &&
813 mdev->state.conn >= C_CONNECTED)); 813 mdev->state.conn >= C_CONNECTED));
814 814
815 if (!(local || remote) && !mdev->state.susp) { 815 if (!(local || remote) && !is_susp(mdev->state)) {
816 dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); 816 dev_err(DEV, "IO ERROR: neither local nor remote disk\n");
817 goto fail_free_complete; 817 goto fail_free_complete;
818 } 818 }
@@ -838,7 +838,7 @@ allocate_barrier:
838 /* GOOD, everything prepared, grab the spin_lock */ 838 /* GOOD, everything prepared, grab the spin_lock */
839 spin_lock_irq(&mdev->req_lock); 839 spin_lock_irq(&mdev->req_lock);
840 840
841 if (mdev->state.susp) { 841 if (is_susp(mdev->state)) {
842 /* If we got suspended, use the retry mechanism of 842 /* If we got suspended, use the retry mechanism of
843 generic_make_request() to restart processing of this 843 generic_make_request() to restart processing of this
844 bio. In the next call to drbd_make_request_26 844 bio. In the next call to drbd_make_request_26