From: Liam R. Howlett Date: Tue, 8 Sep 2020 16:31:19 +0000 (-0400) Subject: maple_tree: Comments X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=63525103f44bf6db1d16e00b1c7f1321b9550a1c;p=users%2Fjedix%2Flinux-maple.git maple_tree: Comments Signed-off-by: Liam R. Howlett --- 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;