mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
vhost-net: minor cleanup
Delete a label and goto from vhost_net_set_backend Inverting a test allows a label and goto to be eliminated. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
373a83a699
commit
dd1f4078f0
1 changed files with 5 additions and 6 deletions
|
@ -519,13 +519,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
|
|||
|
||||
/* start polling new socket */
|
||||
oldsock = vq->private_data;
|
||||
if (sock == oldsock)
|
||||
goto done;
|
||||
if (sock != oldsock){
|
||||
vhost_net_disable_vq(n, vq);
|
||||
rcu_assign_pointer(vq->private_data, sock);
|
||||
vhost_net_enable_vq(n, vq);
|
||||
}
|
||||
|
||||
vhost_net_disable_vq(n, vq);
|
||||
rcu_assign_pointer(vq->private_data, sock);
|
||||
vhost_net_enable_vq(n, vq);
|
||||
done:
|
||||
if (oldsock) {
|
||||
vhost_net_flush_vq(n, index);
|
||||
fput(oldsock->file);
|
||||
|
|
Loading…
Reference in a new issue