Lines Matching refs:xpi
216 const struct rpc_xprt_iter_ops *xprt_iter_ops(const struct rpc_xprt_iter *xpi) in xprt_iter_ops() argument
218 if (xpi->xpi_ops != NULL) in xprt_iter_ops()
219 return xpi->xpi_ops; in xprt_iter_ops()
220 return rcu_dereference(xpi->xpi_xpswitch)->xps_iter_ops; in xprt_iter_ops()
224 void xprt_iter_no_rewind(struct rpc_xprt_iter *xpi) in xprt_iter_no_rewind() argument
229 void xprt_iter_default_rewind(struct rpc_xprt_iter *xpi) in xprt_iter_default_rewind() argument
231 WRITE_ONCE(xpi->xpi_cursor, NULL); in xprt_iter_default_rewind()
266 struct rpc_xprt *xprt_iter_first_entry(struct rpc_xprt_iter *xpi) in xprt_iter_first_entry() argument
268 struct rpc_xprt_switch *xps = rcu_dereference(xpi->xpi_xpswitch); in xprt_iter_first_entry()
301 struct rpc_xprt * _xprt_iter_current_entry(struct rpc_xprt_iter *xpi, in _xprt_iter_current_entry() argument
306 struct rpc_xprt_switch *xps = rcu_dereference(xpi->xpi_xpswitch); in _xprt_iter_current_entry()
312 if (xpi->xpi_cursor == NULL || xps->xps_nxprts < 2) in _xprt_iter_current_entry()
314 return current_entry(head, xpi->xpi_cursor); in _xprt_iter_current_entry()
318 struct rpc_xprt *xprt_iter_current_entry(struct rpc_xprt_iter *xpi) in xprt_iter_current_entry() argument
320 return _xprt_iter_current_entry(xpi, xprt_switch_find_first_entry, in xprt_iter_current_entry()
332 struct rpc_xprt *xprt_iter_current_entry_offline(struct rpc_xprt_iter *xpi) in xprt_iter_current_entry_offline() argument
334 return _xprt_iter_current_entry(xpi, in xprt_iter_current_entry_offline()
408 struct rpc_xprt *xprt_iter_next_entry_multiple(struct rpc_xprt_iter *xpi, in xprt_iter_next_entry_multiple() argument
411 struct rpc_xprt_switch *xps = rcu_dereference(xpi->xpi_xpswitch); in xprt_iter_next_entry_multiple()
415 return xprt_switch_set_next_cursor(xps, &xpi->xpi_cursor, find_next); in xprt_iter_next_entry_multiple()
456 struct rpc_xprt *xprt_iter_next_entry_roundrobin(struct rpc_xprt_iter *xpi) in xprt_iter_next_entry_roundrobin() argument
458 return xprt_iter_next_entry_multiple(xpi, in xprt_iter_next_entry_roundrobin()
477 struct rpc_xprt *xprt_iter_next_entry_all(struct rpc_xprt_iter *xpi) in xprt_iter_next_entry_all() argument
479 return xprt_iter_next_entry_multiple(xpi, in xprt_iter_next_entry_all()
484 struct rpc_xprt *xprt_iter_next_entry_offline(struct rpc_xprt_iter *xpi) in xprt_iter_next_entry_offline() argument
486 return xprt_iter_next_entry_multiple(xpi, in xprt_iter_next_entry_offline()
497 void xprt_iter_rewind(struct rpc_xprt_iter *xpi) in xprt_iter_rewind() argument
500 xprt_iter_ops(xpi)->xpi_rewind(xpi); in xprt_iter_rewind()
504 static void __xprt_iter_init(struct rpc_xprt_iter *xpi, in __xprt_iter_init() argument
508 rcu_assign_pointer(xpi->xpi_xpswitch, xprt_switch_get(xps)); in __xprt_iter_init()
509 xpi->xpi_cursor = NULL; in __xprt_iter_init()
510 xpi->xpi_ops = ops; in __xprt_iter_init()
522 void xprt_iter_init(struct rpc_xprt_iter *xpi, in xprt_iter_init() argument
525 __xprt_iter_init(xpi, xps, NULL); in xprt_iter_init()
536 void xprt_iter_init_listall(struct rpc_xprt_iter *xpi, in xprt_iter_init_listall() argument
539 __xprt_iter_init(xpi, xps, &rpc_xprt_iter_listall); in xprt_iter_init_listall()
542 void xprt_iter_init_listoffline(struct rpc_xprt_iter *xpi, in xprt_iter_init_listoffline() argument
545 __xprt_iter_init(xpi, xps, &rpc_xprt_iter_listoffline); in xprt_iter_init_listoffline()
555 struct rpc_xprt_switch *xprt_iter_xchg_switch(struct rpc_xprt_iter *xpi, in xprt_iter_xchg_switch() argument
561 oldswitch = xchg(&xpi->xpi_xpswitch, RCU_INITIALIZER(newswitch)); in xprt_iter_xchg_switch()
563 xprt_iter_rewind(xpi); in xprt_iter_xchg_switch()
571 void xprt_iter_destroy(struct rpc_xprt_iter *xpi) in xprt_iter_destroy() argument
573 xprt_switch_put(xprt_iter_xchg_switch(xpi, NULL)); in xprt_iter_destroy()
584 struct rpc_xprt *xprt_iter_xprt(struct rpc_xprt_iter *xpi) in xprt_iter_xprt() argument
587 return xprt_iter_ops(xpi)->xpi_xprt(xpi); in xprt_iter_xprt()
591 struct rpc_xprt *xprt_iter_get_helper(struct rpc_xprt_iter *xpi, in xprt_iter_get_helper() argument
597 ret = fn(xpi); in xprt_iter_get_helper()
612 struct rpc_xprt *xprt_iter_get_xprt(struct rpc_xprt_iter *xpi) in xprt_iter_get_xprt() argument
617 xprt = xprt_iter_get_helper(xpi, xprt_iter_ops(xpi)->xpi_xprt); in xprt_iter_get_xprt()
629 struct rpc_xprt *xprt_iter_get_next(struct rpc_xprt_iter *xpi) in xprt_iter_get_next() argument
634 xprt = xprt_iter_get_helper(xpi, xprt_iter_ops(xpi)->xpi_next); in xprt_iter_get_next()