Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346241
b: refs/heads/master
c: 5af2e8c
h: refs/heads/master
i:
  346239: b075f10
v: v3
  • Loading branch information
Philipp Reisner committed Nov 9, 2012
1 parent ee54d15 commit a734105
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 715306f69d85f7ea21eaef4efe75b8364cfea1d5
refs/heads/master: 5af2e8ce2b463c2cc8e4a074f9d8f660ae7c1d8f
18 changes: 6 additions & 12 deletions trunk/drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,6 @@ static int drbd_req_put_completion_ref(struct drbd_request *req, struct bio_and_
if (!atomic_sub_and_test(put, &req->completion_ref))
return 0;

if (drbd_suspended(mdev)) {
/* We do not allow completion while suspended. Re-get a
* reference, so whatever happens when this is resumed
* may put and complete. */

D_ASSERT(!(req->rq_state & RQ_COMPLETION_SUSP));
req->rq_state |= RQ_COMPLETION_SUSP;
atomic_inc(&req->completion_ref);
return 0;
}

/* else */
drbd_req_complete(req, m);

if (req->rq_state & RQ_POSTPONED) {
Expand All @@ -338,6 +326,9 @@ static void mod_rq_state(struct drbd_request *req, struct bio_and_error *m,
int c_put = 0;
int k_put = 0;

if (drbd_suspended(mdev) && !((s | clear) & RQ_COMPLETION_SUSP))
set |= RQ_COMPLETION_SUSP;

/* apply */

req->rq_state &= ~clear;
Expand Down Expand Up @@ -366,6 +357,9 @@ static void mod_rq_state(struct drbd_request *req, struct bio_and_error *m,
if (!(s & RQ_NET_SENT) && (set & RQ_NET_SENT))
atomic_add(req->i.size >> 9, &mdev->ap_in_flight);

if (!(s & RQ_COMPLETION_SUSP) && (set & RQ_COMPLETION_SUSP))
atomic_inc(&req->completion_ref);

/* progress: put references */

if ((s & RQ_COMPLETION_SUSP) && (clear & RQ_COMPLETION_SUSP))
Expand Down

0 comments on commit a734105

Please sign in to comment.