sgl_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ sgl_alloc(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual β€” this is the page for sgl_alloc(9) and it's honestly a whole vibe. it does exactly one thing and it does it iconically: it hands you a scatterlist and the pages that go with it. let's get into it πŸ’…


✨ NAME ✨

sgl_alloc β€” allocate a scatterlist and its pages 🫢

like, both of them. together. one function call. main character energy fr fr.


🌸 SYNOPSIS 🌸

struct scatterlist * sgl_alloc (unsigned long long length , gfp_t gfp ,
unsigned int *nent_p );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • length β€” the length in bytes of the scatterlist. yes, unsigned long long, she's got range πŸ’œ
  • gfp β€” the memory allocation flags. this is where you tell the kernel how you want your memory to behave (iykyk) ✨
  • nent_p β€” marked [out] in the original, so it's an output param, bestie β€” the number of entries in the scatterlist gets written back through this pointer. it's giving "you'll find out how many when we're done" πŸŽ€

πŸ’€ RETURN πŸ’€

a pointer to an initialized scatterlist, or NULL upon failure 😭

no cap: check for that NULL, okay? it's literally right there in the spec.

πŸ”₯ SEE ALSO πŸ”₯

the kernel file lives at ./lib/scatterlist.c β€” that's the mothership 🏠 and here's the whole scatterlist family reunion, every single one of them, no skips:


that's the whole page, bestie, nothing left out πŸ’– this one ships from ./lib, dated October 2026 β€” go be iconic with your scatterlists, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from