vringh_getdesc_kern(9)
πΈ vringh_getdesc_kern(9) β Kernel API Manual realness πΈ
Okay bestie, so this is vringh_getdesc_kern(9) from the Kernel API Manual, and it's literally the function that grabs the next available descriptor from a kernelspace ring. No cap, it's giving "main character energy" in the vringh kernel squad. π
β¨
β¨ NAME β¨
vringh_getdesc_kern β get next available descriptor from kernelspace ring.
π¦ SYNOPSIS π¦
int vringh_getdesc_kern (struct vringh *vrh , struct vringh_kiov *riov ,
struct vringh_kiov *wiov , u16 *head , gfp_t gfp );
π ARGUMENTS π
vrhβ the kernelspace vring. That's your main character right there. πriovβ where to put the readable descriptors (orNULLif you're not about that life).wiovβ where to put the writable descriptors (orNULL, same vibe).headβ the head index we received, for passing tovringh_complete_kern. Don't lose it, bestie.gfpβ flags for allocating largerriov/wiov. Like, if the ring needs more room, this tells the allocator how to act.
π DESCRIPTION π
Returns 0 if there was no descriptor, 1 if there was, or -errno. So like, 0 = nothing, 1 = slay, -errno = something went sideways. π
Note that on error return, you can tell the difference between an invalid ring and a single invalid descriptor: in the former case,*headwill bevrh->vring.num. You may be able to ignore an invalid descriptor, but there's not much you can do with an invalid ring. π
Also, you can reuse riov and wiov with subsequent calls. Content is overwritten and memory reallocated if more space is needed. It's giving "sustainable queen" energy. π±
When you don't have to useriovandwiovanymore, you should clean up them callingvringh_kiov_cleanupto release the memory, even on error! Like, do not skip this, fr fr. π«Ά
π SEE ALSO π
Kernel file ./drivers/vhost/vringh.c and these iconic functions, iykyk:
vringh_kiov_advance(9)vringh_init_user(9)vringh_getdesc_user(9)vringh_iov_pull_user(9)vringh_iov_push_user(9)vringh_complete_user(9)vringh_complete_multi_user(9)vringh_notify_enable_user(9)vringh_notify_disable_user(9)vringh_need_notify_user(9)vringh_init_kern(9)vringh_complete_kern(9)vringh_notify_enable_kern(9)vringh_notify_disable_kern(9)vringh_need_notify_kern(9)vringh_init_iotlb(9)vringh_init_iotlb_va(9)vringh_set_iotlb(9)vringh_getdesc_iotlb(9)vringh_iov_pull_iotlb(9)vringh_iov_push_iotlb(9)vringh_complete_iotlb(9)vringh_need_notify_iotlb(9)
This page lives in ./drivers/vhost, dated October 2026, and it's all about vringh_getdesc_kern(9). Bye bestie, go get those descriptors! ππ§ββοΈ
π¦ 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