]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Add some comments to ma_rev_alloc and ma_alloc
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 2 Aug 2019 15:29:20 +0000 (11:29 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 2 Aug 2019 15:29:20 +0000 (11:29 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 07be6c796b088daf14f134a12463c01322919d4b..d32b23ec6dc049f5294fa1b02a63f98e8ced0015 100644 (file)
@@ -3142,6 +3142,16 @@ static int mas_fill_gap(struct ma_state *mas, void *entry, unsigned char slot,
        _ma_insert(mas, entry, slot);
        return 0;
 }
+
+/** Private
+ * ma_alloc() - Allocate a range.
+ *
+ * Give a size, a minimum starting point (mas->index), a maximum (mas->last),
+ * and a size (size), find the lowest location in the min-max window in the
+ * tree which this allocation fits and set index to that value.
+ *
+ * Returns: 0 on success, -EBUSY otherwise.
+ */
 static inline int ma_alloc(struct ma_state *mas, void *entry,
                unsigned long size, unsigned long *index)
 {
@@ -3185,6 +3195,15 @@ static inline int ma_alloc(struct ma_state *mas, void *entry,
 no_gap:
        return -EBUSY;
 }
+/** Private
+ * ma_rev_alloc() - Reverse allocate a range.
+ *
+ * Give a size, a minimum value (mas->index), a maximum starting point
+ * (mas->last), and a size (size), find the largest location in the min-max
+ * window in tree which this allocation fits and set index to that value.
+ *
+ * Returns: 0 on success, -EBUSY otherwise.
+ */
 static inline int ma_rev_alloc(struct ma_state *mas, void *entry,
                unsigned long size, unsigned long *index)
 {