Lines Matching refs:file

187  * file were attached to a persist device.
224 struct file *file;
765 static int tun_attach(struct tun_struct *tun, struct file *file,
769 struct tun_file *tfile = file->private_data;
1018 err = tun_attach(tun, tun->file, false, ifr->ifr_flags & IFF_NAPI,
1437 static __poll_t tun_chr_poll(struct file *file, poll_table *wait)
1439 struct tun_file *tfile = file->private_data;
1449 poll_wait(file, sk_sleep(sk), wait);
2046 struct file *file = iocb->ki_filp;
2047 struct tun_file *tfile = file->private_data;
2055 if ((file->f_flags & O_NONBLOCK) || (iocb->ki_flags & IOCB_NOWAIT))
2275 struct file *file = iocb->ki_filp;
2276 struct tun_file *tfile = file->private_data;
2284 if ((file->f_flags & O_NONBLOCK) || (iocb->ki_flags & IOCB_NOWAIT))
2740 static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
2743 struct tun_file *tfile = file->private_data;
2780 err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER,
2851 tun->file = file;
2970 static int tun_set_queue(struct file *file, struct ifreq *ifr)
2972 struct tun_file *tfile = file->private_data;
2987 ret = tun_attach(tun, file, false, tun->flags & IFF_NAPI,
3065 static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
3068 struct tun_file *tfile = file->private_data;
3098 return tun_set_queue(file, &ifr);
3116 ret = tun_set_iff(net, file, &ifr);
3391 static long tun_chr_ioctl(struct file *file,
3394 return __tun_chr_ioctl(file, cmd, arg, sizeof (struct ifreq));
3398 static long tun_chr_compat_ioctl(struct file *file,
3422 return __tun_chr_ioctl(file, cmd, arg, sizeof(struct compat_ifreq));
3426 static int tun_chr_fasync(int fd, struct file *file, int on)
3428 struct tun_file *tfile = file->private_data;
3431 if ((ret = fasync_helper(fd, file, on, &tfile->fasync)) < 0)
3435 __f_setown(file, task_pid(current), PIDTYPE_TGID, 0);
3444 static int tun_chr_open(struct inode *inode, struct file * file)
3465 tfile->socket.file = file;
3473 file->private_data = tfile;
3481 static int tun_chr_close(struct inode *inode, struct file *file)
3483 struct tun_file *tfile = file->private_data;
3491 static void tun_chr_show_fdinfo(struct seq_file *m, struct file *file)
3493 struct tun_file *tfile = file->private_data;
3738 /* Get an underlying socket object from tun file. Returns error unless file is
3741 * holding a reference to the file for as long as the socket is in use. */
3742 struct socket *tun_get_socket(struct file *file)
3745 if (file->f_op != &tun_fops)
3747 tfile = file->private_data;
3754 struct ptr_ring *tun_get_tx_ring(struct file *file)
3758 if (file->f_op != &tun_fops)
3760 tfile = file->private_data;