rdma_user_mm...ry_get_pgoff(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rdma_user_mmap_entry_get_pgoff(9) β€” the kernel API manual, bestie edition

okay so this is a page from the Kernel API Manual gang, and today's main character is rdma_user_mmap_entry_get_pgoff(9). yes the title is a whole mouthful, we're getting into it πŸ’–


✨ NAME ✨

rdma_user_mmap_entry_get_pgoff β€” grab an entry out of the mmap_xa, by its page offset πŸŽ€


✨ SYNOPSIS ✨

struct rdma_user_mmap_entry * rdma_user_mmap_entry_get_pgoff (struct
ib_ucontext *ucontext , unsigned long pgoff );

✨ ARGUMENTS ✨

  • ucontext β€” the user context this whole thing is attached to 🫢
  • pgoff β€” the mmap offset, but like… >> PAGE_SHIFT-ed. that's the whole vibe. it's the offset shifted right by PAGE_SHIFT 🌸

✨ DESCRIPTION ✨

so picture this: a user is trying to mmap with an offset that they got from rdma_user_mmap_get_offset in the first place β€” the one the driver handed them originally. that's literally when this function gets called πŸ’«

and the rdma_user_mmap_entry they're chasing? that was created by rdma_user_mmap_entry_insert. iconic lineage, no cap πŸ‘‘

here's the important bit ngl: this function bumps up the refcnt of the entry. why? so it does not get deleted out of the xarray in the meantime. the way that refcount is doing its little protective job πŸ˜­πŸ’– hold the door bestie

what it gives you back: a reference to an entry if one exists, or NULL if there's no match. that's it, that's the deal πŸ™ˆ

⚠️ okay real talk β€” you must call rdma_user_mmap_entry_put to put that reference. don't just wander off with it, that's not the move πŸ’€

✨ SEE ALSO ✨

the whole friend group fr fr πŸ¦‹


🌈 and that's the page!! brought to you by ./drivers/infiniband/core, dated October 2026 β€” literally straight from the source, and again the title is rdma_user_mm...ry_get_pgoff(9) because the kernel just loves a dramatic abbreviation ✨🫢 slay, go call rdma_user_mmap_entry_put when you're done, mwah πŸ’œ

πŸ“¦ where this page comes from