From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
To: jens.axboe@oracle.com
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org,
j-nomura@ce.jp.nec.com, k-ueda@ct.jp.nec.com
Subject: [PATCH 1/3] block: change virtio_blk to use blk-end-request
Date: Fri, 11 Jan 2008 16:50:18 -0500 (EST) [thread overview]
Message-ID: <20080111.165018.88470085.k-ueda@ct.jp.nec.com> (raw)
This patch converts virtio_blk to use __blk_end_request() directly
so that end_{queued|dequeued}_request() can be removed.
Related 'uptodate' argument is converted to 'error'.
__blk_end_request() takes care of dequeueing request like below:
if (!list_empty(&rq->queuelist))
blkdev_dequeue_request(rq);
In the case of virtio_blk, blkdev_dequeue_request() has been done
in do_virtblk_request() and the queuelist is empty in blk_done().
So __blk_end_request() doesn't call blkdev_dequeue_request() and
the behavior of blk_done() doesn't change.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
---
drivers/block/virtio_blk.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
Index: 2.6.24-rc7/drivers/block/virtio_blk.c
===================================================================
--- 2.6.24-rc7.orig/drivers/block/virtio_blk.c
+++ 2.6.24-rc7/drivers/block/virtio_blk.c
@@ -45,20 +45,20 @@ static bool blk_done(struct virtqueue *v
spin_lock_irqsave(&vblk->lock, flags);
while ((vbr = vblk->vq->vq_ops->get_buf(vblk->vq, &len)) != NULL) {
- int uptodate;
+ int error;
switch (vbr->in_hdr.status) {
case VIRTIO_BLK_S_OK:
- uptodate = 1;
+ error = 0;
break;
case VIRTIO_BLK_S_UNSUPP:
- uptodate = -ENOTTY;
+ error = -ENOTTY;
break;
default:
- uptodate = 0;
+ error = -EIO;
break;
}
- end_dequeued_request(vbr->req, uptodate);
+ __blk_end_request(vbr->req, error, blk_rq_bytes(vbr->req));
list_del(&vbr->list);
mempool_free(vbr, vblk->pool);
}
reply other threads:[~2008-01-11 21:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080111.165018.88470085.k-ueda@ct.jp.nec.com \
--to=k-ueda@ct.jp.nec.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®