diff mbox series

[23/23] xarray: Remove xas_store()

Message ID 20200422150256.23473-24-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series mm: Speedup page cache truncation | expand

Commit Message

Jan Kara April 22, 2020, 3:02 p.m. UTC
xas_store() now has no users as every call site has been transitioned
either to xas_erase() or to xas_store_noinit(). Remove xas_store() and
all remaining traces of it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 Documentation/core-api/xarray.rst |  4 ++--
 include/linux/xarray.h            |  1 -
 lib/xarray.c                      | 14 ++++----------
 3 files changed, 6 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst
index 640934b6f7b4..1c201628a15a 100644
--- a/Documentation/core-api/xarray.rst
+++ b/Documentation/core-api/xarray.rst
@@ -394,7 +394,7 @@  You can use xas_init_marks() to reset the marks on an entry
 to their default state.  This is usually all marks clear, unless the
 XArray is marked with ``XA_FLAGS_TRACK_FREE``, in which case mark 0 is set
 and all other marks are clear.  Replacing one entry with another using
-xas_store() will not reset the marks on that entry; if you want
+xas_store_noinit() will not reset the marks on that entry; if you want
 the marks reset, you should do that explicitly.
 
 The xas_load() will walk the xa_state as close to the entry
@@ -458,7 +458,7 @@  save substantial quantities of memory; for example tying 512 entries
 together will save over 4kB.
 
 You can create a multi-index entry by using XA_STATE_ORDER()
-or xas_set_order() followed by a call to xas_store().
+or xas_set_order() followed by a call to xas_store_noinit().
 Calling xas_load() with a multi-index xa_state will walk the
 xa_state to the right location in the tree, but the return value is not
 meaningful, potentially being an internal entry or ``NULL`` even when there
diff --git a/include/linux/xarray.h b/include/linux/xarray.h
index 06acef49ec95..680c0dcaeb12 100644
--- a/include/linux/xarray.h
+++ b/include/linux/xarray.h
@@ -1490,7 +1490,6 @@  static inline bool xas_retry(struct xa_state *xas, const void *entry)
 }
 
 void *xas_load(struct xa_state *);
-void *xas_store(struct xa_state *, void *entry);
 void *xas_store_noinit(struct xa_state *, void *entry);
 void *xas_erase(struct xa_state *);
 void *xas_find(struct xa_state *, unsigned long max);
diff --git a/lib/xarray.c b/lib/xarray.c
index d87045d120ad..2912d706dc01 100644
--- a/lib/xarray.c
+++ b/lib/xarray.c
@@ -625,7 +625,7 @@  static int xas_expand(struct xa_state *xas, void *head)
  * @allow_root: %true if we can store the entry in the root directly
  *
  * Most users will not need to call this function directly, as it is called
- * by xas_store().  It is useful for doing conditional store operations
+ * by xas_store_noinit().  It is useful for doing conditional store operations
  * (see the xa_cmpxchg() implementation for an example).
  *
  * Return: If the slot already existed, returns the contents of this slot.
@@ -820,7 +820,7 @@  static void *__xas_store(struct xa_state *xas, void *entry, bool init_marks)
 }
 
 /**
- * xas_store() - Store this entry in the XArray.
+ * xas_store_noinit() - Store this entry in the XArray.
  * @xas: XArray operation state.
  * @entry: New entry.
  *
@@ -828,17 +828,11 @@  static void *__xas_store(struct xa_state *xas, void *entry, bool init_marks)
  * function is essentially meaningless (it may be an internal entry or it
  * may be %NULL, even if there are non-NULL entries at some of the indices
  * covered by the range).  This is not a problem for any current users,
- * and can be changed if needed.
+ * and can be changed if needed. Note that this function does not affect
+ * xarray marks.
  *
  * Return: The old entry at this index.
  */
-void *xas_store(struct xa_state *xas, void *entry)
-{
-	return __xas_store(xas, entry, true);
-}
-EXPORT_SYMBOL_GPL(xas_store);
-
-/* This is like xas_store() but does not initialize marks on stored entry */
 void *xas_store_noinit(struct xa_state *xas, void *entry)
 {
 	return __xas_store(xas, entry, false);