summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorI Hsin Cheng <richard120310@gmail.com>2025-02-11 15:18:50 +0800
committerAndrew Morton <akpm@linux-foundation.org>2025-03-16 22:06:13 -0700
commit6fbea85271c6764d512a5c5b6c1b44b762693a18 (patch)
tree4a4cdbcc4c276fbeebdc2f8164e41beac581474f /lib
parent4bc2e699e3d8f56f2aaafd14109ff77311f95336 (diff)
maple_tree: use ma_dead_node() in mte_dead_node()
Utilize ma_dead_node() in mte_dead_node(). It can prevent decoding the maple enode for a second time. Use the "node" to find parent for comparison. Link: https://lkml.kernel.org/r/20250211071850.330632-1-richard120310@gmail.com Signed-off-by: I Hsin Cheng <richard120310@gmail.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw> Cc: Shuah khan <skhan@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/maple_tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 42c65974a56c..60356ccb11ce 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -584,13 +584,10 @@ static __always_inline bool ma_dead_node(const struct maple_node *node)
*/
static __always_inline bool mte_dead_node(const struct maple_enode *enode)
{
- struct maple_node *parent, *node;
+ struct maple_node *node;
node = mte_to_node(enode);
- /* Do not reorder reads from the node prior to the parent check */
- smp_rmb();
- parent = mte_parent(enode);
- return (parent == node);
+ return ma_dead_node(node);
}
/*