]> err.no Git - linux-2.6/blobdiff - drivers/lguest/lguest_user.c
rt2x00: Remove async vendor request calls from rt2x00usb
[linux-2.6] / drivers / lguest / lguest_user.c
index 980b3550db7fabe59d632be3f74ca86031c108d2..85d42d3d01a9a9bbeb739ce422271848cd4be3ff 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/uaccess.h>
 #include <linux/miscdevice.h>
 #include <linux/fs.h>
+#include <linux/sched.h>
 #include "lg.h"
 
 /*L:055 When something happens, the Waker process needs a way to stop the
@@ -89,8 +90,8 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
 
        /* If we returned from read() last time because the Guest notified,
         * clear the flag. */
-       if (lg->pending_notify)
-               lg->pending_notify = 0;
+       if (cpu->pending_notify)
+               cpu->pending_notify = 0;
 
        /* Run the Guest until something interesting happens. */
        return run_guest(cpu, (unsigned long __user *)user);
@@ -131,6 +132,10 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
         * reference, it is destroyed before close() is called. */
        cpu->mm = get_task_mm(cpu->tsk);
 
+       /* We remember which CPU's pages this Guest used last, for optimization
+        * when the same Guest runs on the same CPU twice. */
+       cpu->last_pages = NULL;
+
        return 0;
 }
 
@@ -192,10 +197,6 @@ static int initialize(struct file *file, const unsigned long __user *input)
        if (err)
                goto free_regs;
 
-       /* We remember which CPU's pages this Guest used last, for optimization
-        * when the same Guest runs on the same CPU twice. */
-       lg->last_pages = NULL;
-
        /* We keep our "struct lguest" in the file's private_data. */
        file->private_data = lg;