diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2024-04-25 20:59:52 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-04-25 20:59:52 -0700 |
commit | e0d2807895449bb62198a806692b9232b10a2537 (patch) | |
tree | d2d0c65fb7ec0834527552586bef2f15c823353c | |
parent | aec3a0e82b275a9c0008c27c347032f10c251037 (diff) | |
download | 25-new-e0d2807895449bb62198a806692b9232b10a2537.tar.gz |
foo
-rw-r--r-- | patches/lib-xarray-introduce-a-new-helper-xas_get_order.patch | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/patches/lib-xarray-introduce-a-new-helper-xas_get_order.patch b/patches/lib-xarray-introduce-a-new-helper-xas_get_order.patch index 80c7c1113..52814bf6d 100644 --- a/patches/lib-xarray-introduce-a-new-helper-xas_get_order.patch +++ b/patches/lib-xarray-introduce-a-new-helper-xas_get_order.patch @@ -11,6 +11,8 @@ xas_get_order with EXPORT_SYMBOL_GPL. Also fix a sparse warning by checking the slot value with xa_entry instead of accessing it directly, as suggested by Matthew Wilcox. +[kasong@tencent.com: simplify comment, sparse warning fix, per Matthew Wilcox] + Link: https://lkml.kernel.org/r/20240416071722.45997-4-ryncsn@gmail.com Link: https://lkml.kernel.org/r/20240415171857.19244-4-ryncsn@gmail.com Signed-off-by: Kairui Song <kasong@tencent.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> @@ -46,7 +48,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> unsigned int order) --- a/lib/test_xarray.c~lib-xarray-introduce-a-new-helper-xas_get_order +++ a/lib/test_xarray.c -@@ -1989,6 +1989,39 @@ static noinline void check_get_order(str +@@ -1984,6 +1984,39 @@ static noinline void check_get_order(str } } @@ -86,7 +88,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> static noinline void check_destroy(struct xarray *xa) { unsigned long index; -@@ -2040,6 +2073,7 @@ static int xarray_checks(void) +@@ -2035,6 +2068,7 @@ static int xarray_checks(void) check_multi_store(&array); check_multi_store_advanced(&array); check_get_order(&array); @@ -103,7 +105,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> - * xa_get_order() - Get the order of an entry. - * @xa: XArray. - * @index: Index of the entry. -+ * 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. @@ -135,7 +137,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> if (slot >= XA_CHUNK_SIZE) break; - if (!xa_is_sibling(xas.xa_node->slots[slot])) -+ if (!xa_is_sibling(xas->xa_node->slots[slot])) ++ if (!xa_is_sibling(xa_entry(xas->xa, xas->xa_node, slot))) break; order++; } |