diff options
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r-- | kernel/kmod.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 9cd0591c96a2..5ae0ff38425f 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
@@ -245,7 +245,6 @@ static void __call_usermodehelper(struct work_struct *work) | |||
245 | } | 245 | } |
246 | } | 246 | } |
247 | 247 | ||
248 | #ifdef CONFIG_PM_SLEEP | ||
249 | /* | 248 | /* |
250 | * If set, call_usermodehelper_exec() will exit immediately returning -EBUSY | 249 | * If set, call_usermodehelper_exec() will exit immediately returning -EBUSY |
251 | * (used for preventing user land processes from being created after the user | 250 | * (used for preventing user land processes from being created after the user |
@@ -301,6 +300,15 @@ void usermodehelper_enable(void) | |||
301 | usermodehelper_disabled = 0; | 300 | usermodehelper_disabled = 0; |
302 | } | 301 | } |
303 | 302 | ||
303 | /** | ||
304 | * usermodehelper_is_disabled - check if new helpers are allowed to be started | ||
305 | */ | ||
306 | bool usermodehelper_is_disabled(void) | ||
307 | { | ||
308 | return usermodehelper_disabled; | ||
309 | } | ||
310 | EXPORT_SYMBOL_GPL(usermodehelper_is_disabled); | ||
311 | |||
304 | static void helper_lock(void) | 312 | static void helper_lock(void) |
305 | { | 313 | { |
306 | atomic_inc(&running_helpers); | 314 | atomic_inc(&running_helpers); |
@@ -312,12 +320,6 @@ static void helper_unlock(void) | |||
312 | if (atomic_dec_and_test(&running_helpers)) | 320 | if (atomic_dec_and_test(&running_helpers)) |
313 | wake_up(&running_helpers_waitq); | 321 | wake_up(&running_helpers_waitq); |
314 | } | 322 | } |
315 | #else /* CONFIG_PM_SLEEP */ | ||
316 | #define usermodehelper_disabled 0 | ||
317 | |||
318 | static inline void helper_lock(void) {} | ||
319 | static inline void helper_unlock(void) {} | ||
320 | #endif /* CONFIG_PM_SLEEP */ | ||
321 | 323 | ||
322 | /** | 324 | /** |
323 | * call_usermodehelper_setup - prepare to call a usermode helper | 325 | * call_usermodehelper_setup - prepare to call a usermode helper |