build_test_sglist(9)
π 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 thattsgl->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'salignmask. 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, thetest_sg_divisionthat each scatterlist entry corresponds to gets returned here. and listen β this'll matchdivsexcept that divisions resolving to a length of0are 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
- 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