vdo_get_physical_zone(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vdo_get_physical_zone(9) β€” like, the Kernel API Manual page, but make it make sense

okay so bestie, welcome to vdo_get_physical_zone(9) 🌸 this is a page out of the Kernel API Manual and it's genuinely so much simpler than it looks, i promise. one function, three arguments, one job. literally that's it. let's get into it πŸŽ€


✨ NAME ✨

vdo_get_physical_zone β€” bestie. it gets the physical zone that's responsible for a given physical block number. that's the whole vibe. done. πŸ¦‹


✨ SYNOPSIS ✨

int vdo_get_physical_zone (const struct vdo *vdo ,
physical_block_number_t pbn , struct physical_zone **zone_ptr );

look at her. three params, returns an int, main character energy only πŸ‘‘


✨ ARGUMENTS ✨

  • vdo β€” the vdo that's holding all the physical zones. it's the one with the zones, iykyk πŸ’œ
  • pbn β€” the PBN of the data block. that's the physical block number you're asking about πŸ“
  • zone_ptr β€” a pointer, and its whole purpose in life is to hand you back the physical zone. it's the return-address-of-the-zone. iconic behavior πŸŽ€

✨ DESCRIPTION ✨

so what does she do? she gets the physical zone responsible for a given physical block number of a data block in this vdo instance 🌈

or β€” plot twist β€” she does it for the zero block, and for the zero block a NULL zone is returned 🫢 lowkey the zero block is special like that.

for any other block number that is not in the range of valid data block numbers in any slab, an error gets returned. so like, if you go wandering off into invalid-block-number territory, you're getting an error back, no cap πŸ’€

and here's the part that genuinely slays: this function is safe to call on invalid block numbers ✨ it will not put the vdo into read-only mode. so you can go ahead and poke at garbage block numbers and she's not gonna spiral about it. we love a function with emotional stability πŸ’…πŸ”₯

not me feeling so secure rn 😭 safe on invalid input AND doesn't flip the vdo into read-only mode? queen behavior.

✨ RETURN ✨

  • VDO_SUCCESS β€” slay, it worked πŸ’–
  • VDO_OUT_OF_RANGE β€” if the block number is invalid πŸ™ˆ
  • or, an error code for any other failure. fr fr, other stuff can happen too πŸ’€

✨ SEE ALSO ✨

okay this section is a whole group chat, buckle up πŸŽ€ β€” the kernel file ./drivers/md/dm-vdo/vdo.c, plus Introduction(9), vdo_initialize_device_registry_once(9), filter_vdos_locked(9), vdo_find_matching(9), initialize_thread_config(9), get_thread_name(9), vdo_make_thread(9), register_vdo(9), vdo_format(9), initialize_vdo(9), vdo_make(9), free_listeners(9), unregister_vdo(9), vdo_destroy(9), finish_reading_super_block(9), handle_super_block_read_error(9), vdo_load_super_block(9), vdo_get_backing_device(9), vdo_get_device_name(9), vdo_synchronous_flush(9), vdo_get_state(9), vdo_set_state(9), vdo_get_admin_state(9), record_vdo(9), continue_parent(9), handle_geometry_block_save_error(9), vdo_save_geometry_block(9), handle_super_block_save_error(9), vdo_save_super_block(9), vdo_save_components(9), vdo_register_read_only_listener(9), notify_vdo_of_read_only_mode(9), vdo_enable_read_only_entry(9), vdo_wait_until_not_entering_read_only_mode(9), as_notifier(9), finish_entering_read_only_mode(9), make_thread_read_only(9), vdo_allow_read_only_mode_entry(9), vdo_enter_read_only_mode(9), vdo_is_read_only(9), vdo_in_read_only_mode(9), vdo_in_recovery_mode(9), vdo_enter_recovery_mode(9), complete_synchronous_action(9), perform_synchronous_action(9), set_compression_callback(9), vdo_set_compressing(9), vdo_get_compressing(9), vdo_get_physical_blocks_allocated(9), vdo_get_physical_blocks_overhead(9), get_vdo_statistics(9), vdo_fetch_statistics_callback(9), vdo_fetch_statistics(9), vdo_get_callback_thread_id(9), vdo_dump_status(9), vdo_assert_on_admin_thread(9), vdo_assert_on_logical_zone_thread(9), vdo_assert_on_physical_zone_thread(9) β€” whew. tag yourself, i'm vdo_dump_status(9) πŸ˜­πŸ’œ


anyway that's the whole page bestie, go forth and get your physical zones πŸ¦‹πŸ’– this came from ./drivers/md/dm-vdo, dated October 2026, and it's filed under vdo_get_physical_zone(9) β€” periodt. βœ¨πŸŽ€

πŸ“¦ where this page comes from