xprt_switch_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to struct 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 usual gfp_t situation, 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 that NULL, bestie. the page says failure returns NULL, and that's the whole story πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./net/sunrpc/xprtmultipath.c β€” and honestly the whole friend group:


⭐ 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