dax_iomap_copy_around(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dax_iomap_copy_around(9) πŸ’…

okay so this is a page from the Kernel API Manual (yes, that one) and it's all about dax_iomap_copy_around β€” literally the function that preps for an unaligned write to a shared/cow page by copying the data before and after the range you're about to write. bestie, it's giving "make room, I'm coming through" energy 🫢


✨ NAME ✨

dax_iomap_copy_around β€” Prepare for an unaligned write to a shared/cow page by copying the data before and after the range to be written.

no cap, that's the whole vibe: scoot the neighbours over so your write has somewhere cute to land πŸ’–

🌸 SYNOPSIS 🌸

int dax_iomap_copy_around (loff_t pos , uint64_t length , size_t
align_size , const struct iomap *srcmap , void *daddr );

like… five args, one int back. she's lowkey iconic for that 🌈


πŸŽ€ ARGUMENTS πŸŽ€

  • pos β€” address to do copy from. literally the starting point, bestie πŸ“
  • length β€” size of copy operation. how much we're copying, fr fr πŸ“
  • align_size β€” aligned w.r.t align_size (either PMD_SIZE or PAGE_SIZE). so it's one of those two, no in-between πŸ’…
  • srcmap β€” iomap srcmap. the map we're sourcing from πŸ—ΊοΈ
  • daddr β€” destination address to copy to. where it all lands 🎯

πŸ¦‹ DESCRIPTION πŸ¦‹

so this can be called from two places, and honestly? main character duality ✨

  1. Either during DAX write fault (page aligned) β€” to copy the length size data to daddr. clean, aligned, no drama 🧚
  2. Or, while doing a normal DAX write operation, dax_iomap_iter might call this to do the copy of either the start or end unaligned address. In the latter case the rest of the copy of aligned ranges is taken care of by dax_iomap_iter itself β€” she handles her own business, periodt πŸ’β€β™€οΈ
⚠️ and here's the important bit, don't skip it: if the srcmap contains invalid data, such as HOLE and UNWRITTEN, zero the area to make sure no old data remains. like, wipe the slate clean so nothing stale sneaks through πŸ˜­πŸ”’

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/dax.c and her little friend group:

iykyk πŸ’œ


and that's the page!! πŸ“ straight out of ./fs, October 2026 edition β€” go forth and copy around responsibly, bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from