Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Xarray: use xa_mark_t in xas_squash_marks() to keep code consistent

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@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Mattew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kemeng Shi and committed by
Andrew Morton
13fd5cf3 1988b318

+12 -8
+12 -8
lib/xarray.c
··· 125 125 */ 126 126 static void xas_squash_marks(const struct xa_state *xas) 127 127 { 128 - unsigned int mark = 0; 128 + xa_mark_t mark = 0; 129 129 unsigned int limit = xas->xa_offset + xas->xa_sibs + 1; 130 130 131 - do { 132 - unsigned long *marks = xas->xa_node->marks[mark]; 133 - if (find_next_bit(marks, limit, xas->xa_offset + 1) == limit) 134 - continue; 135 - __set_bit(xas->xa_offset, marks); 136 - bitmap_clear(marks, xas->xa_offset + 1, xas->xa_sibs); 137 - } while (mark++ != (__force unsigned)XA_MARK_MAX); 131 + for (;;) { 132 + unsigned long *marks = node_marks(xas->xa_node, mark); 133 + 134 + if (find_next_bit(marks, limit, xas->xa_offset + 1) != limit) { 135 + __set_bit(xas->xa_offset, marks); 136 + bitmap_clear(marks, xas->xa_offset + 1, xas->xa_sibs); 137 + } 138 + if (mark == XA_MARK_MAX) 139 + break; 140 + mark_inc(mark); 141 + } 138 142 } 139 143 140 144 /* extracts the offset within this node from the index */