Skip to content

Commit

Permalink
mm: remove struct page from get_shadow_from_swap_cache
Browse files Browse the repository at this point in the history
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.

Link: https://lkml.kernel.org/r/20240402201659.918308-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Apr 26, 2024
1 parent bc7996c commit 4c773a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mm/swap_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4c773a4

Please sign in to comment.