All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jeff Dike <jdike@addtoit.com>
Cc: Xin Xiaohui <xiaohui.xin@intel.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] vhost - cleanup
Date: Sun, 7 Mar 2010 14:08:13 +0200	[thread overview]
Message-ID: <20100307120813.GB20121@redhat.com> (raw)
In-Reply-To: <20100304211014.GA7882@localhost.localdomain>

On Thu, Mar 04, 2010 at 04:10:14PM -0500, Jeff Dike wrote:
> commit 1191aa42193d030470dbd4ab17e4fb57772534ff
> Author: Jeff Dike <jdike@localhost.localdomain>
> Date:   Thu Mar 4 14:51:20 2010 -0500
> 
>     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>


Thanks!
I am in fixes-only mode for 2.6.34, will queue this for the next release.

> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 4ada4b4..7abb883 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -518,13 +518,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);

      reply	other threads:[~2010-03-07 12:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 21:10 [PATCH 2/2] vhost - cleanup Jeff Dike
2010-03-07 12:08 ` Michael S. Tsirkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100307120813.GB20121@redhat.com \
    --to=mst@redhat.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiaohui.xin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.