parse_key_value_pairs(9)
π parse_key_value_pairs(9) β the kernel API manual, bestie edition π
okay so real talk: this is parse_key_value_pairs(9) from the Kernel API Manual, and it's genuinely the kind of page you read once and then keep in your notes forever. let's get into it β¨
πΈ NAME πΈ
parse_key_value_pairs β literally parses all the key/value pairs out of a list of arguments. that's the whole job, and she does it π«Ά
β¨ SYNOPSIS β¨
int parse_key_value_pairs (int argc , char **argv , struct device_config
*config );
π¦ ARGUMENTS π¦
argcβ the total number of arguments in the list. the headcount, if you will πargvβ the actual list of key/value pairs. the main characters πconfigβ the device configuration data she's gonna update. this is the glow-up target π
π DESCRIPTION π
so here's the vibe: if an error happens while parsing even a single key/value pair, that's serious enough that we stop parsing anything else. no cap, we're done. one bad pair and the whole thing shuts it down π
and there's a whole reason she can't set the "reason" value the caller wants to pass back β because we'd want to format it to say which field was invalid, and we can't allocate the "reason" strings dynamically. so nope, not happening π instead: if an error occurs, we log the details and return the error. graceful, iconic, done.
π₯ RETURN π₯
VDO_SUCCESS or error β
π SEE ALSO π
first up, the kernel file ./drivers/md/dm-vdo/dm-vdo-target.c, then this whole friend group:
free_device_config(9)get_version_number(9)parse_bool(9)parse_memory(9)parse_slab_size(9)process_one_thread_config_spec(9)parse_one_thread_config_spec(9)parse_thread_config_string(9)process_one_key_value_pair(9)parse_one_key_value_pair(9)parse_optional_arguments(9)handle_parse_error(9)parse_device_config(9)get_thread_id_for_phase(9)advance_phase(9)finish_operation_callback(9)decode_from_super_block(9)decode_vdo(9)pre_load_callback(9)get_bit_array_size(9)grow_bit_array(9)allocate_instance(9)check_may_grow_physical(9)grow_layout(9)validate_new_device_config(9)write_super_block_for_suspend(9)suspend_callback(9)was_new(9)requires_repair(9)get_load_type(9)load_callback(9)handle_load_error(9)write_super_block_for_resume(9)resume_callback(9)grow_logical_callback(9)handle_logical_growth_error(9)perform_grow_logical(9)copy_partition(9)grow_physical_callback(9)handle_physical_growth_error(9)perform_grow_physical(9)apply_new_vdo_configuration(9)
and that's the page!! mwah π this gorgeous thing lives in ./drivers/md/dm-vdo, dated October 2026 β go off, king πβ¨
π¦ 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