diff options
author | Jeff Dike <jdike@addtoit.com> | 2010-03-04 16:10:14 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-05-27 05:25:37 -0400 |
commit | dd1f4078f0d2de74a308f00a2dffbd550cfba59f (patch) | |
tree | d8a31277e7d37bc2fdda54abe0837bc829074c6f /drivers/vhost | |
parent | 373a83a6997bfdaf767f6a65fc5cc0054b246984 (diff) |
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>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index cd36f5ff2255..0868569d7124 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -519,13 +519,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
519 | 519 | ||
520 | /* start polling new socket */ | 520 | /* start polling new socket */ |
521 | oldsock = vq->private_data; | 521 | oldsock = vq->private_data; |
522 | if (sock == oldsock) | 522 | if (sock != oldsock){ |
523 | goto done; | 523 | vhost_net_disable_vq(n, vq); |
524 | rcu_assign_pointer(vq->private_data, sock); | ||
525 | vhost_net_enable_vq(n, vq); | ||
526 | } | ||
524 | 527 | ||
525 | vhost_net_disable_vq(n, vq); | ||
526 | rcu_assign_pointer(vq->private_data, sock); | ||
527 | vhost_net_enable_vq(n, vq); | ||
528 | done: | ||
529 | if (oldsock) { | 528 | if (oldsock) { |
530 | vhost_net_flush_vq(n, index); | 529 | vhost_net_flush_vq(n, index); |
531 | fput(oldsock->file); | 530 | fput(oldsock->file); |