]> git.baikalelectronics.ru Git - kernel.git/commit
xarray: Add XArray conditional store operations
authorMatthew Wilcox <willy@infradead.org>
Fri, 10 Nov 2017 20:34:55 +0000 (15:34 -0500)
committerMatthew Wilcox <willy@infradead.org>
Sun, 21 Oct 2018 14:45:58 +0000 (10:45 -0400)
commit68f7ce6ca0f787b7d59e664841685b05aaee7376
tree4efdedeabd066e15a542b28f21a47731c5323b5b
parent79fc60bcd722083b8a1547a3b0e8526520ba60fe
xarray: Add XArray conditional store operations

Like cmpxchg(), xa_cmpxchg will only store to the index if the current
entry matches the old entry.  It returns the current entry, which is
usually more useful than the errno returned by radix_tree_insert().
For the users who really only want the errno, the xa_insert() wrapper
provides a more convenient calling convention.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
include/linux/xarray.h
lib/test_xarray.c
lib/xarray.c