linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / kernel / kmod.c
index 1e79dfc..5a5ec77 100644 (file)
@@ -20,6 +20,7 @@
 */
 #define __KERNEL_SYSCALLS__
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/syscalls.h>
@@ -127,14 +128,14 @@ struct subprocess_info {
 /*
  * This is the task which runs the usermode application
  */
-int
-__exec_usermodehelper(char *path, char **argv, char **envp, struct key *ring)
+static int ____call_usermodehelper(void *data)
 {
+       struct subprocess_info *sub_info = data;
        struct key *new_session, *old_session;
        int retval;
 
        /* Unblock all signals and set the session keyring. */
-       new_session = key_get(ring);
+       new_session = key_get(sub_info->ring);
        flush_signals(current);
        spin_lock_irq(&current->sighand->siglock);
        old_session = __install_session_keyring(current, new_session);
@@ -145,28 +146,12 @@ __exec_usermodehelper(char *path, char **argv, char **envp, struct key *ring)
 
        key_put(old_session);
 
-       retval = -EPERM;
-       if (current->fs->root)
-               retval = execve(path, argv, envp);
-
-       return retval;
-}
-
-EXPORT_SYMBOL_GPL(__exec_usermodehelper);
-
-/*
- * This is the task which runs the usermode application
- */
-static int ____call_usermodehelper(void *data)
-{
-       struct subprocess_info *sub_info = data;
-       int retval;
-
        /* We can run anywhere, unlike our parent keventd(). */
        set_cpus_allowed(current, CPU_MASK_ALL);
 
-       retval = __exec_usermodehelper(sub_info->path,
-                       sub_info->argv, sub_info->envp, sub_info->ring);
+       retval = -EPERM;
+       if (current->fs->root)
+               retval = execve(sub_info->path, sub_info->argv,sub_info->envp);
 
        /* Exec failed? */
        sub_info->retval = retval;
@@ -185,7 +170,7 @@ static int wait_for_helper(void *data)
        sa.sa.sa_handler = SIG_IGN;
        sa.sa.sa_flags = 0;
        siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
-       do_sigaction(SIGCHLD, &sa, NULL);
+       do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
        allow_signal(SIGCHLD);
 
        pid = kernel_thread(____call_usermodehelper, sub_info, SIGCHLD);
@@ -212,8 +197,8 @@ static int wait_for_helper(void *data)
 static void __call_usermodehelper(void *data)
 {
        struct subprocess_info *sub_info = data;
-       pid_t pid;
        int wait = sub_info->wait;
+       pid_t pid;
 
        /* CLONE_VFORK: wait until the usermode helper has execve'd
         * successfully We need the data structures to stay around
@@ -250,7 +235,7 @@ static void __call_usermodehelper(void *data)
 int call_usermodehelper_keys(char *path, char **argv, char **envp,
                             struct key *session_keyring, int wait)
 {
-       DECLARE_COMPLETION_ONSTACK(done);
+       DECLARE_COMPLETION(done);
        struct subprocess_info sub_info = {
                .complete       = &done,
                .path           = path,