[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 2/9] virtio-blk: make some functions static
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH v3 2/9] virtio-blk: make some functions static |
Date: |
Mon, 26 Sep 2016 10:34:05 +0200 |
User-agent: |
StGit/0.17.1-dirty |
Some functions that were called from the dataplane code are now only used
locally:
virtio_blk_init_request()
virtio_blk_handle_request()
virtio_blk_submit_multireq()
since commit "03de2f527499 virtio-blk: do not use vring in dataplane", and
virtio_blk_free_request()
since commit "6aa46d8ff1ee virtio: move VirtQueueElement at the beginning
of the structs".
This patch converts them to static.
Signed-off-by: Greg Kurz <address@hidden>
---
v3: This was "virtio-blk: turn virtio_blk_handle_request() into a static
function" in v2. It turns out that there are some more candidates.
---
hw/block/virtio-blk.c | 10 +++++-----
include/hw/virtio/virtio-blk.h | 8 --------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index c7ca4d6769cb..bbacd562cefb 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -29,8 +29,8 @@
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h"
-void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
- VirtIOBlockReq *req)
+static void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
+ VirtIOBlockReq *req)
{
req->dev = s;
req->vq = vq;
@@ -40,7 +40,7 @@ void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
req->mr_next = NULL;
}
-void virtio_blk_free_request(VirtIOBlockReq *req)
+static void virtio_blk_free_request(VirtIOBlockReq *req)
{
if (req) {
g_free(req);
@@ -381,7 +381,7 @@ static int multireq_compare(const void *a, const void *b)
}
}
-void virtio_blk_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb)
+static void virtio_blk_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb)
{
int i = 0, start = 0, num_reqs = 0, niov = 0, nb_sectors = 0;
uint32_t max_transfer;
@@ -468,7 +468,7 @@ static bool virtio_blk_sect_range_ok(VirtIOBlock *dev,
return true;
}
-void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
+static void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{
uint32_t type;
struct iovec *in_iov = req->elem.in_sg;
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index 180bd8db5df2..9734b4c446c5 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -80,14 +80,6 @@ typedef struct MultiReqBuffer {
bool is_write;
} MultiReqBuffer;
-void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
- VirtIOBlockReq *req);
-void virtio_blk_free_request(VirtIOBlockReq *req);
-
-void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb);
-
-void virtio_blk_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb);
-
void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq);
#endif
- [Qemu-devel] [PATCH v3 0/9] virtio: avoid inappropriate QEMU termination, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 1/9] virtio-9p: add parentheses to sizeof operator, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 2/9] virtio-blk: make some functions static,
Greg Kurz <=
- [Qemu-devel] [PATCH v3 3/9] virtio-9p: handle handle_9p_output() error, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 4/9] virtio-blk: handle virtio_blk_handle_request() errors, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 5/9] virtio-net: handle virtio_net_handle_ctrl() error, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 6/9] virtio-net: handle virtio_net_receive() errors, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 7/9] virtio-net: handle virtio_net_flush_tx() errors, Greg Kurz, 2016/09/26