Lines Matching refs:filp

158 static int __tty_fasync(int fd, struct file *filp, int on);
159 static int tty_fasync(int fd, struct file *filp, int on);
450 static unsigned int hung_up_tty_poll(struct file *filp, poll_table *wait) in hung_up_tty_poll() argument
682 struct file *filp, *f = NULL; in __tty_hangup() local
713 filp = priv->file; in __tty_hangup()
714 if (filp->f_op->write == redirected_tty_write) in __tty_hangup()
715 cons_filp = filp; in __tty_hangup()
716 if (filp->f_op->write != tty_write) in __tty_hangup()
719 __tty_fasync(-1, filp, 0); /* can't block */ in __tty_hangup()
720 filp->f_op = &hung_up_tty_fops; in __tty_hangup()
850 int tty_hung_up_p(struct file *filp) in tty_hung_up_p() argument
852 return (filp->f_op == &hung_up_tty_fops); in tty_hung_up_p()
1764 int tty_release(struct inode *inode, struct file *filp) in tty_release() argument
1766 struct tty_struct *tty = file_tty(filp); in tty_release()
1779 __tty_fasync(-1, filp, 0); in tty_release()
1794 tty->ops->close(tty, filp); in tty_release()
1872 tty_del_file(filp); in tty_release()
1935 static struct tty_struct *tty_open_current_tty(dev_t device, struct file *filp) in tty_open_current_tty() argument
1947 filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ in tty_open_current_tty()
1973 static struct tty_driver *tty_lookup_driver(dev_t device, struct file *filp, in tty_lookup_driver() argument
1994 filp->f_flags |= O_NONBLOCK; in tty_lookup_driver()
2034 static int tty_open(struct inode *inode, struct file *filp) in tty_open() argument
2041 unsigned saved_flags = filp->f_flags; in tty_open()
2043 nonseekable_open(inode, filp); in tty_open()
2046 retval = tty_alloc_file(filp); in tty_open()
2050 noctty = filp->f_flags & O_NOCTTY; in tty_open()
2054 tty = tty_open_current_tty(device, filp); in tty_open()
2057 driver = tty_lookup_driver(device, filp, &noctty, &index); in tty_open()
2097 tty_free_file(filp); in tty_open()
2102 tty_add_file(tty, filp); in tty_open()
2112 retval = tty->ops->open(tty, filp); in tty_open()
2115 filp->f_flags = saved_flags; in tty_open()
2121 tty_release(inode, filp); in tty_open()
2132 if (tty_hung_up_p(filp)) in tty_open()
2133 filp->f_op = &tty_fops; in tty_open()
2159 if (filp->f_mode & FMODE_READ) in tty_open()
2173 tty_free_file(filp); in tty_open()
2191 static unsigned int tty_poll(struct file *filp, poll_table *wait) in tty_poll() argument
2193 struct tty_struct *tty = file_tty(filp); in tty_poll()
2197 if (tty_paranoia_check(tty, file_inode(filp), "tty_poll")) in tty_poll()
2202 ret = ld->ops->poll(tty, filp, wait); in tty_poll()
2207 static int __tty_fasync(int fd, struct file *filp, int on) in __tty_fasync() argument
2209 struct tty_struct *tty = file_tty(filp); in __tty_fasync()
2214 if (tty_paranoia_check(tty, file_inode(filp), "tty_fasync")) in __tty_fasync()
2217 retval = fasync_helper(fd, filp, on, &tty->fasync); in __tty_fasync()
2242 __f_setown(filp, pid, type, 0); in __tty_fasync()
2250 static int tty_fasync(int fd, struct file *filp, int on) in tty_fasync() argument
2252 struct tty_struct *tty = file_tty(filp); in tty_fasync()
2256 retval = __tty_fasync(fd, filp, on); in tty_fasync()