gfs2_jhead_process_page(9)
π« gfs2_jhead_process_page(9) π«
okay so this is a page from the Kernel API Manual, and we're diving into gfs2_jhead_process_page β yes bestie, we're in the kernel today, hydrate first π«Ά
β¨ NAME β¨
gfs2_jhead_process_page β Search/cleanup a page π
πΈ SYNOPSIS πΈ
void gfs2_jhead_process_page (struct gfs2_jdesc *jd , unsigned long
index , struct gfs2_log_header_host *head , bool *done );
π¦ ARGUMENTS π¦
jdβ The journal descriptor πindexβ Index of the page to look intoheadβ The journal head to start fromdoneβ If set, perform only cleanup, else search and set if found.
π₯ DESCRIPTION π₯
So here's the vibe: we find the folio with index in the journal's mapping. Then we search the folio for the journal head if requested (cleanup == false). After that we release refs on the folio so the page cache can reclaim it β slay, giving it back to the ecosystem π
Now, the way that refs work here is lowkey iconic: we grabbed a reference on this folio twice. First when we did a filemap_grab_folio to obtain the folio to add it to the bio, and second when we do a filemap_get_folio here to get the folio to wait on while I/O on it is being completed. Two refs, no cap π
This function is also used to free up a folio we might've grabbed but not used. Maybe we added it to a bio, but not submitted it for I/O. Or we submitted the I/O, but we already found the jhead so we only need to drop our references to the folio. Either way bestie, we're cleaning up our own mess, main character energy fr fr π
β SEE ALSO β
Kernel file ./fs/gfs2/lops.c β and the whole friend group:
gfs2_pin(9)gfs2_unpin(9)gfs2_end_log_write_bh(9)gfs2_end_log_write(9)gfs2_log_submit_write(9)gfs2_log_alloc_bio(9)gfs2_log_get_bio(9)gfs2_log_write(9)gfs2_log_write_bh(9)gfs2_log_write_page(9)gfs2_end_log_read(9)gfs2_jhead_folio_search(9)gfs2_find_jhead(9)databuf_lo_before_commit(9)
okay that's the whole page, mwah π β this one shipped out of ./fs/gfs2 in October 2026, brought to you by the Kernel API Manual. go touch some grass (or a folio) bestie, ily π§ββοΈπ
π¦ 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