dax_direct_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dax_direct_access πŸ’«

okay so first things first, this page lives in the Kernel API Manual section (that's section 9, bestie, the kernel-API one, not the "type man and pray" one) and it's literally all about translating a device pgoff into an absolute pfn. icon behavior honestly πŸŽ€


🌸 NAME 🌸

dax_direct_access β€” translate a device pgoff to an absolute pfn ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

long dax_direct_access (struct dax_device *dax_dev , pgoff_t pgoff ,
long nr_pages , enum dax_access_mode mode , void **kaddr , unsigned long
*pfn );

she takes six arguments and returns a long, no cap πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • dax_dev β€” a dax_device instance that represents the logical memory range. like, this is the device we're talking about, she's the main character πŸ‘‘
  • pgoff β€” the offset in pages, counted from the start of the device, that you want translated 🧚
  • nr_pages β€” how many consecutive pages the caller can handle relative to pfn. so, how much you're ready to take in one go 🫢
  • mode β€” an indicator of whether this is a normal access or a recovery write ⭐
  • kaddr β€” output parameter that returns a virtual address mapping of pfn πŸŽ€
  • pfn β€” output parameter that returns an absolute pfn translation of pgoff πŸ”₯

bestie note: kaddr and pfn are output parameters, so they're giving results back to you, they are not input, don't come for them πŸ™ˆ


🌈 RETURN 🌈

  • a negative errno if an error occurs 😭
  • otherwise, the number of pages accessible at the device relative pgoff ✨

like, either it's a sad negative number or it's a page count. no in-between, periodt πŸ’€


πŸ’œ SEE ALSO πŸ’œ

go read those next, iykyk πŸ“šβœ¨


lowkey this whole thing lives under ./drivers/dax, the page is dated October 2026, and it's dax_direct_access(9) all the way down β€” that's the vibe check, we're done here πŸ’…πŸ«ΆπŸ“
πŸ“¦ where this page comes from