[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241024132009.2267260-6-yukuai1@huaweicloud.com>
Date: Thu, 24 Oct 2024 21:19:46 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: stable@...r.kernel.org,
gregkh@...uxfoundation.org,
harry.wentland@....com,
sunpeng.li@....com,
Rodrigo.Siqueira@....com,
alexander.deucher@....com,
christian.koenig@....com,
Xinhui.Pan@....com,
airlied@...il.com,
daniel@...ll.ch,
viro@...iv.linux.org.uk,
brauner@...nel.org,
Liam.Howlett@...cle.com,
akpm@...ux-foundation.org,
hughd@...gle.com,
willy@...radead.org,
sashal@...nel.org,
srinivasan.shanmugam@....com,
chiahsuan.chung@....com,
mingo@...nel.org,
mgorman@...hsingularity.net,
yukuai3@...wei.com,
chengming.zhou@...ux.dev,
zhangpeng.00@...edance.com,
chuck.lever@...cle.com
Cc: amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
maple-tree@...ts.infradead.org,
linux-mm@...ck.org,
yukuai1@...weicloud.com,
yi.zhang@...wei.com,
yangerkun@...wei.com
Subject: [PATCH 6.6 05/28] maple_tree: preserve the tree attributes when destroying maple tree
From: Peng Zhang <zhangpeng.00@...edance.com>
commit 8e50d32c7a89bde896945e4e572ef28ccd87bbf8 upstream.
When destroying maple tree, preserve its attributes and then turn it into
an empty tree. This allows it to be reused without needing to be
reinitialized.
Link: https://lkml.kernel.org/r/20231027033845.90608-10-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@...edance.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@...cle.com>
Cc: Christian Brauner <brauner@...nel.org>
Cc: Jonathan Corbet <corbet@....net>
Cc: Mateusz Guzik <mjguzik@...il.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Michael S. Tsirkin <mst@...hat.com>
Cc: Mike Christie <michael.christie@...cle.com>
Cc: Nicholas Piggin <npiggin@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
lib/maple_tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 6f1addbbc820..97a610307d38 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6774,7 +6774,7 @@ void __mt_destroy(struct maple_tree *mt)
if (xa_is_node(root))
mte_destroy_walk(root, mt);
- mt->ma_flags = 0;
+ mt->ma_flags = mt_attr(mt);
}
EXPORT_SYMBOL_GPL(__mt_destroy);
--
2.39.2
Powered by blists - more mailing lists