The patch titled Subject: Xarray: use xa_mark_t in xas_squash_marks() to keep code consistent has been added to the -mm mm-nonmm-unstable branch. Its filename is xarray-use-xa_mark_t-in-xas_squash_marks-to-keep-code-consistent.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/xarray-use-xa_mark_t-in-xas_squash_marks-to-keep-code-consistent.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Subject: Xarray: use xa_mark_t in xas_squash_marks() to keep code consistent Date: Fri, 13 Dec 2024 20:25:23 +0800 Besides xas_squash_marks(), all functions use xa_mark_t type to iterate all possible marks. Use xa_mark_t in xas_squash_marks() to keep code consistent. Link: https://lkml.kernel.org/r/20241213122523.12764-6-shikemeng@xxxxxxxxxxxxxxx Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/xarray.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) --- a/lib/xarray.c~xarray-use-xa_mark_t-in-xas_squash_marks-to-keep-code-consistent +++ a/lib/xarray.c @@ -125,16 +125,20 @@ static inline void node_mark_all(struct */ static void xas_squash_marks(const struct xa_state *xas) { - unsigned int mark = 0; + xa_mark_t mark = 0; unsigned int limit = xas->xa_offset + xas->xa_sibs + 1; - do { - unsigned long *marks = xas->xa_node->marks[mark]; - if (find_next_bit(marks, limit, xas->xa_offset + 1) == limit) - continue; - __set_bit(xas->xa_offset, marks); - bitmap_clear(marks, xas->xa_offset + 1, xas->xa_sibs); - } while (mark++ != (__force unsigned)XA_MARK_MAX); + for (;;) { + unsigned long *marks = node_marks(xas->xa_node, mark); + + if (find_next_bit(marks, limit, xas->xa_offset + 1) != limit) { + __set_bit(xas->xa_offset, marks); + bitmap_clear(marks, xas->xa_offset + 1, xas->xa_sibs); + } + if (mark == XA_MARK_MAX) + break; + mark_inc(mark); + } } /* extracts the offset within this node from the index */ _ Patches currently in -mm which might be from shikemeng@xxxxxxxxxxxxxxx are xarray-do-not-return-sibling-entries-from-xas_find_marked.patch xarray-move-forward-index-correctly-in-xas_pause.patch xarray-distinguish-large-entries-correctly-in-xas_split_alloc.patch xarray-remove-repeat-check-in-xas_squash_marks.patch xarray-use-xa_mark_t-in-xas_squash_marks-to-keep-code-consistent.patch