Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273844
b: refs/heads/master
c: 6927d92
h: refs/heads/master
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Oct 17, 2011
1 parent 22651f8 commit 4f8fb39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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: dda1852802a6cc6fdecb9021e491b2de680c76b9
refs/heads/master: 6927d92091df2848fc0e6a693a017d4b2df549c2
10 changes: 5 additions & 5 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,15 @@ static void xen_blk_drain_io(struct xen_blkif *blkif)
{
atomic_set(&blkif->drain, 1);
do {
/* The initial value is one, and one refcnt taken at the
* start of the xen_blkif_schedule thread. */
if (atomic_read(&blkif->refcnt) <= 2)
break;
wait_for_completion_interruptible_timeout(
&blkif->drain_complete, HZ);

if (!atomic_read(&blkif->drain))
break;
/* The initial value is one, and one refcnt taken at the
* start of the xen_blkif_schedule thread. */
if (atomic_read(&blkif->refcnt) <= 2)
break;
} while (!kthread_should_stop());
atomic_set(&blkif->drain, 0);
}
Expand Down Expand Up @@ -502,11 +502,11 @@ static void __end_block_io_op(struct pending_req *pending_req, int error)
make_response(pending_req->blkif, pending_req->id,
pending_req->operation, pending_req->status);
xen_blkif_put(pending_req->blkif);
free_req(pending_req);
if (atomic_read(&pending_req->blkif->refcnt) <= 2) {
if (atomic_read(&pending_req->blkif->drain))
complete(&pending_req->blkif->drain_complete);
}
free_req(pending_req);
}
}

Expand Down

0 comments on commit 4f8fb39

Please sign in to comment.