diff options
author | Matthew Wilcox <willy@infradead.org> | 2018-11-26 22:08:43 +0100 |
---|---|---|
committer | Matthew Wilcox <willy@infradead.org> | 2018-12-06 14:26:17 +0100 |
commit | 55f3f7eab75c10d9b33d122670b5935ab64db50f (patch) | |
tree | 6a601ac3c08993730dfade808fe6806e1bfbf98c /mm | |
parent | radix tree: Don't return retry entries from lookup (diff) | |
download | linux-55f3f7eab75c10d9b33d122670b5935ab64db50f.tar.xz linux-55f3f7eab75c10d9b33d122670b5935ab64db50f.zip |
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.c | 4 |
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)); |