#include <linux/kernel.h>
#include <linux/rcupdate.h>
#include <linux/spinlock.h>
-#include <linux/types.h>
-#include <linux/xarray.h>
/*
* Allocated nodes are mutable until they have been inserted into the tree,
*
* Nodes in the tree point to their parent unless bit 0 is set.
*/
-#ifdef CONFIG_64BIT
+#if defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64)
#define MAPLE_NODE_SLOTS 15 /* 128 bytes including ->parent */
#define MAPLE_RANGE64_SLOTS 8 /* 128 bytes */
#define MAPLE_ARANGE64_SLOTS 5 /* 120 bytes */
static inline void mas_reset(struct ma_state *mas)
{
mas->node = MAS_START;
-}
-
-/**
- * mas_retry() - Retry the operation if appropriate.
- * @mas: Maple Tree operation state.
- * @entry: Entry from tree.
- *
- * The advanced functions may sometimes return an internal entry, such as
- * a retry entry or a zero entry. This function sets up the @mas to restart
- * the walk from the head of the array if needed.
- *
- * Context: Any context.
- * Return: true if the operation needs to be retried.
- */
-static inline bool mas_retry(struct ma_state *mas, const void *entry)
-{
- if (xa_is_skip(entry))
- return true;
- if (xa_is_deleted(entry))
- return true;
- if (xa_is_zero(entry))
- return true;
- if (!xa_is_retry(entry))
- return false;
- mas_reset(mas);
- return true;
+ mas->max = ULONG_MAX;
+ mas->min = 0;
}
/**
for (entry = mt_find(mt, index, max); \
entry; entry = mt_find_after(mt, &index, max))
+bool mas_retry(struct ma_state *mas, const void *entry);
+
/**
* mas_set_range() - Set up Maple Tree operation state for a different index.
* @mas: Maple Tree operation state.
mas_set_range(mas, index, index);
}
-#endif
+#endif /*_LINUX_MAPLE_TREE_H */
*/
#include <linux/maple_tree.h>
+#include <linux/xarray.h>
+#include <linux/types.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <asm/barrier.h>
mas->max = _mte_get_pivot(mas->node, slot, type);
}
+/**
+ * mas_retry() - Retry the operation if appropriate.
+ * @mas: Maple Tree operation state.
+ * @entry: Entry from tree.
+ *
+ * The advanced functions may sometimes return an internal entry, such as
+ * a retry entry or a zero entry. This function sets up the @mas to restart
+ * the walk from the head of the array if needed.
+ *
+ * Context: Any context.
+ * Return: true if the operation needs to be retried.
+ */
+bool mas_retry(struct ma_state *mas, const void *entry)
+{
+ if (xa_is_skip(entry))
+ return true;
+ if (xa_is_deleted(entry))
+ return true;
+ if (xa_is_zero(entry))
+ return true;
+ if (!xa_is_retry(entry))
+ return false;
+ mas_reset(mas);
+ return true;
+}
+
static inline void mas_encoded_parent(struct ma_state *mas)
{
struct maple_enode *p_enode, *gp_enode;