]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/tty.h
ocfs2: Better I/O error handling in heartbeat
[linux-2.6-omap-h63xx.git] / include / linux / tty.h
index 3787102e4b129abe52f3b53461ff1e7fffb33b40..f13f49afe198cc0d59e998fe3a6e721d70fca6b4 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/tty_driver.h>
 #include <linux/tty_ldisc.h>
 #include <linux/screen_info.h>
+#include <linux/mutex.h>
 
 #include <asm/system.h>
 
@@ -57,6 +58,9 @@ struct tty_buffer {
        unsigned char *flag_buf_ptr;
        int used;
        int size;
+       int active;
+       int commit;
+       int read;
        /* Data points here */
        unsigned long data[0];
 };
@@ -64,6 +68,7 @@ struct tty_buffer {
 struct tty_bufhead {
        struct work_struct              work;
        struct semaphore pty_sem;
+       spinlock_t lock;
        struct tty_buffer *head;        /* Queue head */
        struct tty_buffer *tail;        /* Active buffer */
        struct tty_buffer *free;        /* Free queue head */
@@ -227,8 +232,8 @@ struct tty_struct {
        int canon_data;
        unsigned long canon_head;
        unsigned int canon_column;
-       struct semaphore atomic_read;
-       struct semaphore atomic_write;
+       struct mutex atomic_read_lock;
+       struct mutex atomic_write_lock;
        unsigned char *write_buf;
        int write_cnt;
        spinlock_t read_lock;
@@ -315,8 +320,7 @@ extern void tty_ldisc_put(int);
 extern void tty_wakeup(struct tty_struct *tty);
 extern void tty_ldisc_flush(struct tty_struct *tty);
 
-struct semaphore;
-extern struct semaphore tty_sem;
+extern struct mutex tty_mutex;
 
 /* n_tty.c */
 extern struct tty_ldisc tty_ldisc_N_TTY;