_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)
{
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)
{