blk_update_request(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a blk_status_t, so you know it's official ⭐
  • nr_bytes β€” number of bytes to complete for req. 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 data
  • true β€” 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:

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