linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Remove struct page from get_shadow_from_swap_cache
@ 2024-04-02 20:16 Matthew Wilcox (Oracle)
  2024-04-04 18:40 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox (Oracle) @ 2024-04-02 20:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Matthew Wilcox (Oracle), linux-mm

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;
 }
 
-- 
2.43.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: Remove struct page from get_shadow_from_swap_cache
  2024-04-02 20:16 [PATCH] mm: Remove struct page from get_shadow_from_swap_cache Matthew Wilcox (Oracle)
@ 2024-04-04 18:40 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2024-04-04 18:40 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), Andrew Morton; +Cc: linux-mm

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-04 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 20:16 [PATCH] mm: Remove struct page from get_shadow_from_swap_cache Matthew Wilcox (Oracle)
2024-04-04 18:40 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox