From 86a03873b5897bf58435ee6321082df5298523fb Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 8 Sep 2020 12:31:19 -0400 Subject: [PATCH] maple_tree: Comments Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ffd99a0f6cae..d163eaee0898 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -465,20 +465,34 @@ static inline int mas_offset(const struct ma_state *mas) return mas_alloc_req(mas); } -static inline void mas_set_offset(struct ma_state *mas, int slot) +/* + * mas_set_offset() - set the offset into a give node (slot/pivot number) + * @mas: The maple state + * @offset: The offset + * + */ +static inline void mas_set_offset(struct ma_state *mas, int offset) { - mas_set_alloc_req(mas, slot); + mas_set_alloc_req(mas, offset); } -static inline unsigned long ma_get_pivot(const struct maple_node *mn, +/* + * ma_get_pivot() - Get the pivot of a node. + * @node - the maple node. + * @piv - the pivot to retrieve. + * @type - the node type. + * + * Returns: The value of the @piv in the @node. + */ +static inline unsigned long ma_get_pivot(const struct maple_node *node, unsigned char piv, enum maple_type type) { switch (type) { case maple_arange_64: - return mn->ma64.pivot[piv]; + return node->ma64.pivot[piv]; case maple_range_64: case maple_leaf_64: - return mn->mr64.pivot[piv]; + return node->mr64.pivot[piv]; case maple_dense: default: return 0; -- 2.50.1