diff options
author | Greg Kurz <gkurz@linux.vnet.ibm.com> | 2016-02-16 09:59:44 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-03-02 10:02:04 -0500 |
commit | 80f7d0301e7913f704d3505722f806717c61dff5 (patch) | |
tree | 54483fc68aeb9f2764392eb116aebdb4fd254a0b | |
parent | c507203756ca6303df2191c96c1385e965e2f0b7 (diff) |
vhost: rename vhost_init_used()
Looking at how callers use this, maybe we should just rename init_used
to vhost_vq_init_access. The _used suffix was a hint that we
access the vq used ring. But maybe what callers care about is
that it must be called after access_ok.
Also, this function manipulates the vq->is_le field which isn't related
to the vq used ring.
This patch simply renames vhost_init_used() to vhost_vq_init_access() as
suggested by Michael.
No behaviour change.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | drivers/vhost/net.c | 2 | ||||
-rw-r--r-- | drivers/vhost/scsi.c | 2 | ||||
-rw-r--r-- | drivers/vhost/test.c | 2 | ||||
-rw-r--r-- | drivers/vhost/vhost.c | 4 | ||||
-rw-r--r-- | drivers/vhost/vhost.h | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 9eda69e40678..7bd75ff8be26 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -917,7 +917,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
917 | 917 | ||
918 | vhost_net_disable_vq(n, vq); | 918 | vhost_net_disable_vq(n, vq); |
919 | vq->private_data = sock; | 919 | vq->private_data = sock; |
920 | r = vhost_init_used(vq); | 920 | r = vhost_vq_init_access(vq); |
921 | if (r) | 921 | if (r) |
922 | goto err_used; | 922 | goto err_used; |
923 | r = vhost_net_enable_vq(n, vq); | 923 | r = vhost_net_enable_vq(n, vq); |
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 29cfc57d496e..f898686cdd93 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -1274,7 +1274,7 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs, | |||
1274 | vq = &vs->vqs[i].vq; | 1274 | vq = &vs->vqs[i].vq; |
1275 | mutex_lock(&vq->mutex); | 1275 | mutex_lock(&vq->mutex); |
1276 | vq->private_data = vs_tpg; | 1276 | vq->private_data = vs_tpg; |
1277 | vhost_init_used(vq); | 1277 | vhost_vq_init_access(vq); |
1278 | mutex_unlock(&vq->mutex); | 1278 | mutex_unlock(&vq->mutex); |
1279 | } | 1279 | } |
1280 | ret = 0; | 1280 | ret = 0; |
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index f2882ac98726..388eec4e1a90 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c | |||
@@ -196,7 +196,7 @@ static long vhost_test_run(struct vhost_test *n, int test) | |||
196 | oldpriv = vq->private_data; | 196 | oldpriv = vq->private_data; |
197 | vq->private_data = priv; | 197 | vq->private_data = priv; |
198 | 198 | ||
199 | r = vhost_init_used(&n->vqs[index]); | 199 | r = vhost_vq_init_access(&n->vqs[index]); |
200 | 200 | ||
201 | mutex_unlock(&vq->mutex); | 201 | mutex_unlock(&vq->mutex); |
202 | 202 | ||
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 69f6463e11bd..328c54ab0154 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -1170,7 +1170,7 @@ static int vhost_update_avail_event(struct vhost_virtqueue *vq, u16 avail_event) | |||
1170 | return 0; | 1170 | return 0; |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | int vhost_init_used(struct vhost_virtqueue *vq) | 1173 | int vhost_vq_init_access(struct vhost_virtqueue *vq) |
1174 | { | 1174 | { |
1175 | __virtio16 last_used_idx; | 1175 | __virtio16 last_used_idx; |
1176 | int r; | 1176 | int r; |
@@ -1200,7 +1200,7 @@ err: | |||
1200 | vq->is_le = is_le; | 1200 | vq->is_le = is_le; |
1201 | return r; | 1201 | return r; |
1202 | } | 1202 | } |
1203 | EXPORT_SYMBOL_GPL(vhost_init_used); | 1203 | EXPORT_SYMBOL_GPL(vhost_vq_init_access); |
1204 | 1204 | ||
1205 | static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len, | 1205 | static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len, |
1206 | struct iovec iov[], int iov_size) | 1206 | struct iovec iov[], int iov_size) |
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index d3f767448a72..8f0dd0d915d4 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -148,7 +148,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *, | |||
148 | struct vhost_log *log, unsigned int *log_num); | 148 | struct vhost_log *log, unsigned int *log_num); |
149 | void vhost_discard_vq_desc(struct vhost_virtqueue *, int n); | 149 | void vhost_discard_vq_desc(struct vhost_virtqueue *, int n); |
150 | 150 | ||
151 | int vhost_init_used(struct vhost_virtqueue *); | 151 | int vhost_vq_init_access(struct vhost_virtqueue *); |
152 | int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); | 152 | int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len); |
153 | int vhost_add_used_n(struct vhost_virtqueue *, struct vring_used_elem *heads, | 153 | int vhost_add_used_n(struct vhost_virtqueue *, struct vring_used_elem *heads, |
154 | unsigned count); | 154 | unsigned count); |