xprt_iter_xchg_switch(9)
π xprt_iter_xchg_switch β like, the whole kernel API manual moment β¨
okay so bestie, welcome to xprt_iter_xchg_switch(9) β yes that's the page name, and yes we're in the Kernel API Manual because we're that girl π. This is the one about atomically swapping out the rpc_xprt_switch. Big main-character energy for a function, honestly.
β¨ NAME β¨
xprt_iter_xchg_switch β atomically swap out the rpc_xprt_switch π«Ά like it literally does the swap atomically, no cap, no half-swapped mess, we don't do that here π
π¦ SYNOPSIS π¦
struct rpc_xprt_switch * xprt_iter_xchg_switch (struct rpc_xprt_iter
*xpi , struct rpc_xprt_switch *newswitch );
so it hands you back a struct rpc_xprt_switch * and takes those two args, cute and simple πΈ
π ARGUMENTS π
xpiβ pointer torpc_xprt_iter, your iterator bestie, the one doing the holding π«Άnewswitchβ pointer to a newrpc_xprt_switch, orNULLπ (yes,NULLis a valid vibe here, it's in the source, I don't make the rules)
π DESCRIPTION π
okay so here's the tea: it swaps out the existing xpi->xpi_xpswitch with a new value. that's it. that's the whole bit. the swap happens atomically, so nobody's out here catching a half-finished switch mid-vibe-check β
literally just an exchange: old one out, new one in, done, periodt π
π SEE ALSO π
bestie go read the rest of the family, they're all iconic:
- Kernel file
./net/sunrpc/xprtmultipath.c rpc_xprt_switch_add_xprt(9)rpc_xprt_switch_remove_xprt(9)rpc_xprt_switch_get_main_xprt(9)xprt_switch_alloc(9)xprt_switch_get(9)xprt_switch_put(9)rpc_xprt_switch_set_roundrobin(9)xprt_iter_init(9)xprt_iter_init_listall(9)xprt_iter_destroy(9)xprt_iter_xprt(9)xprt_iter_get_next(9)
reminder bestie:newswitchcan genuinely beNULL, that's not a typo, that's canon π
and that's the page!! π sourced from ./net/sunrpc, dated October 2026, sitting in the Kernel API Manual β mwah, slay, go swap something atomically, ily π§ββοΈπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms