diff options
| author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2013-04-30 18:28:09 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:06 -0400 |
| commit | 66e5b7e1948cdbdca2b0cc6ddc6d69ee84583fb4 (patch) | |
| tree | aab4bddfc97523c11a7e3714644a29373c8d4a85 /kernel | |
| parent | 907ed1328d2a748f3d6028503d3e04c74ea62730 (diff) | |
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: Lucas 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/kmod.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 9941a4f155d1..1296e72e4161 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
| @@ -555,8 +555,8 @@ EXPORT_SYMBOL(call_usermodehelper_setup); | |||
| 555 | * call_usermodehelper_exec - start a usermode application | 555 | * call_usermodehelper_exec - start a usermode application |
| 556 | * @sub_info: information about the subprocessa | 556 | * @sub_info: information about the subprocessa |
| 557 | * @wait: wait for the application to finish and return status. | 557 | * @wait: wait for the application to finish and return status. |
| 558 | * when -1 don't wait at all, but you get no useful error back when | 558 | * when UMH_NO_WAIT don't wait at all, but you get no useful error back |
| 559 | * the program couldn't be exec'ed. This makes it safe to call | 559 | * when the program couldn't be exec'ed. This makes it safe to call |
| 560 | * from interrupt context. | 560 | * from interrupt context. |
| 561 | * | 561 | * |
| 562 | * Runs a user-space application. The application is started | 562 | * Runs a user-space application. The application is started |
| @@ -616,29 +616,32 @@ unlock: | |||
| 616 | } | 616 | } |
| 617 | EXPORT_SYMBOL(call_usermodehelper_exec); | 617 | EXPORT_SYMBOL(call_usermodehelper_exec); |
| 618 | 618 | ||
| 619 | /* | 619 | /** |
| 620 | * call_usermodehelper_fns() will not run the caller-provided cleanup function | 620 | * call_usermodehelper() - prepare and start a usermode application |
| 621 | * if a memory allocation failure is experienced. So the caller might need to | 621 | * @path: path to usermode executable |
| 622 | * check the call_usermodehelper_fns() return value: if it is -ENOMEM, perform | 622 | * @argv: arg vector for process |
| 623 | * the necessaary cleanup within the caller. | 623 | * @envp: environment for process |
| 624 | * @wait: wait for the application to finish and return status. | ||
| 625 | * when UMH_NO_WAIT don't wait at all, but you get no useful error back | ||
| 626 | * when the program couldn't be exec'ed. This makes it safe to call | ||
| 627 | * from interrupt context. | ||
| 628 | * | ||
| 629 | * This function is the equivalent to use call_usermodehelper_setup() and | ||
| 630 | * call_usermodehelper_exec(). | ||
| 624 | */ | 631 | */ |
| 625 | int call_usermodehelper_fns( | 632 | int call_usermodehelper(char *path, char **argv, char **envp, int wait) |
| 626 | char *path, char **argv, char **envp, int wait, | ||
| 627 | int (*init)(struct subprocess_info *info, struct cred *new), | ||
| 628 | void (*cleanup)(struct subprocess_info *), void *data) | ||
| 629 | { | 633 | { |
| 630 | struct subprocess_info *info; | 634 | struct subprocess_info *info; |
| 631 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; | 635 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; |
| 632 | 636 | ||
| 633 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask, | 637 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask, |
| 634 | init, cleanup, data); | 638 | NULL, NULL, NULL); |
| 635 | |||
| 636 | if (info == NULL) | 639 | if (info == NULL) |
| 637 | return -ENOMEM; | 640 | return -ENOMEM; |
| 638 | 641 | ||
| 639 | return call_usermodehelper_exec(info, wait); | 642 | return call_usermodehelper_exec(info, wait); |
| 640 | } | 643 | } |
| 641 | EXPORT_SYMBOL(call_usermodehelper_fns); | 644 | EXPORT_SYMBOL(call_usermodehelper); |
| 642 | 645 | ||
| 643 | static int proc_cap_handler(struct ctl_table *table, int write, | 646 | static int proc_cap_handler(struct ctl_table *table, int write, |
| 644 | void __user *buffer, size_t *lenp, loff_t *ppos) | 647 | void __user *buffer, size_t *lenp, loff_t *ppos) |
