svc_xprt_destroy_all(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… svc_xprt_destroy_all(9) πŸ’…

okay so this one's straight out of the Kernel API Manual, section 9 β€” the kernel's own little corner of the docs β€” and bestie, it's giving "cleanup era" ✨


🌸 NAME 🌸

svc_xprt_destroy_all β€” destroy the transports that are associated with @serv. that's it. that's the whole vibe. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

void svc_xprt_destroy_all (struct svc_serv *serv , struct net *net ,
       bool unregister );

✨ ARGUMENTS ✨

  • serv β€” the RPC service that's getting shut down 🫢
  • net β€” the target network namespace, iykyk
  • unregister β€” a bool; it's true if it's OK to unregister the destroyed xprts

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the situation is: server threads might still be running 😭 like, especially when the service is still alive in other network namespaces. not me having to deal with that.

so the way we handle it: we shut down sockets the exact same way we would on a running server β€” set XPT_CLOSE, enqueue, and let a thread pick it up and do the actual close. main character thread behavior, honestly. no cap.

now here's the fork in the road:

  • in the case where there are no such other threads running, svc_clean_up_xprts does a simple version of a server's main event loop πŸ‘‘
  • and in the case where there are other threads, we may need to wait a little while and then check again to see if they're done πŸ™ˆ (yes, we're waiting and re-checking. it's that kind of function.)

πŸ’œ SEE ALSO πŸ’œ

kernel file ./net/sunrpc/svc_xprt.c plus the whole friend group:

svc_reg_xprt_class(9), svc_unreg_xprt_class(9), svc_print_xprts(9), svc_xprt_deferred_close(9), svc_xprt_received(9), svc_xprt_create_from_sa(9), svc_xprt_create(9), svc_print_addr(9), svc_xprt_enqueue(9), svc_reserve(9), svc_wake_up(9), svc_recv(9), svc_send(9), svc_xprt_close(9), svc_find_listener(9), svc_find_xprt(9), svc_xprt_names(9)


fr fr if you're touching this, read the whole group chat first. the XPT_CLOSE + enqueue + let-a-thread-handle-it flow is the whole point, don't skip steps πŸ’€

🫢 mwah, that's a wrap! this lil page lives in ./net/sunrpc and it's dated October 2026 β€” so go forth, destroy those transports responsibly, and slay πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from