Lines Matching refs:filp
153 static int __tty_fasync(int fd, struct file *filp, int on);
154 static int tty_fasync(int fd, struct file *filp, int on);
439 static unsigned int hung_up_tty_poll(struct file *filp, poll_table *wait) in hung_up_tty_poll() argument
670 struct file *filp, *f = NULL; in __tty_hangup() local
701 filp = priv->file; in __tty_hangup()
702 if (filp->f_op->write == redirected_tty_write) in __tty_hangup()
703 cons_filp = filp; in __tty_hangup()
704 if (filp->f_op->write != tty_write) in __tty_hangup()
707 __tty_fasync(-1, filp, 0); /* can't block */ in __tty_hangup()
708 filp->f_op = &hung_up_tty_fops; in __tty_hangup()
849 int tty_hung_up_p(struct file *filp) in tty_hung_up_p() argument
851 return (filp->f_op == &hung_up_tty_fops); in tty_hung_up_p()
1770 int tty_release(struct inode *inode, struct file *filp) in tty_release() argument
1772 struct tty_struct *tty = file_tty(filp); in tty_release()
1786 __tty_fasync(-1, filp, 0); in tty_release()
1804 tty->ops->close(tty, filp); in tty_release()
1882 tty_del_file(filp); in tty_release()
1949 static struct tty_struct *tty_open_current_tty(dev_t device, struct file *filp) in tty_open_current_tty() argument
1961 filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ in tty_open_current_tty()
1987 static struct tty_driver *tty_lookup_driver(dev_t device, struct file *filp, in tty_lookup_driver() argument
2008 filp->f_flags |= O_NONBLOCK; in tty_lookup_driver()
2048 static int tty_open(struct inode *inode, struct file *filp) in tty_open() argument
2055 unsigned saved_flags = filp->f_flags; in tty_open()
2057 nonseekable_open(inode, filp); in tty_open()
2060 retval = tty_alloc_file(filp); in tty_open()
2064 noctty = filp->f_flags & O_NOCTTY; in tty_open()
2068 tty = tty_open_current_tty(device, filp); in tty_open()
2071 driver = tty_lookup_driver(device, filp, &noctty, &index); in tty_open()
2107 tty_add_file(tty, filp); in tty_open()
2117 retval = tty->ops->open(tty, filp); in tty_open()
2120 filp->f_flags = saved_flags; in tty_open()
2128 tty_release(inode, filp); in tty_open()
2139 if (tty_hung_up_p(filp)) in tty_open()
2140 filp->f_op = &tty_fops; in tty_open()
2166 if (filp->f_mode & FMODE_READ) in tty_open()
2179 tty_free_file(filp); in tty_open()
2197 static unsigned int tty_poll(struct file *filp, poll_table *wait) in tty_poll() argument
2199 struct tty_struct *tty = file_tty(filp); in tty_poll()
2203 if (tty_paranoia_check(tty, file_inode(filp), "tty_poll")) in tty_poll()
2208 ret = ld->ops->poll(tty, filp, wait); in tty_poll()
2213 static int __tty_fasync(int fd, struct file *filp, int on) in __tty_fasync() argument
2215 struct tty_struct *tty = file_tty(filp); in __tty_fasync()
2220 if (tty_paranoia_check(tty, file_inode(filp), "tty_fasync")) in __tty_fasync()
2223 retval = fasync_helper(fd, filp, on, &tty->fasync); in __tty_fasync()
2248 __f_setown(filp, pid, type, 0); in __tty_fasync()
2256 static int tty_fasync(int fd, struct file *filp, int on) in tty_fasync() argument
2258 struct tty_struct *tty = file_tty(filp); in tty_fasync()
2262 retval = __tty_fasync(fd, filp, on); in tty_fasync()