[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230425110511.11680-9-zhangpeng.00@bytedance.com>
Date: Tue, 25 Apr 2023 19:05:10 +0800
From: Peng Zhang <zhangpeng.00@...edance.com>
To: Liam.Howlett@...cle.com
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, maple-tree@...ts.infradead.org,
Peng Zhang <zhangpeng.00@...edance.com>
Subject: [PATCH 8/9] maple_tree: Remove the redundant check of mas->offset in mas_empty_area/area_rev()
In mas_empty_area(), after mas_awalk() returns, if EBUSY is not set,
then mas->offset must be valid, no need to check. Same in
mas_empty_area_rev(), so delete it.
Signed-off-by: Peng Zhang <zhangpeng.00@...edance.com>
---
lib/maple_tree.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 8bfa837b7b752..964214de2ed18 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -5305,13 +5305,9 @@ int mas_empty_area(struct ma_state *mas, unsigned long min,
return xa_err(mas->node);
offset = mas->offset;
- if (unlikely(offset == MAPLE_NODE_SLOTS))
- return -EBUSY;
-
mt = mte_node_type(mas->node);
pivots = ma_pivots(mas_mn(mas), mt);
mas->index = max(mas->index, mas_safe_min(mas, pivots, offset));
-
mas->last = mas->index + size - 1;
return 0;
}
@@ -5365,9 +5361,6 @@ int mas_empty_area_rev(struct ma_state *mas, unsigned long min,
if (mas_is_err(mas))
return xa_err(mas->node);
- if (unlikely(mas->offset == MAPLE_NODE_SLOTS))
- return -EBUSY;
-
/* Trim the upper limit to the max. */
if (max < mas->last)
mas->last = max;
--
2.20.1
Powered by blists - more mailing lists