STRUCT P9_CLIENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct p9_client β€” per client instance state, periodt. okay so this is the struct p9_client(9) page from the Kernel API Manual, and it's literally all about keeping one client’s per client instance state situation cute and tracked. bestie, it's giving main character energy for exactly one client. 🫢

✨ SYNOPSIS ✨

here's the struct in all its glory, no cap β€” every field exactly as the page serves it:

       struct p9_client {
           spinlock_t lock;
           unsigned int msize;
           unsigned char proto_version;
           struct p9_trans_module *trans_mod;
           enum p9_trans_status status;
           void *trans;
           struct kmem_cache *fcall_cache;
           union {
             struct {
               int rfd;
               int wfd;
             } fd;
             struct {
               u16 port;
               bool privport;
             } tcp;
           } trans_opts;
           struct idr fids;
           struct idr reqs;
           char name[__NEW_UTS_LEN + 1];
        };

also, lowkey, the struct itself includes fcall_cache and a trans_opts union with the fd and tcp versions β€” they're right there in the synopsis, so they absolutely count. πŸ’…

πŸŽ€ Members πŸŽ€

vibe check on the members, one by one:

  • lock β€” protect fids and reqs
  • msize β€” maximum data size negotiated by protocol
  • proto_version β€” 9P protocol version to use
  • trans_mod β€” module API instantiated with this client
  • status β€” connection state
  • trans β€” the tranport instance state and API (yes, the page says β€œtranport” β€” not me fixing it, bestie πŸ’€)
  • fids β€” All active FID handles
  • reqs β€” All active requests.
  • name β€” node name used as client id

🌸 Description 🌸

okay so the client structure is used to keep track of various per-client state that has been instantiated. that's the whole vibe: one struct, lots of per-client state, all tracked. periodt. πŸ¦‹

πŸ”₯ SEE ALSO πŸ”₯

go peek at these besties:

  • Kernel file ./include/net/9p/client.h
  • enum p9_trans_status(9)
  • enum p9_req_status_t(9)
  • struct p9_req_t(9)
  • struct p9_fd_opts(9)
  • struct p9_rdma_opts(9)
  • struct p9_session_opts(9)
  • struct p9_dirent(9)

mwah πŸ’‹ β€” from ./include/net/9p, October 2026, serving struct p9_client(9) realness. now go be iconic with your per-client state, bestie 🫢✨

πŸ“¦ where this page comes from