attribute_c...trigger_safe(9)
π attribute_container_device_trigger_safe β Kernel API Manual (section 9)
okay so bestie, buckle in, because this one is genuinely a safety girlie and we stan her for it π
β¨ NAME β¨
attribute_container_device_trigger_safe β run a trigger for every matching classdev, or make the whole thing fail for all of them. no halfsies. it's giving all-or-nothing energy π
π¦ SYNOPSIS π¦
int attribute_container_device_trigger_safe (struct device *dev , int
(*fn)(struct attribute_container *, struct device *, struct device *) ,
int (*undo)(struct attribute_container *, struct device *, struct device
*) );
like yes, those function pointers are lowkey a mouthful, but look at her, she's iconic π
πΈ ARGUMENTS πΈ
devβ the generic device you're running the trigger for. the main character of this whole operation β¨fnβ the function to execute for each classdev. this is the do-the-thing callback, fr fr.undoβ a function to undo the work that was previously done, in case of error. she's the cleanup crew, the ride-or-die, the "we can fix this" bestie π«Ά
π DESCRIPTION π
okay so here's the tea: this function is the safe version of attribute_container_device_trigger. π
It stops on the very first error, and then it undoes the partial work that had been done on the previous classdev. so nothing's just left sitting around in a weird half-finished state, no ma'am π
and the guarantee? it's guaranteed that either they all succeeded, or none of them succeeded. periodt. atomic queen behaviour, no cap π
ngl, that all-or-nothing guarantee is the whole point of picking this one over the plain trigger β if you want the risky vibe, that's a different function, iykyk π
π§ SEE ALSO π§
- Kernel file
./drivers/base/attribute_container.c attribute_container_classdev_to_container(9)attribute_container_register(9)attribute_container_unregister(9)attribute_container_add_device(9)attribute_container_remove_device(9)attribute_container_device_trigger(9)attribute_container_add_attrs(9)attribute_container_add_class_device(9)attribute_container_remove_attrs(9)attribute_container_class_device_del(9)attribute_container_find_class_device(9)
and that's the whole page bestie, you ate that πβ¨
shoutout to ./drivers/base for housing all this goodness, and this little cutie is dated October 2026 β 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