prb_reserve(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_len needs to be set correctly by the writer so the data can be readable and/or extended. its value is initialized to 0. 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 🌈


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