提交 d14dde5e 编写于 作者: G Greg Kurz 提交者: Michael S. Tsirkin

virtio-blk: make some functions static

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 "03de2f52 virtio-blk: do not use vring in dataplane", and

virtio_blk_free_request()

since commit "6aa46d8f virtio: move VirtQueueElement at the beginning
of the structs".

This patch converts them to static.
Signed-off-by: NGreg Kurz <groug@kaod.org>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 e8582891
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h" #include "hw/virtio/virtio-access.h"
void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq, static void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
VirtIOBlockReq *req) VirtIOBlockReq *req)
{ {
req->dev = s; req->dev = s;
req->vq = vq; req->vq = vq;
...@@ -40,7 +40,7 @@ void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq, ...@@ -40,7 +40,7 @@ void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
req->mr_next = NULL; req->mr_next = NULL;
} }
void virtio_blk_free_request(VirtIOBlockReq *req) static void virtio_blk_free_request(VirtIOBlockReq *req)
{ {
if (req) { if (req) {
g_free(req); g_free(req);
...@@ -381,7 +381,7 @@ static int multireq_compare(const void *a, const void *b) ...@@ -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; int i = 0, start = 0, num_reqs = 0, niov = 0, nb_sectors = 0;
uint32_t max_transfer; uint32_t max_transfer;
...@@ -468,7 +468,7 @@ static bool virtio_blk_sect_range_ok(VirtIOBlock *dev, ...@@ -468,7 +468,7 @@ static bool virtio_blk_sect_range_ok(VirtIOBlock *dev,
return true; return true;
} }
void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) static void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{ {
uint32_t type; uint32_t type;
struct iovec *in_iov = req->elem.in_sg; struct iovec *in_iov = req->elem.in_sg;
......
...@@ -80,14 +80,6 @@ typedef struct MultiReqBuffer { ...@@ -80,14 +80,6 @@ typedef struct MultiReqBuffer {
bool is_write; bool is_write;
} MultiReqBuffer; } 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); void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册