enclosure_for_each_device(9)
π enclosure_for_each_device(9) π
okay so bestie, welcome to the Kernel API Manual. weβre looking at enclosure_for_each_device, and itβs literally giving βloop over every enclosure and call your functionβ energy. no details skipped, periodt π
β¨ NAME β¨
enclosure_for_each_device β calls a function for each enclosure π¦
π¦ SYNOPSIS π¦
int enclosure_for_each_device (int (*fn)(struct enclosure_device *, void *) , void *data );
π ARGUMENTS π
fnβ the function to call πdataβ the data to pass to each call π«Ά
π₯ DESCRIPTION π₯
It loops over all the enclosures and calls the function. thatβs the whole move, bestie β¨
β οΈ okay this part matters: this function uses a mutex which will be held across calls tofn, so it must have non atomic context. andfnmay (although it should not π) sleep or otherwise cause the mutex to be held for indefinite periods. likeβ¦ please do not make the mutex wait forever, iβm begging π
π SEE ALSO π
Kernel file ./drivers/misc/enclosure.c β and the whole friend group is here too:
enclosure_find(9)enclosure_register(9)enclosure_unregister(9)enclosure_component_alloc(9)enclosure_component_register(9)enclosure_add_device(9)enclosure_remove_device(9)
okay bye bestie π«Ά source/version: ./drivers/misc, date: October 2026, manual: enclosure_for_each_device(9) β slay β¨π
π¦ 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