Lines Matching refs:ida
246 struct ida {
255 #define DEFINE_IDA(name) struct ida name = IDA_INIT(name)
257 int ida_alloc_range(struct ida *, unsigned int min, unsigned int max, gfp_t);
258 void ida_free(struct ida *, unsigned int id);
259 void ida_destroy(struct ida *ida);
263 * @ida: IDA handle.
273 static inline int ida_alloc(struct ida *ida, gfp_t gfp)
275 return ida_alloc_range(ida, 0, ~0, gfp);
280 * @ida: IDA handle.
291 static inline int ida_alloc_min(struct ida *ida, unsigned int min, gfp_t gfp)
293 return ida_alloc_range(ida, min, ~0, gfp);
298 * @ida: IDA handle.
309 static inline int ida_alloc_max(struct ida *ida, unsigned int max, gfp_t gfp)
311 return ida_alloc_range(ida, 0, max, gfp);
314 static inline void ida_init(struct ida *ida)
316 xa_init_flags(&ida->xa, IDA_INIT_FLAGS);
323 #define ida_simple_get(ida, start, end, gfp) \
324 ida_alloc_range(ida, start, (end) - 1, gfp)
325 #define ida_simple_remove(ida, id) ida_free(ida, id)
327 static inline bool ida_is_empty(const struct ida *ida)
329 return xa_empty(&ida->xa);