linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: ira.weiny@intel.com
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/4] fs/btrfs: Convert kmap to kmap_local_page() using coccinelle
Date: Fri, 12 Mar 2021 19:58:39 +0100	[thread overview]
Message-ID: <20210312185839.GR7604@suse.cz> (raw)
In-Reply-To: <20210217024826.3466046-2-ira.weiny@intel.com>

On Tue, Feb 16, 2021 at 06:48:23PM -0800, ira.weiny@intel.com wrote:
> --- a/fs/btrfs/lzo.c
> +++ b/fs/btrfs/lzo.c
> @@ -118,7 +118,7 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping,
>  	struct workspace *workspace = list_entry(ws, struct workspace, list);
>  	int ret = 0;
>  	char *data_in;
> -	char *cpage_out;
> +	char *cpage_out, *sizes_ptr;
>  	int nr_pages = 0;
>  	struct page *in_page = NULL;
>  	struct page *out_page = NULL;
> @@ -258,10 +258,9 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping,
>  	}
>  
>  	/* store the size of all chunks of compressed data */
> -	cpage_out = kmap(pages[0]);
> -	write_compress_length(cpage_out, tot_out);
> -
> -	kunmap(pages[0]);
> +	sizes_ptr = kmap_local_page(pages[0]);
> +	write_compress_length(sizes_ptr, tot_out);
> +	kunmap_local(sizes_ptr);

Why is not cpage_out reused for this mapping? I don't see any reason for
another temporary variable, cpage_out is not used at this point.

  reply	other threads:[~2021-03-12 19:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  2:48 [PATCH 0/4] btrfs: Convert more kmaps to kmap_local_page() ira.weiny
2021-02-17  2:48 ` [PATCH 1/4] fs/btrfs: Convert kmap to kmap_local_page() using coccinelle ira.weiny
2021-03-12 18:58   ` David Sterba [this message]
2021-03-12 20:03     ` Ira Weiny
2021-03-16 11:04       ` David Sterba
2021-02-17  2:48 ` [PATCH 2/4] fs/btrfs: Convert raid5/6 kmaps to kmap_local_page() ira.weiny
2021-03-12 19:26   ` David Sterba
2021-02-17  2:48 ` [PATCH 3/4] fs/btrfs: Use kmap_local_page() in __btrfsic_submit_bio() ira.weiny
2021-02-17  2:48 ` [PATCH 4/4] fs/btrfs: Convert block context kmap's to kmap_local_page() ira.weiny
2021-03-11 21:30 ` [PATCH 0/4] btrfs: Convert more kmaps " Ira Weiny
2021-03-12 19:41 ` David Sterba
2021-03-12 20:05   ` Ira Weiny
2021-03-16 11:07     ` David Sterba
2021-03-16 16:56       ` Ira Weiny

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=20210312185839.GR7604@suse.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=ira.weiny@intel.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/4] fs/btrfs: Convert kmap to kmap_local_page() using coccinelle' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).