]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
virtio: console: Use wait_event_freezable instead of _interruptible
authorAmit Shah <amit.shah@redhat.com>
Wed, 14 Sep 2011 07:36:41 +0000 (13:06 +0530)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 24 Oct 2011 20:12:23 +0000 (07:12 +1100)
Get ready to support suspend/resume by using the freezable calls so that
blocking read/write syscalls are handled properly across suspend/resume.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c

index 5397884b6c024469d308269afb3243231d199a63..8f49d0f034e04a7bdcd7b96857649ce7382f1e77 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/debugfs.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <linux/freezer.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/list.h>
@@ -633,8 +634,8 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
                if (filp->f_flags & O_NONBLOCK)
                        return -EAGAIN;
 
-               ret = wait_event_interruptible(port->waitqueue,
-                                              !will_read_block(port));
+               ret = wait_event_freezable(port->waitqueue,
+                                          !will_read_block(port));
                if (ret < 0)
                        return ret;
        }
@@ -677,8 +678,8 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
                if (nonblock)
                        return -EAGAIN;
 
-               ret = wait_event_interruptible(port->waitqueue,
-                                              !will_write_block(port));
+               ret = wait_event_freezable(port->waitqueue,
+                                          !will_write_block(port));
                if (ret < 0)
                        return ret;
        }