diff options
| author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2013-04-30 18:28:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:05 -0400 |
| commit | 938e4b22e2a7d0f6f3962e601339347b2d8e09f5 (patch) | |
| tree | 1d66004074a1306c20ce7e40eefc2839736e2ea0 /include/linux | |
| parent | 17afab1de42236ee2f6235f4383cc6f3f13f8a10 (diff) | |
usermodehelper: export call_usermodehelper_exec() and call_usermodehelper_setup()
call_usermodehelper_setup() + call_usermodehelper_exec() need to be
called instead of call_usermodehelper_fns() when the cleanup function
needs to be called even when an ENOMEM error occurs. In this case using
call_usermodehelper_fns() the user can't distinguish if the cleanup
function was called or not.
[akpm@linux-foundation.org: export call_usermodehelper_setup() to modules]
Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kmod.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 5398d5807075..7eebcf5d75f1 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
| @@ -71,6 +71,14 @@ call_usermodehelper_fns(char *path, char **argv, char **envp, int wait, | |||
| 71 | int (*init)(struct subprocess_info *info, struct cred *new), | 71 | int (*init)(struct subprocess_info *info, struct cred *new), |
| 72 | void (*cleanup)(struct subprocess_info *), void *data); | 72 | void (*cleanup)(struct subprocess_info *), void *data); |
| 73 | 73 | ||
| 74 | extern struct subprocess_info * | ||
| 75 | call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask, | ||
| 76 | int (*init)(struct subprocess_info *info, struct cred *new), | ||
| 77 | void (*cleanup)(struct subprocess_info *), void *data); | ||
| 78 | |||
| 79 | extern int | ||
| 80 | call_usermodehelper_exec(struct subprocess_info *info, int wait); | ||
| 81 | |||
| 74 | static inline int | 82 | static inline int |
| 75 | call_usermodehelper(char *path, char **argv, char **envp, int wait) | 83 | call_usermodehelper(char *path, char **argv, char **envp, int wait) |
| 76 | { | 84 | { |
