]> www.infradead.org Git - users/dwmw2/linux.git/commit
xarray: extract helper from __xa_{insert,cmpxchg}
authorTamir Duberstein <tamird@gmail.com>
Tue, 12 Nov 2024 19:25:37 +0000 (14:25 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 13 Jan 2025 04:20:58 +0000 (20:20 -0800)
commit79ada2ae66153e285b3717ee4d4a56c8e517c1fa
tree84f152bbbb8421ce9d693d54c0c7fa95cc6ce3e3
parent74e2712b14e35a200ba24b0b99e56a2d91499ff0
xarray: extract helper from __xa_{insert,cmpxchg}

Reduce code duplication by extracting a static inline function.  This
function is identical to __xa_cmpxchg with the exception that it does not
coerce zero entries to null on the return path.

[tamird@gmail.com: fix __xa_erase()]
Link: https://lkml.kernel.org/r/CAJ-ks9kN_qddZ3Ne5d=cADu5POC1rHd4rQcbVSD_spnZOrLLZg@mail.gmail.com
Link: https://lkml.kernel.org/r/20241112-xarray-insert-cmpxchg-v1-2-dc2bdd8c4136@gmail.com
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/xarray.c