From: Jan Kara <jack@suse.cz>
To: Matthew Wilcox <willy@infradead.org>
Cc: <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 23/23] xarray: Remove xas_store()
Date: Wed, 22 Apr 2020 17:02:56 +0200 [thread overview]
Message-ID: <20200422150256.23473-24-jack@suse.cz> (raw)
In-Reply-To: <20200422150256.23473-1-jack@suse.cz>
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 --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);
--
2.16.4
prev parent reply other threads:[~2020-04-22 15:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 15:02 [PATCH 0/23 v2] mm: Speedup page cache truncation Jan Kara
2020-04-22 15:02 ` [PATCH 01/23] xarray: Remove stale comment Jan Kara
2020-04-22 15:02 ` [PATCH 02/23] xarray: Provide xas_erase() and xas_store_noinit() helpers Jan Kara
2020-04-22 15:02 ` [PATCH 03/23] xarray: Use xas_store_noinit() in __xa_store, __xa_insert, __xa_alloc Jan Kara
2020-04-22 15:02 ` [PATCH 04/23] xarray: Switch xa_store_range() to use xas_store_noinit() Jan Kara
2020-04-22 15:02 ` [PATCH 05/23] xarray: Use xas_erase() in __xa_erase() Jan Kara
2020-04-22 15:02 ` [PATCH 06/23] xarray: Explicitely set XA_FREE_MARK in __xa_cmpxchg() Jan Kara
2020-04-22 15:02 ` [PATCH 07/23] xarray: Switch __xa_cmpxchg() to use xas_store_noinit() Jan Kara
2020-04-22 15:02 ` [PATCH 08/23] dax: Use xas_erase() in __dax_invalidate_entry() Jan Kara
2020-04-22 15:02 ` [PATCH 09/23] dax: Use dax_store_noinit() in grab_mapping_entry() Jan Kara
2020-04-22 15:02 ` [PATCH 10/23] dax: Convert xas_store() to xas_store_noinit() Jan Kara
2020-04-22 15:02 ` [PATCH 11/23] mm: Use xas_erase() in page_cache_delete_batch() Jan Kara
2020-04-22 15:02 ` [PATCH 12/23] mm: Use xas_erase() in collapse_file() Jan Kara
2020-04-22 15:02 ` [PATCH 13/23] mm: Use xas_store_noinit() when storing non-NULL Jan Kara
2020-04-22 15:02 ` [PATCH 14/23] workingset: Use xas_store_noinit() to clear shadow entry Jan Kara
2020-04-22 15:02 ` [PATCH 15/23] swap: Use xas_erase() when removing page from swap cache Jan Kara
2020-04-22 15:02 ` [PATCH 16/23] idr: Use xas_erase() in ida_destroy() Jan Kara
2020-04-22 15:02 ` [PATCH 17/23] idr: Use xas_erase() in ida_free() Jan Kara
2020-04-22 15:02 ` [PATCH 18/23] idr: Convert xas_store() to xas_store_noinit() Jan Kara
2020-04-22 15:02 ` [PATCH 19/23] testing: Use xas_erase() to remove entries from xarray Jan Kara
2020-04-22 15:02 ` [PATCH 20/23] testing: Use xas_store_noinit() for non-NULL entries Jan Kara
2020-04-22 15:02 ` [PATCH 21/23] testing: Introduce xa_erase_order() and use it Jan Kara
2020-04-22 15:02 ` [PATCH 22/23] testing: Switch xa_store_order() to xas_store_noinit() Jan Kara
2020-04-22 15:02 ` Jan Kara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200422150256.23473-24-jack@suse.cz \
--to=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®