Re: [PATCH] gfs2/locking/dlm: use an temp variable to reduce a spin_unlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Now applied to the GFS2 -nmw git tree. Thanks,

Steve.

On Wed, 2007-07-25 at 17:53 +0800, Denis Cheng wrote:
> this is more clear.
> 
> Signed-off-by: Denis Cheng <[email protected]>
> ---
>  fs/gfs2/locking/dlm/plock.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
> index fba1f1d..1f7b038 100644
> --- a/fs/gfs2/locking/dlm/plock.c
> +++ b/fs/gfs2/locking/dlm/plock.c
> @@ -346,15 +346,16 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
>  
>  static unsigned int dev_poll(struct file *file, poll_table *wait)
>  {
> +	unsigned int mask = 0;
> +
>  	poll_wait(file, &send_wq, wait);
>  
>  	spin_lock(&ops_lock);
> -	if (!list_empty(&send_list)) {
> -		spin_unlock(&ops_lock);
> -		return POLLIN | POLLRDNORM;
> -	}
> +	if (!list_empty(&send_list))
> +		mask = POLLIN | POLLRDNORM;
>  	spin_unlock(&ops_lock);
> -	return 0;
> +
> +	return mask;
>  }
>  
>  static const struct file_operations dev_fops = {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux