void *mas_store(struct ma_state *mas, void *entry);
void *mas_erase(struct ma_state *mas);
int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp);
-void mas_store_prealloc(struct ma_state *mas, void *entry);
+int mas_store_prealloc(struct ma_state *mas, void *entry);
void *mas_find(struct ma_state *mas, unsigned long max);
void *mas_find_rev(struct ma_state *mas, unsigned long min);
int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp);
* preallocated in the maple state.
* @mas: The maple state
* @entry: The entry to store.
+ *
+ * If this does not succeed, something went very wrong.
+ *
+ * Return: 0 on success
*/
-void mas_store_prealloc(struct ma_state *mas, void *entry)
+int mas_store_prealloc(struct ma_state *mas, void *entry)
{
MA_WR_STATE(wr_mas, mas, entry);
+ int ret = 0;
mas_wr_store_setup(&wr_mas);
trace_ma_write(__func__, mas, 0, entry);
mas_wr_store_entry(&wr_mas);
- BUG_ON(mas_is_err(mas));
+ if(MT_WARN_ON(mas->tree, mas_is_err(mas)))
+ ret = xa_err(mas->node);
+
mas_destroy(mas);
+ return ret;
}
EXPORT_SYMBOL_GPL(mas_store_prealloc);