Commit a12831bf authored by Matthew Wilcox's avatar Matthew Wilcox

shmem: Convert shmem_confirm_swap to XArray

xa_load has its own RCU locking, so we can eliminate it here.
Signed-off-by: default avatarMatthew Wilcox <>
parent 62f945b6
......@@ -349,12 +349,7 @@ static int shmem_replace_entry(struct address_space *mapping,
static bool shmem_confirm_swap(struct address_space *mapping,
pgoff_t index, swp_entry_t swap)
void *item;
item = radix_tree_lookup(&mapping->i_pages, index);
return item == swp_to_radix_entry(swap);
return xa_load(&mapping->i_pages, index) == swp_to_radix_entry(swap);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment