diff options
author | Tonghao Zhang <xiangxia.m.yue@gmail.com> | 2018-09-25 15:36:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-27 06:25:55 +0300 |
commit | a6a67a2f343c613752165101208bd096b0bba6e1 (patch) | |
tree | 6a6f2ba71ada9bf34eef5e1c6bd1533f5adae590 /drivers/vhost | |
parent | 78139c94dc8c96a478e67dab3bee84dc6eccb5fd (diff) | |
download | linux-a6a67a2f343c613752165101208bd096b0bba6e1.tar.xz |
net: vhost: replace magic number of lock annotation
Use the VHOST_NET_VQ_XXX as a subclass for mutex_lock_nested.
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 1bff6bc8161a..5fe57ab968c3 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -856,7 +856,7 @@ static void handle_tx(struct vhost_net *net) struct vhost_virtqueue *vq = &nvq->vq; struct socket *sock; - mutex_lock(&vq->mutex); + mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_TX); sock = vq->private_data; if (!sock) goto out; @@ -921,7 +921,7 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk, /* Flush batched heads first */ vhost_net_signal_used(rnvq); /* Both tx vq and rx socket were polled here */ - mutex_lock_nested(&tvq->mutex, 1); + mutex_lock_nested(&tvq->mutex, VHOST_NET_VQ_TX); vhost_disable_notify(&net->dev, tvq); preempt_disable(); @@ -1063,7 +1063,7 @@ static void handle_rx(struct vhost_net *net) __virtio16 num_buffers; int recv_pkts = 0; - mutex_lock_nested(&vq->mutex, 0); + mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); sock = vq->private_data; if (!sock) goto out; |