Commit 1c9bd3e4 authored by Andrew Morton's avatar Andrew Morton Committed by Jeff Garzik

[PATCH] SARD accounting fix

Patch from Rick Lindsley <ricklind@us.ibm.com>

Fixes a couple of odd cases in which disk requests were not being accounted
for.
parent 6e501cc8
...@@ -1461,6 +1461,7 @@ void blk_insert_request(request_queue_t *q, struct request *rq, ...@@ -1461,6 +1461,7 @@ void blk_insert_request(request_queue_t *q, struct request *rq,
if (blk_rq_tagged(rq)) if (blk_rq_tagged(rq))
blk_queue_end_tag(q, rq); blk_queue_end_tag(q, rq);
drive_stat_acct(rq, rq->nr_sectors, 1);
__elv_add_request(q, rq, !at_head, 0); __elv_add_request(q, rq, !at_head, 0);
q->request_fn(q); q->request_fn(q);
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
......
...@@ -60,6 +60,7 @@ int blk_do_rq(request_queue_t *q, struct block_device *bdev, struct request *rq) ...@@ -60,6 +60,7 @@ int blk_do_rq(request_queue_t *q, struct block_device *bdev, struct request *rq)
rq->flags |= REQ_NOMERGE; rq->flags |= REQ_NOMERGE;
rq->waiting = &wait; rq->waiting = &wait;
drive_stat_acct(rq, rq->nr_sectors, 1);
elv_add_request(q, rq, 1, 1); elv_add_request(q, rq, 1, 1);
generic_unplug_device(q); generic_unplug_device(q);
wait_for_completion(&wait); wait_for_completion(&wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment