maple_tree: root node could be handled by !p_slot too
Subsystems (3)
PATCH 1/1 maple_tree: root node could be handled by !p_slot too
For a root node, mte_parent_slot() return 0, this exactly fits the following !p_slot check.
So we can remove the special handling for root node.
--- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/maple_tree.c +1 -3
@@ -2100,9 +2100,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas) {unsigned int p_slot =mte_parent_slot (mas->node); -if (mte_is_root (mas->node)) -return false; - +/* For root node, p_slot is set to 0 by mte_parent_slot(). */ if (!p_slot)return false;
Signature · 1 line
2.34.1
Quoted 2 lines · Wei Yang
For a root node,
mte_parent_slot()return 0, this exactly fits the following !p_slot check.
This sounds right, I will have to look deeper at it though.
Thanks,
Liam
Quoted 27 lines
So we can remove the special handling for root node.
Signed-off-by Wei Yang <[email protected]>CC Liam R. Howlett <[email protected]>--- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)lib/maple_tree.c +1
-3@@ -2100,9 +2100,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas) {unsigned int p_slot =mte_parent_slot (mas->node); -if (mte_is_root (mas->node)) -return false; - +/* For root node, p_slot is set to 0 by mte_parent_slot(). */ if (!p_slot)return false;Signature · 1 line
2.34.1
Quoted 6 lines · Liam R. Howlett
Quoted 2 lines · Wei Yang
For a root node,
mte_parent_slot()return 0, this exactly fits the following !p_slot check.This sounds right, I will have to look deeper at it though.
Hi, Liam
I guess you are back?
Quoted 30 lines
Thanks,
LiamQuoted 27 lines
So we can remove the special handling for root node.
Signed-off-by Wei Yang <[email protected]>CC Liam R. Howlett <[email protected]>--- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)lib/maple_tree.c +1
-3@@ -2100,9 +2100,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas) {unsigned int p_slot =mte_parent_slot (mas->node); -if (mte_is_root (mas->node)) -return false; - +/* For root node, p_slot is set to 0 by mte_parent_slot(). */ if (!p_slot)return false;Signature · 1 line
2.34.1
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 11 lines · Wei Yang
Quoted 6 lines · Liam R. Howlett
Quoted 2 lines · Wei Yang
For a root node,
mte_parent_slot()return 0, this exactly fits the following !p_slot check.This sounds right, I will have to look deeper at it though.
Hi, Liam
I guess you are back?
Yes. I'll get to this soon. I believe you have two sets (or three?) I have to look at.
Thanks,
Liam
Quoted 35 lines
Quoted 31 lines
Thanks,
LiamQuoted 27 lines
So we can remove the special handling for root node.
Signed-off-by Wei Yang <[email protected]>CC Liam R. Howlett <[email protected]>--- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)lib/maple_tree.c +1
-3@@ -2100,9 +2100,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas) {unsigned int p_slot =mte_parent_slot (mas->node); -if (mte_is_root (mas->node)) -return false; - +/* For root node, p_slot is set to 0 by mte_parent_slot(). */ if (!p_slot)return false;Signature · 1 line
2.34.1Signature · 2 lines
Wei Yang Help you, Help me
Quoted 9 lines · Liam R. Howlett
Quoted 8 lines · Wei Yang
Quoted 6 lines · Liam R. Howlett
Quoted 2 lines · Wei Yang
For a root node,
mte_parent_slot()return 0, this exactly fits the following !p_slot check.This sounds right, I will have to look deeper at it though.
Quoted 6 lines
Quoted 3 lines
Hi, Liam
I guess you are back?
Yes. I'll get to this soon. I believe you have two sets (or three?) I have to look at.
Thanks, I have sent other two.
While I have accumulated other changes, not sure you prefer to hold a while or it is okay to go on.
Quoted 4 lines
Thanks,
Liam
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 7 lines · Wei Yang
For a root node,
mte_parent_slot()return 0, this exactly fits the following !p_slot check.So we can remove the special handling for root node.
Signed-off-by Wei Yang <[email protected]>CC Liam R. Howlett <[email protected]>
Quoted 22 lines
--- lib/maple_tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)lib/maple_tree.c +1
-3@@ -2100,9 +2100,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas) {unsigned int p_slot =mte_parent_slot (mas->node); -if (mte_is_root (mas->node)) -return false; - +/* For root node, p_slot is set to 0 by mte_parent_slot(). */ if (!p_slot)return false;Signature · 1 line
2.34.1