Skip to content

Commit

Permalink
virtio-blk: make some functions static
Browse files Browse the repository at this point in the history
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 <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
gkurz authored and mstsirkin committed Oct 9, 2016
1 parent e858289 commit d14dde5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
10 changes: 5 additions & 5 deletions hw/block/virtio-blk.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/hw/virtio/virtio-blk.h
Expand Up @@ -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

0 comments on commit d14dde5

Please sign in to comment.