rdma_user_mm...ry_get_pgoff(9)
π 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 byPAGE_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 kernel file
./drivers/infiniband/core/ib_core_uverbs.cπ rdma_umap_priv_init(9)rdma_user_mmap_io(9)rdma_user_mmap_entry_get(9)rdma_user_mmap_entry_put(9)rdma_user_mmap_entry_remove(9)rdma_user_mmap_entry_insert_range(9)rdma_user_mmap_entry_insert(9)rdma_udata_to_dev(9)_uverbs_alloc(9)uverbs_get_buffer_desc(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms