notifier-error-inject.h 653 B

12345678910111213141516171819202122232425
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <linux/atomic.h>
  3. #include <linux/debugfs.h>
  4. #include <linux/notifier.h>
  5. struct notifier_err_inject_action {
  6. unsigned long val;
  7. int error;
  8. const char *name;
  9. };
  10. #define NOTIFIER_ERR_INJECT_ACTION(action) \
  11. .name = #action, .val = (action),
  12. struct notifier_err_inject {
  13. struct notifier_block nb;
  14. struct notifier_err_inject_action actions[];
  15. /* The last slot must be terminated with zero sentinel */
  16. };
  17. extern struct dentry *notifier_err_inject_dir;
  18. extern struct dentry *notifier_err_inject_init(const char *name,
  19. struct dentry *parent, struct notifier_err_inject *err_inject,
  20. int priority);