_shift_data_right_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« _shift_data_right_pages(9) β€” the Kernel API Manual, but make it make sense

okay bestie, so this is _shift_data_right_pages(9) from the Kernel API Manual, and ngl the NAME section is literally just the function name with a lonely little dash after it and nothing else, so there's no one-line summary for me to serve you here. Iconic of it to say nothing. We move on πŸ’…


✨ SYNOPSIS ✨

void _shift_data_right_pages (struct page **pages , size_t pgto_base ,
       size_t pgfrom_base , size_t len );

that's the whole vibe: it returns nothing (void), and it takes four things. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • pages β€” the vector of pages holding both the source and the destination memory area 🫢 like, one array, two jobs.
  • pgto_base β€” the page-vector address of the destination (where the data is going).
  • pgfrom_base β€” the page-vector address of the source (where the data is coming from).
  • len β€” the number of bytes to copy πŸ”’

🌸 NOTE 🌸

so the addresses pgto_base and pgfrom_base are both calculated the exact same way, and here's the tea:

if a memory area starts at byte base in page pages[i], then its address is given as (i << PAGE_SHIFT) + base

also, super important, not me letting you miss this: pgfrom_base must be < pgto_base πŸ”₯ but the memory areas that those two pointers point to may overlap β€” that's fine, that's allowed, no cap.


πŸ¦‹ SEE ALSO πŸ¦‹

this function is in the kernel file ./net/sunrpc/xdr.c and it's like, deeply entangled with its little friends, so here's the whole group chat πŸ‘‘:

like, the whole xdr family tree fr fr 🌈


and that's the page!! from ./net/sunrpc, dated October 2026, bestie β€” go shift some data right, you absolute main character πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from