Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258622
b: refs/heads/master
c: b4726a9
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Stodden authored and Konrad Rzeszutek Wilk committed Jun 30, 2011
1 parent 755fe3f commit f62d891
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 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: 2b727c6300b49352f80f63704bb50c256949e95e
refs/heads/master: b4726a9df270859898e254b6eee67a28f38b34d3
36 changes: 19 additions & 17 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ static void end_block_io_op(struct bio *bio, int error)
* (which has the sectors we want, number of them, grant references, etc),
* and transmute it to the block API to hand it over to the proper block disk.
*/
static int do_block_io_op(struct xen_blkif *blkif)
static int
__do_block_io_op(struct xen_blkif *blkif)
{
union blkif_back_rings *blk_rings = &blkif->blk_rings;
struct blkif_request req;
Expand Down Expand Up @@ -515,6 +516,23 @@ static int do_block_io_op(struct xen_blkif *blkif)
return more_to_do;
}

static int
do_block_io_op(struct xen_blkif *blkif)
{
union blkif_back_rings *blk_rings = &blkif->blk_rings;
int more_to_do;

do {
more_to_do = __do_block_io_op(blkif);
if (more_to_do)
break;

RING_FINAL_CHECK_FOR_REQUESTS(&blk_rings->common, more_to_do);
} while (more_to_do);

return more_to_do;
}

/*
* Transmutation of the 'struct blkif_request' to a proper 'struct bio'
* and call the 'submit_bio' to pass it to the underlying storage.
Expand Down Expand Up @@ -700,7 +718,6 @@ static void make_response(struct xen_blkif *blkif, u64 id,
struct blkif_response resp;
unsigned long flags;
union blkif_back_rings *blk_rings = &blkif->blk_rings;
int more_to_do = 0;
int notify;

resp.id = id;
Expand All @@ -727,22 +744,7 @@ static void make_response(struct xen_blkif *blkif, u64 id,
}
blk_rings->common.rsp_prod_pvt++;
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify);
if (blk_rings->common.rsp_prod_pvt == blk_rings->common.req_cons) {
/*
* Tail check for pending requests. Allows frontend to avoid
* notifications if requests are already in flight (lower
* overheads and promotes batching).
*/
RING_FINAL_CHECK_FOR_REQUESTS(&blk_rings->common, more_to_do);

} else if (RING_HAS_UNCONSUMED_REQUESTS(&blk_rings->common)) {
more_to_do = 1;
}

spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);

if (more_to_do)
blkif_notify_work(blkif);
if (notify)
notify_remote_via_irq(blkif->irq);
}
Expand Down

0 comments on commit f62d891

Please sign in to comment.