]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Comments
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 8 Sep 2020 16:31:19 +0000 (12:31 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:11:18 +0000 (15:11 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index ffd99a0f6cae3a9bf37bd81ba6da45d9300cd923..d163eaee08988cd563a39a191c1ac33c759f36f9 100644 (file)
@@ -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;