Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178122243
D36666.1796035870.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D36666.1796035870.diff
View Options
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -59,6 +59,9 @@
#include "virtio_if.h"
struct vtblk_request {
+ struct vtblk_softc *vbr_sc;
+
+ /* Fields after this point are zeroed for each request. */
struct virtio_blk_outhdr vbr_hdr;
struct bio *vbr_bp;
uint8_t vbr_ack;
@@ -163,8 +166,7 @@
vtblk_request_next(struct vtblk_softc *);
static struct vtblk_request *
vtblk_request_bio(struct vtblk_softc *);
-static void vtblk_request_execute(struct vtblk_softc *,
- struct vtblk_request *);
+static void vtblk_request_execute(struct vtblk_request *);
static int vtblk_request_error(struct vtblk_request *);
static void vtblk_queue_completed(struct vtblk_softc *,
@@ -806,6 +808,8 @@
if (req == NULL)
return (ENOMEM);
+ req->vbr_sc = sc;
+
MPASS(sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)) == 1);
MPASS(sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)) == 1);
@@ -840,7 +844,8 @@
req = TAILQ_FIRST(&sc->vtblk_req_free);
if (req != NULL) {
TAILQ_REMOVE(&sc->vtblk_req_free, req, vbr_link);
- bzero(req, sizeof(struct vtblk_request));
+ bzero(&req->vbr_hdr, sizeof(struct vtblk_request) -
+ offsetof(struct vtblk_request, vbr_hdr));
}
return (req);
@@ -934,13 +939,15 @@
}
static void
-vtblk_request_execute(struct vtblk_softc *sc, struct vtblk_request *req)
+vtblk_request_execute(struct vtblk_request *req)
{
+ struct vtblk_softc *sc;
struct virtqueue *vq;
struct sglist *sg;
struct bio *bp;
int ordered, readable, writable, error;
+ sc = req->vbr_sc;
vq = sc->vtblk_vq;
sg = sc->vtblk_sglist;
bp = req->vbr_bp;
@@ -1137,7 +1144,7 @@
break;
req->vbr_requeue_on_error = 1;
- vtblk_request_execute(sc, req);
+ vtblk_request_execute(req);
if (req->vbr_error != 0)
break;
@@ -1273,7 +1280,7 @@
if (!virtqueue_empty(vq))
return (EBUSY);
- vtblk_request_execute(sc, req);
+ vtblk_request_execute(req);
error = req->vbr_error;
if (error)
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 30, 10:51 AM (13 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42104626
Default Alt Text
D36666.1796035870.diff (2 KB)
Attached To
Mode
D36666: vtblk: Include pointer to softc in request
Attached
Detach File
Event Timeline