Lines Matching defs:tmp
322 struct tmpfs_mount *tmp;
343 tmp = VFS_TO_TMPFS(mp);
352 root_gid != tmp->tm_root->tn_gid)
355 root_uid != tmp->tm_root->tn_uid)
358 (root_mode & S_IFMT) != (tmp->tm_root->tn_mode & S_IFMT))
361 nodes_max != 0 && nodes_max != tmp->tm_nodes_max)
364 size_max != 0 && size_max != tmp->tm_size_max)
367 maxfilesize != 0 && maxfilesize != tmp->tm_maxfilesize)
369 if (tmp->tm_nonc !=
372 if (tmp->tm_pgread !=
380 tmp->tm_ea_memory_max = ea_max_size;
381 tmp->tm_nomtime = (vfs_getopt(opts, "nomtime", NULL, 0) == 0);
386 if (vfs_flagopt(opts, "ro", NULL, 0) && !tmp->tm_ronly) {
390 if (!vfs_flagopt(opts, "ro", NULL, 0) && tmp->tm_ronly) {
392 tmp->tm_ronly = 0;
402 if (!tmp->tm_nonc && (mp->mnt_flag & MNT_UNION) == 0) {
467 tmp = (struct tmpfs_mount *)malloc(sizeof(struct tmpfs_mount),
470 mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF);
471 tmp->tm_nodes_max = nodes_max;
472 tmp->tm_nodes_inuse = 0;
473 tmp->tm_ea_memory_inuse = 0;
474 tmp->tm_refcount = 1;
475 tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX;
476 tmp->tm_ea_memory_max = ea_max_size > 0 ?
478 LIST_INIT(&tmp->tm_nodes_used);
480 tmp->tm_size_max = size_max;
481 tmp->tm_pages_max = pages;
482 tmp->tm_pages_used = 0;
483 new_unrhdr64(&tmp->tm_ino_unr, 2);
484 tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
485 tmp->tm_nonc = nonc;
486 tmp->tm_nomtime = nomtime;
487 tmp->tm_pgread = pgread;
490 error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid,
494 free(tmp, M_TMPFSMNT);
499 tmp->tm_root = root;
509 mp->mnt_data = tmp;
521 struct tmpfs_mount *tmp;
526 tmp = VFS_TO_TMPFS(mp);
555 TMPFS_LOCK(tmp);
556 while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) {
559 tmpfs_dir_destroy(tmp, node);
560 if (tmpfs_free_node_locked(tmp, node, true))
561 TMPFS_LOCK(tmp);
567 tmpfs_free_tmp(tmp);
574 tmpfs_free_tmp(struct tmpfs_mount *tmp)
576 TMPFS_MP_ASSERT_LOCKED(tmp);
577 MPASS(tmp->tm_refcount > 0);
579 tmp->tm_refcount--;
580 if (tmp->tm_refcount > 0) {
581 TMPFS_UNLOCK(tmp);
584 TMPFS_UNLOCK(tmp);
586 mtx_destroy(&tmp->tm_allnode_lock);
588 * We cannot assert that tmp->tm_pages_used == 0 there,
592 MPASS(tmp->tm_nodes_inuse == 0);
594 free(tmp, M_TMPFSMNT);
613 struct tmpfs_mount *tmp;
622 tmp = VFS_TO_TMPFS(mp);
624 if (tfd->tfd_id >= tmp->tm_nodes_max)
627 TMPFS_LOCK(tmp);
628 LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) {
635 TMPFS_UNLOCK(tmp);
639 tmpfs_free_node(tmp, node);
649 struct tmpfs_mount *tmp;
652 tmp = VFS_TO_TMPFS(mp);
657 used = tmpfs_pages_used(tmp);
658 if (tmp->tm_pages_max != ULONG_MAX)
659 sbp->f_blocks = tmp->tm_pages_max;
667 used = tmp->tm_nodes_inuse;
668 sbp->f_files = tmp->tm_nodes_max;
673 /* sbp->f_owner = tmp->tn_uid; */
732 db_print_tmpfs(struct mount *mp, struct tmpfs_mount *tmp)
734 db_printf("mp %p (%s) tmp %p\n", mp,
735 mp->mnt_stat.f_mntonname, tmp);
740 (uintmax_t)tmp->tm_size_max, tmp->tm_pages_max, tmp->tm_pages_used,
741 (uintmax_t)tmp->tm_nodes_max, (uintmax_t)tmp->tm_nodes_inuse,
742 (uintmax_t)tmp->tm_ea_memory_inuse, (uintmax_t)tmp->tm_refcount,
743 (uintmax_t)tmp->tm_maxfilesize,
744 tmp->tm_ronly ? 'o' : 'w', tmp->tm_nonc ? "no" : "",
745 tmp->tm_nomtime ? "no" : "");
751 struct tmpfs_mount *tmp;
755 tmp = VFS_TO_TMPFS(mp);
756 db_print_tmpfs(mp, tmp);
763 tmp = VFS_TO_TMPFS(mp);
764 db_print_tmpfs(mp, tmp);