Lines Matching refs:xas

1406 #define xas_marked(xas, mark)	xa_marked((xas)->xa, (mark))  argument
1407 #define xas_trylock(xas) xa_trylock((xas)->xa) argument
1408 #define xas_lock(xas) xa_lock((xas)->xa) argument
1409 #define xas_unlock(xas) xa_unlock((xas)->xa) argument
1410 #define xas_lock_bh(xas) xa_lock_bh((xas)->xa) argument
1411 #define xas_unlock_bh(xas) xa_unlock_bh((xas)->xa) argument
1412 #define xas_lock_irq(xas) xa_lock_irq((xas)->xa) argument
1413 #define xas_unlock_irq(xas) xa_unlock_irq((xas)->xa) argument
1414 #define xas_lock_irqsave(xas, flags) \ argument
1415 xa_lock_irqsave((xas)->xa, flags)
1416 #define xas_unlock_irqrestore(xas, flags) \ argument
1417 xa_unlock_irqrestore((xas)->xa, flags)
1425 static inline int xas_error(const struct xa_state *xas) in xas_error() argument
1427 return xa_err(xas->xa_node); in xas_error()
1439 static inline void xas_set_err(struct xa_state *xas, long err) in xas_set_err() argument
1441 xas->xa_node = XA_ERROR(err); in xas_set_err()
1450 static inline bool xas_invalid(const struct xa_state *xas) in xas_invalid() argument
1452 return (unsigned long)xas->xa_node & 3; in xas_invalid()
1461 static inline bool xas_valid(const struct xa_state *xas) in xas_valid() argument
1463 return !xas_invalid(xas); in xas_valid()
1472 static inline bool xas_is_node(const struct xa_state *xas) in xas_is_node() argument
1474 return xas_valid(xas) && xas->xa_node; in xas_is_node()
1505 static inline void xas_reset(struct xa_state *xas) in xas_reset() argument
1507 xas->xa_node = XAS_RESTART; in xas_reset()
1522 static inline bool xas_retry(struct xa_state *xas, const void *entry) in xas_retry() argument
1528 xas_reset(xas); in xas_retry()
1559 static inline void xas_split(struct xa_state *xas, void *entry, in xas_split() argument
1562 xas_store(xas, entry); in xas_split()
1565 static inline void xas_split_alloc(struct xa_state *xas, void *entry, in xas_split_alloc() argument
1585 static inline void *xas_reload(struct xa_state *xas) in xas_reload() argument
1587 struct xa_node *node = xas->xa_node; in xas_reload()
1592 return xa_head(xas->xa); in xas_reload()
1594 offset = (xas->xa_index >> node->shift) & XA_CHUNK_MASK; in xas_reload()
1595 entry = xa_entry(xas->xa, node, offset); in xas_reload()
1600 offset = xas->xa_offset; in xas_reload()
1602 return xa_entry(xas->xa, node, offset); in xas_reload()
1614 static inline void xas_set(struct xa_state *xas, unsigned long index) in xas_set() argument
1616 xas->xa_index = index; in xas_set()
1617 xas->xa_node = XAS_RESTART; in xas_set()
1630 static inline void xas_advance(struct xa_state *xas, unsigned long index) in xas_advance() argument
1632 unsigned char shift = xas_is_node(xas) ? xas->xa_node->shift : 0; in xas_advance()
1634 xas->xa_index = index; in xas_advance()
1635 xas->xa_offset = (index >> shift) & XA_CHUNK_MASK; in xas_advance()
1644 static inline void xas_set_order(struct xa_state *xas, unsigned long index, in xas_set_order() argument
1648 xas->xa_index = order < BITS_PER_LONG ? (index >> order) << order : 0; in xas_set_order()
1649 xas->xa_shift = order - (order % XA_CHUNK_SHIFT); in xas_set_order()
1650 xas->xa_sibs = (1 << (order % XA_CHUNK_SHIFT)) - 1; in xas_set_order()
1651 xas->xa_node = XAS_RESTART; in xas_set_order()
1654 xas_set(xas, index); in xas_set_order()
1667 static inline void xas_set_update(struct xa_state *xas, xa_update_node_t update) in xas_set_update() argument
1669 xas->xa_update = update; in xas_set_update()
1672 static inline void xas_set_lru(struct xa_state *xas, struct list_lru *lru) in xas_set_lru() argument
1674 xas->xa_lru = lru; in xas_set_lru()
1688 static inline void *xas_next_entry(struct xa_state *xas, unsigned long max) in xas_next_entry() argument
1690 struct xa_node *node = xas->xa_node; in xas_next_entry()
1694 xas->xa_offset != (xas->xa_index & XA_CHUNK_MASK))) in xas_next_entry()
1695 return xas_find(xas, max); in xas_next_entry()
1698 if (unlikely(xas->xa_index >= max)) in xas_next_entry()
1699 return xas_find(xas, max); in xas_next_entry()
1700 if (unlikely(xas->xa_offset == XA_CHUNK_MASK)) in xas_next_entry()
1701 return xas_find(xas, max); in xas_next_entry()
1702 entry = xa_entry(xas->xa, node, xas->xa_offset + 1); in xas_next_entry()
1704 return xas_find(xas, max); in xas_next_entry()
1705 xas->xa_offset++; in xas_next_entry()
1706 xas->xa_index++; in xas_next_entry()
1713 static inline unsigned int xas_find_chunk(struct xa_state *xas, bool advance, in xas_find_chunk() argument
1716 unsigned long *addr = xas->xa_node->marks[(__force unsigned)mark]; in xas_find_chunk()
1717 unsigned int offset = xas->xa_offset; in xas_find_chunk()
1745 static inline void *xas_next_marked(struct xa_state *xas, unsigned long max, in xas_next_marked() argument
1748 struct xa_node *node = xas->xa_node; in xas_next_marked()
1753 return xas_find_marked(xas, max, mark); in xas_next_marked()
1754 offset = xas_find_chunk(xas, true, mark); in xas_next_marked()
1755 xas->xa_offset = offset; in xas_next_marked()
1756 xas->xa_index = (xas->xa_index & ~XA_CHUNK_MASK) + offset; in xas_next_marked()
1757 if (xas->xa_index > max) in xas_next_marked()
1760 return xas_find_marked(xas, max, mark); in xas_next_marked()
1761 entry = xa_entry(xas->xa, node, offset); in xas_next_marked()
1763 return xas_find_marked(xas, max, mark); in xas_next_marked()
1788 #define xas_for_each(xas, entry, max) \ argument
1789 for (entry = xas_find(xas, max); entry; \
1790 entry = xas_next_entry(xas, max))
1806 #define xas_for_each_marked(xas, entry, max, mark) \ argument
1807 for (entry = xas_find_marked(xas, max, mark); entry; \
1808 entry = xas_next_marked(xas, max, mark))
1822 #define xas_for_each_conflict(xas, entry) \ argument
1823 while ((entry = xas_find_conflict(xas)))
1844 static inline void *xas_prev(struct xa_state *xas) in xas_prev() argument
1846 struct xa_node *node = xas->xa_node; in xas_prev()
1849 xas->xa_offset == 0)) in xas_prev()
1850 return __xas_prev(xas); in xas_prev()
1852 xas->xa_index--; in xas_prev()
1853 xas->xa_offset--; in xas_prev()
1854 return xa_entry(xas->xa, node, xas->xa_offset); in xas_prev()
1873 static inline void *xas_next(struct xa_state *xas) in xas_next() argument
1875 struct xa_node *node = xas->xa_node; in xas_next()
1878 xas->xa_offset == XA_CHUNK_MASK)) in xas_next()
1879 return __xas_next(xas); in xas_next()
1881 xas->xa_index++; in xas_next()
1882 xas->xa_offset++; in xas_next()
1883 return xa_entry(xas->xa, node, xas->xa_offset); in xas_next()