notifier-error-inject.h 614 B

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