All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Peng Tao <tao.peng@linux.alibaba.com>
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] [PATCH 1/2] fuse: remove unnecessary allocated_ranges
Date: Fri, 10 May 2019 11:24:27 -0400	[thread overview]
Message-ID: <20190510152427.GB15465@redhat.com> (raw)
In-Reply-To: <20190510102957.8705-2-tao.peng@linux.alibaba.com>

On Fri, May 10, 2019 at 06:29:56PM +0800, Peng Tao wrote:
> It is always nr_ranges.

This looks like a good cleanup. Will squash it with existing patches.

Vivek

> 
> Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>
> ---
>  fs/fuse/inode.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index dd16c7f6a561..cb56572c4b26 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -640,7 +640,7 @@ static int fuse_dax_mem_range_init(struct fuse_conn *fc,
>  	phys_addr_t phys_addr;
>  	int ret = 0, id;
>  	size_t dax_size = -1;
> -	unsigned long allocated_ranges = 0, i;
> +	unsigned long i;
>  
>  	id = dax_read_lock();
>  	nr_pages = dax_direct_access(dax_dev, 0, PHYS_PFN(dax_size), &kaddr,
> @@ -670,12 +670,11 @@ static int fuse_dax_mem_range_init(struct fuse_conn *fc,
>  		range->length = FUSE_DAX_MEM_RANGE_SZ;
>  		list_add_tail(&range->list, &mem_ranges);
>  		INIT_LIST_HEAD(&range->busy_list);
> -		allocated_ranges++;
>  	}
>  
>  	list_replace_init(&mem_ranges, &fc->free_ranges);
> -	fc->nr_free_ranges = allocated_ranges;
> -	fc->nr_ranges = allocated_ranges;
> +	fc->nr_free_ranges = nr_ranges;
> +	fc->nr_ranges = nr_ranges;
>  	return 0;
>  out_err:
>  	/* Free All allocated elements */
> -- 
> 2.17.1
> 


      parent reply	other threads:[~2019-05-10 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 10:29 [Virtio-fs] [PATCH 0/2] virtiofs: remove dmap when truncating inode Peng Tao
2019-05-10 10:29 ` [Virtio-fs] [PATCH 1/2] fuse: remove unnecessary allocated_ranges Peng Tao
2019-05-10 10:29   ` [Virtio-fs] [PATCH 2/2] fuse: remove dmap when truncating inode Peng Tao
2019-05-10 15:23     ` Vivek Goyal
2019-05-10 16:16       ` Tao Peng
2019-05-10 17:31         ` Vivek Goyal
2019-05-11 15:24           ` Tao Peng
2019-05-10 15:24   ` Vivek Goyal [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=20190510152427.GB15465@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=tao.peng@linux.alibaba.com \
    --cc=virtio-fs@redhat.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.