diff options
Diffstat (limited to 'include/linux/kmod.h')
| -rw-r--r-- | include/linux/kmod.h | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index dd99c329e161..5398d5807075 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
| @@ -66,40 +66,10 @@ struct subprocess_info { | |||
| 66 | void *data; | 66 | void *data; |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | /* Allocate a subprocess_info structure */ | 69 | extern int |
| 70 | struct subprocess_info *call_usermodehelper_setup(char *path, char **argv, | ||
| 71 | char **envp, gfp_t gfp_mask); | ||
| 72 | |||
| 73 | /* Set various pieces of state into the subprocess_info structure */ | ||
| 74 | void call_usermodehelper_setfns(struct subprocess_info *info, | ||
| 75 | int (*init)(struct subprocess_info *info, struct cred *new), | ||
| 76 | void (*cleanup)(struct subprocess_info *info), | ||
| 77 | void *data); | ||
| 78 | |||
| 79 | /* Actually execute the sub-process */ | ||
| 80 | int call_usermodehelper_exec(struct subprocess_info *info, int wait); | ||
| 81 | |||
| 82 | /* Free the subprocess_info. This is only needed if you're not going | ||
| 83 | to call call_usermodehelper_exec */ | ||
| 84 | void call_usermodehelper_freeinfo(struct subprocess_info *info); | ||
| 85 | |||
| 86 | static inline int | ||
| 87 | call_usermodehelper_fns(char *path, char **argv, char **envp, int wait, | 70 | call_usermodehelper_fns(char *path, char **argv, char **envp, int wait, |
| 88 | int (*init)(struct subprocess_info *info, struct cred *new), | 71 | int (*init)(struct subprocess_info *info, struct cred *new), |
| 89 | void (*cleanup)(struct subprocess_info *), void *data) | 72 | void (*cleanup)(struct subprocess_info *), void *data); |
| 90 | { | ||
| 91 | struct subprocess_info *info; | ||
| 92 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; | ||
| 93 | |||
| 94 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask); | ||
| 95 | |||
| 96 | if (info == NULL) | ||
| 97 | return -ENOMEM; | ||
| 98 | |||
| 99 | call_usermodehelper_setfns(info, init, cleanup, data); | ||
| 100 | |||
| 101 | return call_usermodehelper_exec(info, wait); | ||
| 102 | } | ||
| 103 | 73 | ||
| 104 | static inline int | 74 | static inline int |
| 105 | call_usermodehelper(char *path, char **argv, char **envp, int wait) | 75 | call_usermodehelper(char *path, char **argv, char **envp, int wait) |
