mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
shmem: Convert shmem_confirm_swap to XArray
xa_load has its own RCU locking, so we can eliminate it here. Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
parent
62f945b6a7
commit
a12831bf42
@ -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;
|
||||
|
||||
rcu_read_lock();
|
||||
item = radix_tree_lookup(&mapping->i_pages, index);
|
||||
rcu_read_unlock();
|
||||
return item == swp_to_radix_entry(swap);
|
||||
return xa_load(&mapping->i_pages, index) == swp_to_radix_entry(swap);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user