@@ -1738,9 +1738,6 @@ void *xa_store(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
17381738}
17391739EXPORT_SYMBOL (xa_store );
17401740
1741- static inline void * __xa_cmpxchg_raw (struct xarray * xa , unsigned long index ,
1742- void * old , void * entry , gfp_t gfp );
1743-
17441741/**
17451742 * __xa_cmpxchg() - Conditionally replace an entry in the XArray.
17461743 * @xa: XArray.
@@ -1767,7 +1764,29 @@ void *__xa_cmpxchg(struct xarray *xa, unsigned long index,
17671764}
17681765EXPORT_SYMBOL (__xa_cmpxchg );
17691766
1770- static inline void * __xa_cmpxchg_raw (struct xarray * xa , unsigned long index ,
1767+ /**
1768+ * __xa_cmpxchg_raw() - Conditionally replace an entry in the XArray.
1769+ * @xa: XArray.
1770+ * @index: Index into array.
1771+ * @old: Old value to test against.
1772+ * @entry: New value to place in array.
1773+ * @gfp: Memory allocation flags.
1774+ *
1775+ * You must already be holding the xa_lock when calling this function.
1776+ * It will drop the lock if needed to allocate memory, and then reacquire
1777+ * it afterwards.
1778+ *
1779+ * If the entry at @index is the same as @old, replace it with @entry.
1780+ * If the return value is equal to @old, then the exchange was successful.
1781+ *
1782+ * This function is the same as __xa_cmpxchg() except that it does not coerce
1783+ * XA_ZERO_ENTRY to NULL on egress.
1784+ *
1785+ * Context: Any context. Expects xa_lock to be held on entry. May
1786+ * release and reacquire xa_lock if @gfp flags permit.
1787+ * Return: The old value at this index or xa_err() if an error happened.
1788+ */
1789+ void * __xa_cmpxchg_raw (struct xarray * xa , unsigned long index ,
17711790 void * old , void * entry , gfp_t gfp )
17721791{
17731792 XA_STATE (xas , xa , index );
@@ -1787,6 +1806,7 @@ static inline void *__xa_cmpxchg_raw(struct xarray *xa, unsigned long index,
17871806
17881807 return xas_result (& xas , curr );
17891808}
1809+ EXPORT_SYMBOL (__xa_cmpxchg_raw );
17901810
17911811/**
17921812 * __xa_insert() - Store this entry in the XArray if no entry is present.
0 commit comments