[PATCH v9 17/61] xarray: Add xa_cmpxchg and xa_insert

2018-03-13 Thread Matthew Wilcox
From: Matthew Wilcox 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

[PATCH v9 17/61] xarray: Add xa_cmpxchg and xa_insert

2018-03-13 Thread Matthew Wilcox
From: Matthew Wilcox 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()