|
DEFINE_XARRAY_ALLOC1() - Define an XArray which allocates IDs starting at 1.
This is intended for file scope definitions of allocating XArrays. See also DEFINE_XARRAY().
|
| #define | DEFINE_XARRAY_FLAGS(name, flags) struct xarray name = XARRAY_INIT(name, flags) |
| |
| #define | DEFINE_XARRAY(name) DEFINE_XARRAY_FLAGS(name, 0) |
| |
| #define | DEFINE_XARRAY_ALLOC(name) DEFINE_XARRAY_FLAGS(name, XA_FLAGS_ALLOC) |
| |
| #define | DEFINE_XARRAY_ALLOC1(name) DEFINE_XARRAY_FLAGS(name, XA_FLAGS_ALLOC1) |
| |
| #define | xa_for_each_range(xa, index, entry, start, last) |
| |
| #define | xa_for_each_start(xa, index, entry, start) xa_for_each_range(xa, index, entry, start, ULONG_MAX) |
| |
| #define | xa_for_each(xa, index, entry) xa_for_each_start(xa, index, entry, 0) |
| |
| #define | xa_for_each_marked(xa, index, entry, filter) |
| |
| #define | xa_trylock(xa) spin_trylock(&(xa)->xa_lock) |
| |
| #define | xa_lock(xa) spin_lock(&(xa)->xa_lock) |
| |
| #define | xa_unlock(xa) spin_unlock(&(xa)->xa_lock) |
| |
| #define | xa_lock_bh(xa) spin_lock_bh(&(xa)->xa_lock) |
| |
| #define | xa_unlock_bh(xa) spin_unlock_bh(&(xa)->xa_lock) |
| |
| #define | xa_lock_irq(xa) spin_lock_irq(&(xa)->xa_lock) |
| |
| #define | xa_unlock_irq(xa) spin_unlock_irq(&(xa)->xa_lock) |
| |
| #define | xa_lock_irqsave(xa, flags) spin_lock_irqsave(&(xa)->xa_lock, flags) |
| |
| #define | xa_unlock_irqrestore(xa, flags) spin_unlock_irqrestore(&(xa)->xa_lock, flags) |
| |
| #define | xa_lock_nested(xa, subclass) spin_lock_nested(&(xa)->xa_lock, subclass) |
| |
| #define | xa_lock_bh_nested(xa, subclass) spin_lock_bh_nested(&(xa)->xa_lock, subclass) |
| |
| #define | xa_lock_irq_nested(xa, subclass) spin_lock_irq_nested(&(xa)->xa_lock, subclass) |
| |
| #define | xa_lock_irqsave_nested(xa, flags, subclass) spin_lock_irqsave_nested(&(xa)->xa_lock, flags, subclass) |
| |
| #define | XA_CHUNK_SHIFT (IS_ENABLED(CONFIG_BASE_SMALL) ? 4 : 6) |
| |
| #define | XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT) |
| |
| #define | XA_CHUNK_MASK (XA_CHUNK_SIZE - 1) |
| |
| #define | XA_MAX_MARKS 3 |
| |
| #define | XA_MARK_LONGS BITS_TO_LONGS(XA_CHUNK_SIZE) |
| |
| #define | XA_BUG_ON(xa, x) do { } while (0) |
| |
| #define | XA_NODE_BUG_ON(node, x) do { } while (0) |
| |
| #define | XA_RETRY_ENTRY xa_mk_internal(256) |
| |
| #define | XA_ERROR(errno) ((struct xa_node *)(((unsigned long)errno << 2) | 2UL)) |
| |
| #define | XAS_BOUNDS ((struct xa_node *)1UL) |
| |
| #define | XAS_RESTART ((struct xa_node *)3UL) |
| |
| #define | __XA_STATE(array, index, shift, sibs) |
| |
| typedef void(* | xa_update_node_t) (struct xa_node *node) |
| |
| void * | xa_load (struct xarray *, unsigned long index) |
| |
| void * | xa_store (struct xarray *, unsigned long index, void *entry, gfp_t) |
| |
| void * | xa_erase (struct xarray *, unsigned long index) |
| |
| void * | xa_store_range (struct xarray *, unsigned long first, unsigned long last, void *entry, gfp_t) |
| |
| bool | xa_get_mark (struct xarray *, unsigned long index, xa_mark_t) |
| |
| void | xa_set_mark (struct xarray *, unsigned long index, xa_mark_t) |
| |
| void | xa_clear_mark (struct xarray *, unsigned long index, xa_mark_t) |
| |
| void * | xa_find (struct xarray *xa, unsigned long *index, unsigned long max, xa_mark_t) __attribute__((nonnull(2))) |
| |
| void * | xa_find_after (struct xarray *xa, unsigned long *index, unsigned long max, xa_mark_t) __attribute__((nonnull(2))) |
| |
| unsigned int | xa_extract (struct xarray *, void **dst, unsigned long start, unsigned long max, unsigned int n, xa_mark_t) |
| |
| void | xa_destroy (struct xarray *) |
| |
| void * | __xa_erase (struct xarray *, unsigned long index) |
| |
| void * | __xa_store (struct xarray *, unsigned long index, void *entry, gfp_t) |
| |
| void * | __xa_cmpxchg (struct xarray *, unsigned long index, void *old, void *entry, gfp_t) |
| |
| int __must_check | __xa_insert (struct xarray *, unsigned long index, void *entry, gfp_t) |
| |
| int __must_check | __xa_alloc (struct xarray *, u32 *id, void *entry, struct xa_limit, gfp_t) |
| |
| int __must_check | __xa_alloc_cyclic (struct xarray *, u32 *id, void *entry, struct xa_limit, u32 *next, gfp_t) |
| |
| void | __xa_set_mark (struct xarray *, unsigned long index, xa_mark_t) |
| |
| void | __xa_clear_mark (struct xarray *, unsigned long index, xa_mark_t) |
| |
| void | xa_dump (const struct xarray *) |
| |
| void | xa_dump_node (const struct xa_node *) |
| |
| void | xa_delete_node (struct xa_node *, xa_update_node_t) |
| |
|
XA_STATE_ORDER() - Declare an XArray operation state.
@array: Array to operate on. @index: Initial index of interest. @order: Order of entry.
Declare and initialise an xa_state on the stack. This variant of XA_STATE() allows you to specify the 'order' of the element you want to operate on.`
|
| #define | XA_STATE(name, array, index) struct xa_state name = __XA_STATE(array, index, 0, 0) |
| |
| #define | XA_STATE_ORDER(name, array, index, order) |
| |
| #define | xas_marked(xas, mark) xa_marked((xas)->xa, (mark)) |
| |
| #define | xas_trylock(xas) xa_trylock((xas)->xa) |
| |
| #define | xas_lock(xas) xa_lock((xas)->xa) |
| |
| #define | xas_unlock(xas) xa_unlock((xas)->xa) |
| |
| #define | xas_lock_bh(xas) xa_lock_bh((xas)->xa) |
| |
| #define | xas_unlock_bh(xas) xa_unlock_bh((xas)->xa) |
| |
| #define | xas_lock_irq(xas) xa_lock_irq((xas)->xa) |
| |
| #define | xas_unlock_irq(xas) xa_unlock_irq((xas)->xa) |
| |
| #define | xas_lock_irqsave(xas, flags) xa_lock_irqsave((xas)->xa, flags) |
| |
| #define | xas_unlock_irqrestore(xas, flags) xa_unlock_irqrestore((xas)->xa, flags) |
| |
| #define | xas_for_each(xas, entry, max) |
| |
| #define | xas_for_each_marked(xas, entry, max, mark) |
| |
| #define | xas_for_each_conflict(xas, entry) while ((entry = xas_find_conflict(xas))) |
| |
| enum | { XA_CHECK_SCHED = 4096
} |
| |
| void * | xas_load (struct xa_state *) |
| |
| void * | xas_store (struct xa_state *, void *entry) |
| |
| void * | xas_find (struct xa_state *, unsigned long max) |
| |
| void * | xas_find_conflict (struct xa_state *) |
| |
| bool | xas_get_mark (const struct xa_state *, xa_mark_t) |
| |
| void | xas_set_mark (const struct xa_state *, xa_mark_t) |
| |
| void | xas_clear_mark (const struct xa_state *, xa_mark_t) |
| |
| void * | xas_find_marked (struct xa_state *, unsigned long max, xa_mark_t) |
| |
| void | xas_init_marks (const struct xa_state *) |
| |
| bool | xas_nomem (struct xa_state *, gfp_t) |
| |
| void | xas_destroy (struct xa_state *) |
| |
| void | xas_pause (struct xa_state *) |
| |
| void | xas_create_range (struct xa_state *) |
| |
| void * | __xas_next (struct xa_state *) |
| |
| void * | __xas_prev (struct xa_state *) |
| |
xa_for_each() - Iterate over present entries in an XArray. @xa: XArray. @index: Index of @entry. @entry: Entry retrieved from array.
During the iteration, @entry will have the value of the entry stored in @xa at @index. You may modify @index during the iteration if you want to skip or reprocess indices. It is safe to modify the array during the iteration. At the end of the iteration, @entry will be set to NULL and @index will have a value less than or equal to max.
xa_for_each() is O(n.log(n)) while xas_for_each() is O(n). You have to handle your own locking with xas_for_each(), and if you have to unlock after each iteration, it will also end up being O(n.log(n)). xa_for_each() will spin if it hits a retry entry; if you intend to see retry entries, you should use the xas_for_each() iterator instead. The xas_for_each() iterator will expand into more inline code than xa_for_each().
Context: Any context. Takes and releases the RCU lock.
| #define xa_for_each_marked |
( |
|
xa, |
|
|
|
index, |
|
|
|
entry, |
|
|
|
filter |
|
) |
| |
Value:
#define ULONG_MAX
Definition limits.h:56
void(* entry)(void *)
Definition process.h:101
void * xa_find_after(struct xarray *xa, unsigned long *index, unsigned long max, xa_mark_t) __attribute__((nonnull(2)))
void * xa_find(struct xarray *xa, unsigned long *index, unsigned long max, xa_mark_t) __attribute__((nonnull(2)))
xa_for_each_marked() - Iterate over marked entries in an XArray. @xa: XArray. @index: Index of @entry. @entry: Entry retrieved from array. @filter: Selection criterion.
During the iteration, @entry will have the value of the entry stored in @xa at @index. The iteration will skip all entries in the array which do not match @filter. You may modify @index during the iteration if you want to skip or reprocess indices. It is safe to modify the array during the iteration. At the end of the iteration, @entry will be set to NULL and @index will have a value less than or equal to max.
xa_for_each_marked() is O(n.log(n)) while xas_for_each_marked() is O(n). You have to handle your own locking with xas_for_each(), and if you have to unlock after each iteration, it will also end up being O(n.log(n)). xa_for_each_marked() will spin if it hits a retry entry; if you intend to see retry entries, you should use the xas_for_each_marked() iterator instead. The xas_for_each_marked() iterator will expand into more inline code than xa_for_each_marked().
Context: Any context. Takes and releases the RCU lock.
Value:
TTY * last
Definition tty.cpp:48
#define XA_PRESENT
Definition xarray.h:277
xa_for_each_range() - Iterate over a portion of an XArray. @xa: XArray. @index: Index of @entry. @entry: Entry retrieved from array. @start: First index to retrieve from array. @last: Last index to retrieve from array.
During the iteration, @entry will have the value of the entry stored in @xa at @index. You may modify @index during the iteration if you want to skip or reprocess indices. It is safe to modify the array during the iteration. At the end of the iteration, @entry will be set to NULL and @index will have a value less than or equal to max.
xa_for_each_range() is O(n.log(n)) while xas_for_each() is O(n). You have to handle your own locking with xas_for_each(), and if you have to unlock after each iteration, it will also end up being O(n.log(n)). xa_for_each_range() will spin if it hits a retry entry; if you intend to see retry entries, you should use the xas_for_each() iterator instead. The xas_for_each() iterator will expand into more inline code than xa_for_each_range().
Context: Any context. Takes and releases the RCU lock.
xa_for_each_start() - Iterate over a portion of an XArray. @xa: XArray. @index: Index of @entry. @entry: Entry retrieved from array. @start: First index to retrieve from array.
During the iteration, @entry will have the value of the entry stored in @xa at @index. You may modify @index during the iteration if you want to skip or reprocess indices. It is safe to modify the array during the iteration. At the end of the iteration, @entry will be set to NULL and @index will have a value less than or equal to max.
xa_for_each_start() is O(n.log(n)) while xas_for_each() is O(n). You have to handle your own locking with xas_for_each(), and if you have to unlock after each iteration, it will also end up being O(n.log(n)). xa_for_each_start() will spin if it hits a retry entry; if you intend to see retry entries, you should use the xas_for_each() iterator instead. The xas_for_each() iterator will expand into more inline code than xa_for_each_start().
Context: Any context. Takes and releases the RCU lock.