__submit_metadata_vio(9)
π __submit_metadata_vio β NAME
okay so bestie, this is a page from the Kernel API Manual (manual section 9, the kernel API one, iykyk) and it's all about __submit_metadata_vio β which literally just submits I/O for a metadata vio. that's it, that's the whole name β¨
πΈ SYNOPSIS
void __submit_metadata_vio (struct vio *vio , physical_block_number_t
physical , bio_end_io_t callback , vdo_action_fn error_handler ,
blk_opf_t operation , char *data , int size );
like. seven whole arguments. she's high maintenance but she's worth it π
π ARGUMENTS
vioβ the vio you're issuing I/O for. the main character of this whole operation, no cap.physicalβ the physical block number you wanna read or write. it's aphysical_block_number_t, so, y'know, a block number π¦callbackβ the bio endio function, aka the thing that gets called after the I/O completes. she's the follow-up text after a good hangout π«Άerror_handlerβ the handler for submission errors or I/O errors. and guess what? it may beNULL. so it's optional, iconic, lowkey chill about it.operationβ the type of I/O to perform.blk_opf_ttype. that's the vibe check for what we're even doing here.dataβ the buffer to read or write. may beNULLπ yes bestie, it can be null, it's fine, we're fine.sizeβ the I/O amount in bytes. just a plainint, keeping it simple π
β¨ DESCRIPTION β¨
so here's the tea: the vio gets enqueued on a vdo bio queue so that bio submission β which may block π β does not block other vdo threads. like, she goes to the queue, she waits her turn, everybody else keeps it moving. productive queen behavior π
now the important caveat, don't scroll past this:
That the error handler will run on the correct thread is only true so long as the thread calling this function, and the thread set in the endio callback are the same, as well as the fact that no error can occur on the bio queue. Currently this is true for all callers, but additional care will be needed if this ever changes.
so like. the "runs on the right thread" guarantee is conditional, bestie. it holds if (a) the calling thread and the endio-callback thread are the same, and (b) no error can happen on the bio queue. currently true for all callers, but if that ever changes, somebody's gonna need to do additional care. not me. not today. π
π¦ SEE ALSO
go check out the kernel file ./drivers/md/dm-vdo/io-submitter.c and honestly the whole friend group:
count_all_bios(9)assert_in_bio_zone(9)send_bio_to_device(9)vdo_submit_vio(9)get_bio_list(9)submit_data_vio(9)get_mergeable_locked(9)try_bio_map_merge(9)vdo_submit_data_vio(9)vdo_submit_metadata_vio_wait(9)vdo_make_io_submitter(9)vdo_cleanup_io_submitter(9)vdo_free_io_submitter(9)
π and that's the page!! this little love letter lives in ./drivers/md/dm-vdo and it's dated October 2026 β so like, future-dated, mysterious, main character energy fr fr. go submit some metadata, bestie, you've got this πβ¨
π¦ 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