summaryrefslogtreecommitdiff
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2017-11-22 16:34:58 +0300
committerMatthew Wilcox <willy@infradead.org>2018-10-21 17:46:39 +0300
commita12831bf4293d38518e41b80dd897af0122bb268 (patch)
treeb8760db3d1fa6cecfa3ec632808c7e7ebfc7cb02 /mm/shmem.c
parent62f945b6a7b8cda6d1f35941eb374276f7b8749a (diff)
downloadlinux-a12831bf4293d38518e41b80dd897af0122bb268.tar.xz
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>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 5697c8fecdfc..ce91569426f3 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -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);
}
/*