sgl_alloc_order(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sgl_alloc_order(9) ✨

okay so bestie, we're in the Kernel API Manual today and this one is called sgl_alloc_order β€” it's a (9) page so you already know it's kernel-internal, iykyk πŸ’…


πŸŽ€ NAME πŸŽ€

sgl_alloc_order β€” allocate a scatterlist and all its pages, together, in one go 🫢


🌸 SYNOPSIS 🌸

struct scatterlist * sgl_alloc_order (unsigned long long length ,
unsigned int order , bool chainable , gfp_t gfp , unsigned int *nent_p
);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • length β€” the length in bytes of the scatterlist. Lowkey important: it must be at least one ⭐
  • order β€” this is the second argument you'd hand to alloc_pages πŸ“„
  • chainable β€” whether or not to allocate an extra element in the scatterlist, for scatterlist chaining purposes πŸ”—
  • gfp β€” the memory allocation flags 🌈
  • nent_p β€” [out], so it's where the answer comes back to you: the number of entries in the scatterlist that actually have pages πŸ’–

πŸ‘‘ RETURN πŸ‘‘

You get a pointer to an initialized scatterlist πŸ’« or NULL upon failure 😭 (yes, check it, always check it).


🌟 SEE ALSO 🌟

Kernel file ./lib/scatterlist.c, plus the whole scatterlist friend group:


and that's the whole vibe check bestie, go allocate something iconic πŸ’œβœ¨

this page lives in ./lib, version dated October 2026, and it's sgl_alloc_order(9) β€” mwah, slay, periodt πŸŽ€πŸ’…

πŸ“¦ where this page comes from