Commit 850d9a79 authored by Kairui Song's avatar Kairui Song Committed by Peng Zhang
Browse files

lib/xarray: introduce a new helper xas_get_order

maillist inclusion
category: performance
bugzilla: https://gitee.com/openeuler/kernel/issues/I9JAY9
CVE: NA

Reference: https://lore.kernel.org/linux-mm/20240416071722.45997-1-ryncsn@gmail.com/#t

--------------------------------

simplify comment, sparse warning fix, per Matthew Wilcox

Link: https://lkml.kernel.org/r/20240416071722.45997-4-ryncsn@gmail.com


Signed-off-by: default avatarKairui Song <kasong@tencent.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 9e521295
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1751,7 +1751,7 @@ void *xa_store_range(struct xarray *xa, unsigned long first,
EXPORT_SYMBOL(xa_store_range);

/**
 * xas_get_order() - Get the order of an loaded entry after xas_load.
 * xas_get_order() - Get the order of an entry.
 * @xas: XArray operation state.
 *
 * Called after xas_load, the xas should not be in an error state.
@@ -1770,7 +1770,7 @@ int xas_get_order(struct xa_state *xas)

		if (slot >= XA_CHUNK_SIZE)
			break;
		if (!xa_is_sibling(xas->xa_node->slots[slot]))
		if (!xa_is_sibling(xa_entry(xas->xa, xas->xa_node, slot)))
			break;
		order++;
	}