Lines Matching defs:tfile
102 struct tun_file *tfile;
133 struct tun_file *tfile = file->private_data;
141 if (tfile->tun)
145 if (tun->tfile)
149 tfile->tun = tun;
150 tun->tfile = tfile;
155 atomic_inc(&tfile->count);
167 tun->tfile = NULL;
185 static struct tun_struct *__tun_get(struct tun_file *tfile)
189 if (atomic_inc_not_zero(&tfile->count))
190 tun = tfile->tun;
202 struct tun_file *tfile = tun->tfile;
204 if (atomic_dec_and_test(&tfile->count))
205 tun_detach(tfile->tun);
341 struct tun_file *tfile = tun->tfile;
345 if (tfile) {
347 if (atomic_dec_and_test(&tfile->count))
381 if (!tun->tfile)
507 struct tun_file *tfile = file->private_data;
508 struct tun_struct *tun = __tun_get(tfile);
846 struct tun_file *tfile = file->private_data;
847 struct tun_struct *tun = __tun_get(tfile);
1205 struct tun_file *tfile = file->private_data;
1229 tun = __tun_get(tfile);
1233 ret = tun_set_iff(tfile->net, file, &ifr);
1471 struct tun_file *tfile;
1475 tfile = kmalloc(sizeof(*tfile), GFP_KERNEL);
1476 if (!tfile)
1478 atomic_set(&tfile->count, 0);
1479 tfile->tun = NULL;
1480 tfile->net = get_net(current->nsproxy->net_ns);
1481 file->private_data = tfile;
1487 struct tun_file *tfile = file->private_data;
1490 tun = __tun_get(tfile);
1507 tun = tfile->tun;
1511 put_net(tfile->net);
1512 kfree(tfile);