_shift_data_right_pages(9)
π« _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 pagepages[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 π:
xdr_encode_opaque_fixed(9)xdr_encode_opaque(9)xdr_terminate_string(9)xdr_buf_to_bvec(9)xdr_buf_to_sg(9)xdr_buf_to_sg_alloc(9)xdr_inline_pages(9)_shift_data_left_pages(9)_copy_to_pages(9)_copy_from_pages(9)xdr_buf_pages_zero(9)xdr_shrink_bufhead(9)xdr_shrink_pagelen(9)xdr_stream_pos(9)xdr_page_pos(9)xdr_init_encode(9)xdr_init_encode_pages(9)__xdr_commit_encode(9)xdr_reserve_space(9)xdr_reserve_space_vec(9)xdr_truncate_encode(9)xdr_truncate_decode(9)xdr_restrict_buflen(9)xdr_write_pages(9)xdr_init_decode(9)xdr_init_decode_pages(9)xdr_finish_decode(9)xdr_inline_decode(9)xdr_read_pages(9)xdr_set_pagelen(9)xdr_enter_page(9)xdr_buf_subsegment(9)xdr_stream_subsegment(9)xdr_stream_move_subsegment(9)xdr_stream_zero(9)xdr_buf_trim(9)xdr_stream_decode_string_dup(9)xdr_stream_decode_opaque_auth(9)xdr_stream_encode_opaque_auth(9)
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
- 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