prb_reserve(9)
π prb_reserve β from the Kernel API Manual β¨
okay bestie, settle in, because this is the function every printk writer girlie needs in her life: prb_reserve π
β¨ NAME β¨
prb_reserve β reserve space in the ringbuffer. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
bool prb_reserve (struct prb_reserved_entry *e , struct
printk_ringbuffer *rb , struct printk_record *r );
π¦ ARGUMENTS π¦
eβ the entry structure you're gonna set up. it's giving "hold my spot" energy πrbβ the ringbuffer you're reserving data in. the main character, lowkey πrβ the record structure you're allocating buffers for π
π DESCRIPTION π
so this is the public function, the one that's actually out here for writers to reserve data. no cap π£
you (the writer) tell it how much text space you want by setting the text_buf_size field of r. and like, to make sure r is properly initialized, you should use prb_rec_init_wr β don't skip that step bestie, it's important π
on success, the fields info and text_buf of r get set by this function, and you should fill them in before committing. also on success, you can use prb_record_text_space on e to query the actual space used for the text data block π₯
Important:info->text_lenneeds to be set correctly by the writer so the data can be readable and/or extended. its value is initialized to0. literally do not forget this one, i'm begging π
β CONTEXT β
Any context. and β plot twist β it disables local interrupts on success πβ¨
π«Ά RETURN π«Ά
true if at least text data could be allocated, otherwise false. slay either way, at least you know π
π SEE ALSO π
- Kernel file
./kernel/printk/printk_ringbuffer.c printk_ringbuffer overview(9)prb_reserve_in_last(9)prb_commit(9)prb_final_commit(9)prb_next_reserve_seq(9)prb_read_valid(9)prb_read_valid_info(9)prb_first_valid_seq(9)prb_next_seq(9)prb_init(9)prb_record_text_space(9)
and that's the whole page, bestie, you ate that π this little number lives in ./kernel/printk, dropped October 2026, and it's prb_reserve(9) forever and always π§π periodt.
π¦ 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