Commit 66e5b7e1 authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Linus Torvalds

kmod: remove call_usermodehelper_fns()

This function suffers from not being able to determine if the cleanup is
called in case it returns -ENOMEM.  Nobody is using it anymore, so let's
remove it.
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 907ed132
...@@ -67,9 +67,7 @@ struct subprocess_info { ...@@ -67,9 +67,7 @@ struct subprocess_info {
}; };
extern int extern int
call_usermodehelper_fns(char *path, char **argv, char **envp, int wait, call_usermodehelper(char *path, char **argv, char **envp, int wait);
int (*init)(struct subprocess_info *info, struct cred *new),
void (*cleanup)(struct subprocess_info *), void *data);
extern struct subprocess_info * extern struct subprocess_info *
call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask, call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask,
...@@ -79,13 +77,6 @@ call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask, ...@@ -79,13 +77,6 @@ call_usermodehelper_setup(char *path, char **argv, char **envp, gfp_t gfp_mask,
extern int extern int
call_usermodehelper_exec(struct subprocess_info *info, int wait); call_usermodehelper_exec(struct subprocess_info *info, int wait);
static inline int
call_usermodehelper(char *path, char **argv, char **envp, int wait)
{
return call_usermodehelper_fns(path, argv, envp, wait,
NULL, NULL, NULL);
}
extern struct ctl_table usermodehelper_table[]; extern struct ctl_table usermodehelper_table[];
enum umh_disable_depth { enum umh_disable_depth {
......
...@@ -555,8 +555,8 @@ EXPORT_SYMBOL(call_usermodehelper_setup); ...@@ -555,8 +555,8 @@ EXPORT_SYMBOL(call_usermodehelper_setup);
* call_usermodehelper_exec - start a usermode application * call_usermodehelper_exec - start a usermode application
* @sub_info: information about the subprocessa * @sub_info: information about the subprocessa
* @wait: wait for the application to finish and return status. * @wait: wait for the application to finish and return status.
* when -1 don't wait at all, but you get no useful error back when * when UMH_NO_WAIT don't wait at all, but you get no useful error back
* the program couldn't be exec'ed. This makes it safe to call * when the program couldn't be exec'ed. This makes it safe to call
* from interrupt context. * from interrupt context.
* *
* Runs a user-space application. The application is started * Runs a user-space application. The application is started
...@@ -616,29 +616,32 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait) ...@@ -616,29 +616,32 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
} }
EXPORT_SYMBOL(call_usermodehelper_exec); EXPORT_SYMBOL(call_usermodehelper_exec);
/* /**
* call_usermodehelper_fns() will not run the caller-provided cleanup function * call_usermodehelper() - prepare and start a usermode application
* if a memory allocation failure is experienced. So the caller might need to * @path: path to usermode executable
* check the call_usermodehelper_fns() return value: if it is -ENOMEM, perform * @argv: arg vector for process
* the necessaary cleanup within the caller. * @envp: environment for process
* @wait: wait for the application to finish and return status.
* when UMH_NO_WAIT don't wait at all, but you get no useful error back
* when the program couldn't be exec'ed. This makes it safe to call
* from interrupt context.
*
* This function is the equivalent to use call_usermodehelper_setup() and
* call_usermodehelper_exec().
*/ */
int call_usermodehelper_fns( int call_usermodehelper(char *path, char **argv, char **envp, int wait)
char *path, char **argv, char **envp, int wait,
int (*init)(struct subprocess_info *info, struct cred *new),
void (*cleanup)(struct subprocess_info *), void *data)
{ {
struct subprocess_info *info; struct subprocess_info *info;
gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
info = call_usermodehelper_setup(path, argv, envp, gfp_mask, info = call_usermodehelper_setup(path, argv, envp, gfp_mask,
init, cleanup, data); NULL, NULL, NULL);
if (info == NULL) if (info == NULL)
return -ENOMEM; return -ENOMEM;
return call_usermodehelper_exec(info, wait); return call_usermodehelper_exec(info, wait);
} }
EXPORT_SYMBOL(call_usermodehelper_fns); EXPORT_SYMBOL(call_usermodehelper);
static int proc_cap_handler(struct ctl_table *table, int write, static int proc_cap_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos) void __user *buffer, size_t *lenp, loff_t *ppos)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment