diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-03-06 06:33:49 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-03-08 11:03:05 -0500 |
commit | fcc042a2806064ffcaed7a0c5cb710eca0e99108 (patch) | |
tree | 74546d2639c7cb046b7bac0039f4d6f2a71efeda /drivers/vhost | |
parent | d47effe1be0c4fc983306a9c704632e3a087eed8 (diff) |
vhost: copy_from_user -> __copy_from_user
copy_from_user is pretty high on perf top profile,
replacing it with __copy_from_user helps.
It's also safe because we do access_ok checks during setup.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vhost.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index b0cc7f8ca4de..2ab291241635 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -1171,7 +1171,7 @@ int vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, | |||
1171 | i, vq->num, head); | 1171 | i, vq->num, head); |
1172 | return -EINVAL; | 1172 | return -EINVAL; |
1173 | } | 1173 | } |
1174 | ret = copy_from_user(&desc, vq->desc + i, sizeof desc); | 1174 | ret = __copy_from_user(&desc, vq->desc + i, sizeof desc); |
1175 | if (unlikely(ret)) { | 1175 | if (unlikely(ret)) { |
1176 | vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", | 1176 | vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", |
1177 | i, vq->desc + i); | 1177 | i, vq->desc + i); |