18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#include <linux/atomic.h> 38c2ecf20Sopenharmony_ci#include <linux/debugfs.h> 48c2ecf20Sopenharmony_ci#include <linux/notifier.h> 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_cistruct notifier_err_inject_action { 78c2ecf20Sopenharmony_ci unsigned long val; 88c2ecf20Sopenharmony_ci int error; 98c2ecf20Sopenharmony_ci const char *name; 108c2ecf20Sopenharmony_ci}; 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define NOTIFIER_ERR_INJECT_ACTION(action) \ 138c2ecf20Sopenharmony_ci .name = #action, .val = (action), 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistruct notifier_err_inject { 168c2ecf20Sopenharmony_ci struct notifier_block nb; 178c2ecf20Sopenharmony_ci struct notifier_err_inject_action actions[]; 188c2ecf20Sopenharmony_ci /* The last slot must be terminated with zero sentinel */ 198c2ecf20Sopenharmony_ci}; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciextern struct dentry *notifier_err_inject_dir; 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciextern struct dentry *notifier_err_inject_init(const char *name, 248c2ecf20Sopenharmony_ci struct dentry *parent, struct notifier_err_inject *err_inject, 258c2ecf20Sopenharmony_ci int priority); 26