• Home
  • Raw
  • Download

Lines Matching refs:xas

1331 #define xas_marked(xas, mark)	xa_marked((xas)->xa, (mark))  argument
1332 #define xas_trylock(xas) xa_trylock((xas)->xa) argument
1333 #define xas_lock(xas) xa_lock((xas)->xa) argument
1334 #define xas_unlock(xas) xa_unlock((xas)->xa) argument
1335 #define xas_lock_bh(xas) xa_lock_bh((xas)->xa) argument
1336 #define xas_unlock_bh(xas) xa_unlock_bh((xas)->xa) argument
1337 #define xas_lock_irq(xas) xa_lock_irq((xas)->xa) argument
1338 #define xas_unlock_irq(xas) xa_unlock_irq((xas)->xa) argument
1339 #define xas_lock_irqsave(xas, flags) \ argument
1340 xa_lock_irqsave((xas)->xa, flags)
1341 #define xas_unlock_irqrestore(xas, flags) \ argument
1342 xa_unlock_irqrestore((xas)->xa, flags)
1350 static inline int xas_error(const struct xa_state *xas) in xas_error() argument
1352 return xa_err(xas->xa_node); in xas_error()
1364 static inline void xas_set_err(struct xa_state *xas, long err) in xas_set_err() argument
1366 xas->xa_node = XA_ERROR(err); in xas_set_err()
1375 static inline bool xas_invalid(const struct xa_state *xas) in xas_invalid() argument
1377 return (unsigned long)xas->xa_node & 3; in xas_invalid()
1386 static inline bool xas_valid(const struct xa_state *xas) in xas_valid() argument
1388 return !xas_invalid(xas); in xas_valid()
1397 static inline bool xas_is_node(const struct xa_state *xas) in xas_is_node() argument
1399 return xas_valid(xas) && xas->xa_node; in xas_is_node()
1430 static inline void xas_reset(struct xa_state *xas) in xas_reset() argument
1432 xas->xa_node = XAS_RESTART; in xas_reset()
1447 static inline bool xas_retry(struct xa_state *xas, const void *entry) in xas_retry() argument
1453 xas_reset(xas); in xas_retry()
1487 static inline void *xas_reload(struct xa_state *xas) in xas_reload() argument
1489 struct xa_node *node = xas->xa_node; in xas_reload()
1492 return xa_entry(xas->xa, node, xas->xa_offset); in xas_reload()
1493 return xa_head(xas->xa); in xas_reload()
1505 static inline void xas_set(struct xa_state *xas, unsigned long index) in xas_set() argument
1507 xas->xa_index = index; in xas_set()
1508 xas->xa_node = XAS_RESTART; in xas_set()
1517 static inline void xas_set_order(struct xa_state *xas, unsigned long index, in xas_set_order() argument
1521 xas->xa_index = order < BITS_PER_LONG ? (index >> order) << order : 0; in xas_set_order()
1522 xas->xa_shift = order - (order % XA_CHUNK_SHIFT); in xas_set_order()
1523 xas->xa_sibs = (1 << (order % XA_CHUNK_SHIFT)) - 1; in xas_set_order()
1524 xas->xa_node = XAS_RESTART; in xas_set_order()
1527 xas_set(xas, index); in xas_set_order()
1539 static inline void xas_set_update(struct xa_state *xas, xa_update_node_t update) in xas_set_update() argument
1541 xas->xa_update = update; in xas_set_update()
1555 static inline void *xas_next_entry(struct xa_state *xas, unsigned long max) in xas_next_entry() argument
1557 struct xa_node *node = xas->xa_node; in xas_next_entry()
1561 xas->xa_offset != (xas->xa_index & XA_CHUNK_MASK))) in xas_next_entry()
1562 return xas_find(xas, max); in xas_next_entry()
1565 if (unlikely(xas->xa_index >= max)) in xas_next_entry()
1566 return xas_find(xas, max); in xas_next_entry()
1567 if (unlikely(xas->xa_offset == XA_CHUNK_MASK)) in xas_next_entry()
1568 return xas_find(xas, max); in xas_next_entry()
1569 entry = xa_entry(xas->xa, node, xas->xa_offset + 1); in xas_next_entry()
1571 return xas_find(xas, max); in xas_next_entry()
1572 xas->xa_offset++; in xas_next_entry()
1573 xas->xa_index++; in xas_next_entry()
1580 static inline unsigned int xas_find_chunk(struct xa_state *xas, bool advance, in xas_find_chunk() argument
1583 unsigned long *addr = xas->xa_node->marks[(__force unsigned)mark]; in xas_find_chunk()
1584 unsigned int offset = xas->xa_offset; in xas_find_chunk()
1612 static inline void *xas_next_marked(struct xa_state *xas, unsigned long max, in xas_next_marked() argument
1615 struct xa_node *node = xas->xa_node; in xas_next_marked()
1619 return xas_find_marked(xas, max, mark); in xas_next_marked()
1620 offset = xas_find_chunk(xas, true, mark); in xas_next_marked()
1621 xas->xa_offset = offset; in xas_next_marked()
1622 xas->xa_index = (xas->xa_index & ~XA_CHUNK_MASK) + offset; in xas_next_marked()
1623 if (xas->xa_index > max) in xas_next_marked()
1626 return xas_find_marked(xas, max, mark); in xas_next_marked()
1627 return xa_entry(xas->xa, node, offset); in xas_next_marked()
1651 #define xas_for_each(xas, entry, max) \ argument
1652 for (entry = xas_find(xas, max); entry; \
1653 entry = xas_next_entry(xas, max))
1669 #define xas_for_each_marked(xas, entry, max, mark) \ argument
1670 for (entry = xas_find_marked(xas, max, mark); entry; \
1671 entry = xas_next_marked(xas, max, mark))
1686 #define xas_for_each_conflict(xas, entry) \ argument
1687 while ((entry = xas_find_conflict(xas)))
1708 static inline void *xas_prev(struct xa_state *xas) in xas_prev() argument
1710 struct xa_node *node = xas->xa_node; in xas_prev()
1713 xas->xa_offset == 0)) in xas_prev()
1714 return __xas_prev(xas); in xas_prev()
1716 xas->xa_index--; in xas_prev()
1717 xas->xa_offset--; in xas_prev()
1718 return xa_entry(xas->xa, node, xas->xa_offset); in xas_prev()
1737 static inline void *xas_next(struct xa_state *xas) in xas_next() argument
1739 struct xa_node *node = xas->xa_node; in xas_next()
1742 xas->xa_offset == XA_CHUNK_MASK)) in xas_next()
1743 return __xas_next(xas); in xas_next()
1745 xas->xa_index++; in xas_next()
1746 xas->xa_offset++; in xas_next()
1747 return xa_entry(xas->xa, node, xas->xa_offset); in xas_next()