build_test_sglist(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… build_test_sglist(9) πŸ’…

okay so this is a page straight out of the Kernel API Manual β€” it's build_test_sglist(9), bestie, and it's literally the function that builds a scatterlist for a crypto test. no cap, that's the whole vibe. πŸ¦‹


✨ NAME ✨

build_test_sglist β€” build a scatterlist for a crypto test πŸŽ€


✨ SYNOPSIS ✨

int build_test_sglist (struct test_sglist *tsgl , const struct
       test_sg_division *divs , const unsigned int alignmask , const unsigned
       int total_len , struct iov_iter *data , const struct test_sg_division
       *out_divs[XBUFSIZE] );

✨ ARGUMENTS ✨

okay so here's the cast of characters, and yes every single one of them matters πŸ’–

  • tsgl β€” the scatterlist that's getting built. and like, tsgl->bufs[] is holding an array of 2-page buffers, and the whole point is that tsgl->sgl[] gets made to point into them. that's the assignment, she understood it 🌸
  • divs β€” the layout specification that the scatterlist is gonna be based on. it's giving blueprint energy πŸŽ€
  • alignmask β€” the algorithm's alignmask. yeah. that one. πŸ’…
  • total_len β€” the total length of the scatterlist to build, in bytes. measuring tape moment πŸ“
  • data β€” okay so if it's non-NULL, the buffers get filled with this data until it ends. otherwise the buffers get poisoned. and in both cases, some bytes past the end of each buffer get poisoned too β€” to help detect overruns πŸ‘€ like it's literally setting a trap for the bugs. iconic behaviour honestly πŸ”₯
  • out_divs β€” if non-NULL, the test_sg_division that each scatterlist entry corresponds to gets returned here. and listen β€” this'll match divs except that divisions resolving to a length of 0 are omitted, because they're not included in the scatterlist anyway. so it's not a 1:1 match, bestie, don't come for me 😭

✨ RETURN ✨

0 or a -errno value 🫢

like... zero if it slayed, negative errno if it did not πŸ’€


✨ SEE ALSO ✨

  • Kernel file ./crypto/testmgr.c
  • struct test_sg_division(9)
  • struct testvec_config(9)

go read those, iykyk 🧚


and that's the whole page, bestie!! this one's from the ./crypto source, version date October 2026 β€” so like, future-core of it all πŸ‘‘β­ thanks for reading, mwah πŸ’œπŸŒˆ

πŸ“¦ where this page comes from