summaryrefslogtreecommitdiff
path: root/drivers/vhost/vdpa.c
diff options
context:
space:
mode:
authorEli Cohen <elic@nvidia.com>2022-01-11 20:33:57 +0200
committerMichael S. Tsirkin <mst@redhat.com>2022-01-14 18:50:54 -0500
commitf6d955d80830b6e6f6a170be68cc3628f36365dd (patch)
treedf85dffd566531fe0c376f6387e4130dbb799176 /drivers/vhost/vdpa.c
parentb2ce6197c9c9be0ecc2a636f3b2f35886ce09a98 (diff)
vdpa: Avoid taking cf_mutex lock on get status
Avoid the wrapper holding cf_mutex since it is not protecting anything. To avoid confusion and unnecessary overhead incurred by it, remove. Fixes: f489f27bc0ab ("vdpa: Sync calls set/get config/status with cf_mutex") Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20220111183400.38418-2-elic@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Si-Wei Liu<si-wei.liu@oracle.com> Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vhost/vdpa.c')
-rw-r--r--drivers/vhost/vdpa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 6e7edaf2472b..0ed6cbadb52d 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -142,9 +142,10 @@ static long vhost_vdpa_get_device_id(struct vhost_vdpa *v, u8 __user *argp)
static long vhost_vdpa_get_status(struct vhost_vdpa *v, u8 __user *statusp)
{
struct vdpa_device *vdpa = v->vdpa;
+ const struct vdpa_config_ops *ops = vdpa->config;
u8 status;
- status = vdpa_get_status(vdpa);
+ status = ops->get_status(vdpa);
if (copy_to_user(statusp, &status, sizeof(status)))
return -EFAULT;
@@ -163,7 +164,7 @@ static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp)
if (copy_from_user(&status, statusp, sizeof(status)))
return -EFAULT;
- status_old = vdpa_get_status(vdpa);
+ status_old = ops->get_status(vdpa);
/*
* Userspace shouldn't remove status bits unless reset the