]> Pileus Git - ~andy/linux/blobdiff - drivers/tty/tty_io.c
ip_tunnel: Fix off-by-one error in forming dev name.
[~andy/linux] / drivers / tty / tty_io.c
index 6b20fd66d4add86380b10617fee25a9466a2a3c0..05400acbc456f1e9e888972e5c73c5c4f634d71c 100644 (file)
@@ -536,7 +536,7 @@ EXPORT_SYMBOL_GPL(tty_wakeup);
  *     __tty_hangup            -       actual handler for hangup events
  *     @work: tty device
  *
- *     This can be called by the "eventd" kernel thread.  That is process
+ *     This can be called by a "kworker" kernel thread.  That is process
  *     synchronous but doesn't hold any locks, so we need to make sure we
  *     have the appropriate locks for what we're doing.
  *
@@ -960,11 +960,10 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
                        loff_t *ppos)
 {
        int i;
-       struct inode *inode = file->f_path.dentry->d_inode;
        struct tty_struct *tty = file_tty(file);
        struct tty_ldisc *ld;
 
-       if (tty_paranoia_check(tty, inode, "tty_read"))
+       if (tty_paranoia_check(tty, file_inode(file), "tty_read"))
                return -EIO;
        if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
                return -EIO;
@@ -977,8 +976,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
        else
                i = -EIO;
        tty_ldisc_deref(ld);
-       if (i > 0)
-               inode->i_atime = current_fs_time(inode->i_sb);
+
        return i;
 }
 
@@ -1079,11 +1077,8 @@ static inline ssize_t do_tty_write(
                        break;
                cond_resched();
        }
-       if (written) {
-               struct inode *inode = file->f_path.dentry->d_inode;
-               inode->i_mtime = current_fs_time(inode->i_sb);
+       if (written)
                ret = written;
-       }
 out:
        tty_write_unlock(tty);
        return ret;
@@ -1136,12 +1131,11 @@ void tty_write_message(struct tty_struct *tty, char *msg)
 static ssize_t tty_write(struct file *file, const char __user *buf,
                                                size_t count, loff_t *ppos)
 {
-       struct inode *inode = file->f_path.dentry->d_inode;
        struct tty_struct *tty = file_tty(file);
        struct tty_ldisc *ld;
        ssize_t ret;
 
-       if (tty_paranoia_check(tty, inode, "tty_write"))
+       if (tty_paranoia_check(tty, file_inode(file), "tty_write"))
                return -EIO;
        if (!tty || !tty->ops->write ||
                (test_bit(TTY_IO_ERROR, &tty->flags)))
@@ -2051,7 +2045,7 @@ static unsigned int tty_poll(struct file *filp, poll_table *wait)
        struct tty_ldisc *ld;
        int ret = 0;
 
-       if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_poll"))
+       if (tty_paranoia_check(tty, file_inode(filp), "tty_poll"))
                return 0;
 
        ld = tty_ldisc_ref_wait(tty);
@@ -2067,7 +2061,7 @@ static int __tty_fasync(int fd, struct file *filp, int on)
        unsigned long flags;
        int retval = 0;
 
-       if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_fasync"))
+       if (tty_paranoia_check(tty, file_inode(filp), "tty_fasync"))
                goto out;
 
        retval = fasync_helper(fd, filp, on, &tty->fasync);
@@ -2203,6 +2197,7 @@ done:
        mutex_unlock(&tty->termios_mutex);
        return 0;
 }
+EXPORT_SYMBOL(tty_do_resize);
 
 /**
  *     tiocswinsz              -       implement window size set ioctl
@@ -2640,9 +2635,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        void __user *p = (void __user *)arg;
        int retval;
        struct tty_ldisc *ld;
-       struct inode *inode = file->f_dentry->d_inode;
 
-       if (tty_paranoia_check(tty, inode, "tty_ioctl"))
+       if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl"))
                return -EINVAL;
 
        real_tty = tty_pair_get_tty(tty);
@@ -2783,12 +2777,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 static long tty_compat_ioctl(struct file *file, unsigned int cmd,
                                unsigned long arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
        struct tty_struct *tty = file_tty(file);
        struct tty_ldisc *ld;
        int retval = -ENOIOCTLCMD;
 
-       if (tty_paranoia_check(tty, inode, "tty_ioctl"))
+       if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl"))
                return -EINVAL;
 
        if (tty->ops->compat_ioctl) {