dax_iomap_copy_around(9)
π 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.talign_size(eitherPMD_SIZEorPAGE_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 β¨
- Either during DAX write fault (page aligned) β to copy the
lengthsize data todaddr. clean, aligned, no drama π§ - Or, while doing a normal DAX write operation,
dax_iomap_itermight 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 bydax_iomap_iteritself β she handles her own business, periodt πββοΈ
β οΈ and here's the important bit, don't skip it: if thesrcmapcontains invalid data, such asHOLEandUNWRITTEN, 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:
enum dax_wake_mode(9)dax_folio_reset_order(9)dax_lock_folio(9)dax_layout_busy_page_range(9)dax_iomap_rw(9)dax_fault_iter(9)dax_iomap_fault(9)dax_finish_sync_fault(9)
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
- 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