linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] mm: Remove struct page from get_shadow_from_swap_cache
Date: Thu, 4 Apr 2024 20:40:13 +0200	[thread overview]
Message-ID: <834da4aa-3b49-4603-bda7-a19154570615@redhat.com> (raw)
In-Reply-To: <20240402201659.918308-1-willy@infradead.org>

On 02.04.24 22:16, Matthew Wilcox (Oracle) wrote:
> We don't actually use any parts of struct page; all we do is check the
> value of the pointer.  So give the pointer the appropriate name & type.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>   mm/swap_state.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/swap_state.c b/mm/swap_state.c
> index f3c379e93bc6..c00ef2f18f2b 100644
> --- a/mm/swap_state.c
> +++ b/mm/swap_state.c
> @@ -73,11 +73,11 @@ void *get_shadow_from_swap_cache(swp_entry_t entry)
>   {
>   	struct address_space *address_space = swap_address_space(entry);
>   	pgoff_t idx = swp_offset(entry);
> -	struct page *page;
> +	void *shadow;
>   
> -	page = xa_load(&address_space->i_pages, idx);
> -	if (xa_is_value(page))
> -		return page;
> +	shadow = xa_load(&address_space->i_pages, idx);
> +	if (xa_is_value(shadow))
> +		return shadow;
>   	return NULL;
>   }
>   

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



      reply	other threads:[~2024-04-04 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 20:16 Matthew Wilcox (Oracle)
2024-04-04 18:40 ` David Hildenbrand [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=834da4aa-3b49-4603-bda7-a19154570615@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox