diff options
| author | Boaz Harrosh <bharrosh@panasas.com> | 2012-05-31 19:26:15 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 20:49:28 -0400 |
| commit | 81ab6e7b26b453a795d46f2616ed0e31d97f05b9 (patch) | |
| tree | a8d50eb5b35ad93b793450bfef4d90df34494a2c /kernel | |
| parent | ae3cef7300e9fddc35ad251dd5f27c5b88c8594a (diff) | |
kmod: convert two call sites to call_usermodehelper_fns()
Both kernel/sys.c && security/keys/request_key.c where inlining the exact
same code as call_usermodehelper_fns(); So simply convert these sites to
directly use call_usermodehelper_fns().
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
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/sys.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 8b71cef3bf1a..6e81aa7e4688 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
| @@ -2114,7 +2114,6 @@ int orderly_poweroff(bool force) | |||
| 2114 | NULL | 2114 | NULL |
| 2115 | }; | 2115 | }; |
| 2116 | int ret = -ENOMEM; | 2116 | int ret = -ENOMEM; |
| 2117 | struct subprocess_info *info; | ||
| 2118 | 2117 | ||
| 2119 | if (argv == NULL) { | 2118 | if (argv == NULL) { |
| 2120 | printk(KERN_WARNING "%s failed to allocate memory for \"%s\"\n", | 2119 | printk(KERN_WARNING "%s failed to allocate memory for \"%s\"\n", |
| @@ -2122,18 +2121,16 @@ int orderly_poweroff(bool force) | |||
| 2122 | goto out; | 2121 | goto out; |
| 2123 | } | 2122 | } |
| 2124 | 2123 | ||
| 2125 | info = call_usermodehelper_setup(argv[0], argv, envp, GFP_ATOMIC); | 2124 | ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT, |
| 2126 | if (info == NULL) { | 2125 | NULL, argv_cleanup, NULL); |
| 2127 | argv_free(argv); | 2126 | out: |
| 2128 | goto out; | 2127 | if (likely(!ret)) |
| 2129 | } | 2128 | return 0; |
| 2130 | |||
| 2131 | call_usermodehelper_setfns(info, NULL, argv_cleanup, NULL); | ||
| 2132 | 2129 | ||
| 2133 | ret = call_usermodehelper_exec(info, UMH_NO_WAIT); | 2130 | if (ret == -ENOMEM) |
| 2131 | argv_free(argv); | ||
| 2134 | 2132 | ||
| 2135 | out: | 2133 | if (force) { |
| 2136 | if (ret && force) { | ||
| 2137 | printk(KERN_WARNING "Failed to start orderly shutdown: " | 2134 | printk(KERN_WARNING "Failed to start orderly shutdown: " |
| 2138 | "forcing the issue\n"); | 2135 | "forcing the issue\n"); |
| 2139 | 2136 | ||
