Lines Matching defs:xa
983 xa_init_flags(struct xarray *xa, gfp_t flags)
985 SPLAY_INIT(&xa->xa_tree);
987 mtx_init(&xa->xa_lock, IPL_TTY);
989 mtx_init(&xa->xa_lock, IPL_NONE);
990 xa->xa_flags = flags;
994 xa_destroy(struct xarray *xa)
998 while ((id = SPLAY_MIN(xarray_tree, &xa->xa_tree))) {
999 SPLAY_REMOVE(xarray_tree, &xa->xa_tree, id);
1006 __xa_alloc(struct xarray *xa, u32 *id, void *entry, struct xarray_range xr,
1013 if (start == 0 && (xa->xa_flags & XA_FLAGS_ALLOC1))
1019 mtx_leave(&xa->xa_lock);
1021 mtx_enter(&xa->xa_lock);
1029 while (SPLAY_INSERT(xarray_tree, &xa->xa_tree, xid)) {
1050 __xa_alloc_cyclic(struct xarray *xa, u32 *id, void *entry,
1053 int r = __xa_alloc(xa, id, entry, xr, gfp);
1059 __xa_erase(struct xarray *xa, unsigned long index)
1065 res = SPLAY_FIND(xarray_tree, &xa->xa_tree, &find);
1067 SPLAY_REMOVE(xarray_tree, &xa->xa_tree, res);
1075 __xa_load(struct xarray *xa, unsigned long index)
1080 res = SPLAY_FIND(xarray_tree, &xa->xa_tree, &find);
1087 __xa_store(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
1093 return __xa_erase(xa, index);
1096 res = SPLAY_FIND(xarray_tree, &xa->xa_tree, &find);
1109 mtx_leave(&xa->xa_lock);
1111 mtx_enter(&xa->xa_lock);
1117 if (SPLAY_INSERT(xarray_tree, &xa->xa_tree, res) != NULL)
1123 xa_get_next(struct xarray *xa, unsigned long *index)
1127 SPLAY_FOREACH(res, xarray_tree, &xa->xa_tree) {