rpc_switch_client_transport(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rpc_switch_client_transport(9) πŸ’…

okay bestie, welcome to the Kernel API Manual corner where we talk about rpc_switch_client_transport β€” the glow-up button for an RPC transport. No cap, this one is lowkey iconic when you're out here juggling mirrored NFS servers. ✨

πŸŽ€ NAME πŸŽ€

rpc_switch_client_transport β€” switch the RPC transport on the fly. πŸ¦‹

✨ SYNOPSIS ✨

int rpc_switch_client_transport (struct rpc_clnt *clnt , struct
       xprt_create *args , const struct rpc_timeout *timeout );

πŸ’– ARGUMENTS πŸ’–

  • clnt β€” pointer to a struct rpc_clnt. This is the main-character client struct getting its transport swapped. πŸ‘‘
  • args β€” pointer to the new transport arguments. Fresh xprt setup goes here. 🧚
  • timeout β€” pointer to the new timeout parameters. The new timing vibe. ⏰

🌈 DESCRIPTION 🌈

So the tea is: this function lets the caller switch the RPC transport for the rpc_clnt structure 'clnt' so it can connect to a mirrored NFS server, for instance. πŸ’«

It assumes that the caller has ensured that there are no active RPC tasks by using some form of locking. Like, do the locking first, bestie β€” this function is not out here doing your task cleanup for you. πŸ”’

Returns zero if "clnt" is now using the new xprt. Slay. βœ… Otherwise a negative errno is returned, and "clnt" continues to use the old xprt. So if it doesn't work, no dramatic transport change β€” it stays with its old xprt. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/sunrpc/clnt.c:


xoxo, your ./net/sunrpc source, October 2026 vibes, and the one and only rpc_switch_client_transport(9) πŸ’…βœ¨

πŸ“¦ where this page comes from