blk_update_request(9)
π blk_update_request β from the Kernel API Manual, bestie (section 9, kernel-space era) β¨
Okay so this one's called blk_update_request and it's literally the "finish some bytes but not the whole vibe" function. Let's get into it π«Ά
πΈ NAME πΈ
blk_update_request β complete multiple bytes without completing the request. Yes, that's the whole bit. Partially finish it. Iconic behaviour honestly π
β¨ SYNOPSIS β¨
bool blk_update_request (struct request *req , blk_status_t error ,
unsigned int nr_bytes );
Three args, returns a bool, and it's giving "I do exactly one thing and I do it well" π
π ARGUMENTS π
reqβ the request being processed. The main character of this whole function, no cap πerrorβ block status code. It's ablk_status_t, so you know it's official βnr_bytesβ number of bytes to complete forreq. How much of the request you're finishing off rn π
π¦ DESCRIPTION π¦
So what it actually does: it ends I/O on a number of bytes attached to req. Note the number of bytes phrasing β it does not complete the request structure itself, even if req doesn't have any leftover. Like, it'll finish the bytes but the struct is still standing there, untouched, thriving π
But if req does have leftover, then it sets it up for the next range of segments. Lowkey it's handing off the baton πββοΈ
And here's the fun fact: passing the result of blk_rq_bytes as nr_bytes guarantees a false return from this function. Guarantees it. No notes. π₯
π NOTE π
The RQF_SPECIAL_PAYLOAD flag is ignored on purpose in this function β except in the consistency check at the end of this function. So like, not ignored-ignored, just ignored until the last second. Respect the pipeline honestly π
Fr fr don't "fix" that one, it's intentional π
β RETURN β
falseβ this request doesn't have any more datatrueβ this request has more data
That's it, that's the whole vibe check π
π§ SEE ALSO π§
Kernel file ./block/blk-mq.c, plus this absolutely stacked lineup of siblings:
blk_mq_wait_quiesce_done(9)blk_mq_quiesce_queue(9)blk_mq_complete_request(9)blk_mq_start_request(9)blk_execute_rq_nowait(9)blk_execute_rq(9)blk_mq_delay_run_hw_queue(9)blk_mq_run_hw_queue(9)blk_mq_run_hw_queues(9)blk_mq_delay_run_hw_queues(9)blk_mq_request_bypass_insert(9)blk_mq_try_issue_directly(9)blk_mq_submit_bio(9)blk_insert_cloned_request(9)blk_rq_unprep_clone(9)blk_rq_prep_clone(9)blk_mq_destroy_queue(9)
A whole friend group. Go read all of them, iykyk πΈ
And that's the page!! It lives in ./block and this particular rendering is dated October 2026 β so like, mark your calendar bestie πβ¨ Byeee, go finish some bytes (but not the whole request) ππ¦
π¦ 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