summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2018-11-26 16:08:43 -0500
committerMatthew Wilcox <willy@infradead.org>2018-12-06 08:26:17 -0500
commit55f3f7eab75c10d9b33d122670b5935ab64db50f (patch)
tree6a601ac3c08993730dfade808fe6806e1bfbf98c /mm
parenteff3860bbfedbac6edac57fb0d7f3a60e860c1c3 (diff)
XArray: Add xa_cmpxchg_irq and xa_cmpxchg_bh
These convenience wrappers match the other _irq and _bh wrappers we already have. It turns out I'd already open-coded xa_cmpxchg_irq() in the shmem code, so convert that. Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index cddc72ac44d8..6adbdd349875 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -661,9 +661,7 @@ static int shmem_free_swap(struct address_space *mapping,
{
void *old;
- xa_lock_irq(&mapping->i_pages);
- old = __xa_cmpxchg(&mapping->i_pages, index, radswap, NULL, 0);
- xa_unlock_irq(&mapping->i_pages);
+ old = xa_cmpxchg_irq(&mapping->i_pages, index, radswap, NULL, 0);
if (old != radswap)
return -ENOENT;
free_swap_and_cache(radix_to_swp_entry(radswap));