xprt_switch_alloc(9)
π xprt_switch_alloc(9) β from the Kernel API Manual, bestie
okay so real talk, this is a page straight out of the Kernel API Manual, and it's about xprt_switch_alloc. it's short, it's sweet, it's giving lowkey iconic. let's go β¨
β¨ NAME β¨
xprt_switch_alloc β allocate a new struct rpc_xprt_switch π
π¦ SYNOPSIS π¦
struct rpc_xprt_switch * xprt_switch_alloc (struct rpc_xprt *xprt ,
gfp_t gfp_flags );
that's the whole signature, no cap. two args, one pointer back. slay π
πΈ ARGUMENTS πΈ
xprtβ a pointer tostruct rpc_xprt. that's the transport you're handing over, bestie, so it can live inside the new switch π«Άgfp_flagsβ the allocation flags. yep, the usualgfp_tsituation, you know what to do β¨
π₯ DESCRIPTION π₯
so here's the vibe check: on success, this hands you back an initialised struct rpc_xprt_switch, and that switch is already holding the entry xprt β the one you passed in. it's giving "move-in ready" π β¨
and if it doesn't work out? returns NULL on failure. no drama, just NULL. ππ
ngl, please actually check for thatNULL, bestie. the page says failure returnsNULL, and that's the whole story π
π SEE ALSO π
kernel file ./net/sunrpc/xprtmultipath.c β and honestly the whole friend group:
rpc_xprt_switch_add_xprt(9)rpc_xprt_switch_remove_xprt(9)rpc_xprt_switch_get_main_xprt(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_xchg_switch(9)xprt_iter_destroy(9)xprt_iter_xprt(9)xprt_iter_get_next(9)
β okay that's the whole page, mwah π β big love from ./net/sunrpc, dated October 2026, and this one's called xprt_switch_alloc(9) in case you forgot already πβ¨
π¦ 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