Lines Matching refs:tmp
326 struct tmpfs_mount *tmp; in tmpfs_mount() local
348 tmp = VFS_TO_TMPFS(mp); in tmpfs_mount()
357 if (size_max != tmp->tm_size_max) in tmpfs_mount()
361 tmp->tm_ea_memory_max = ea_max_size; in tmpfs_mount()
364 !tmp->tm_ronly) { in tmpfs_mount()
368 tmp->tm_ronly) { in tmpfs_mount()
370 tmp->tm_ronly = 0; in tmpfs_mount()
375 tmp->tm_nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, in tmpfs_mount()
443 tmp = (struct tmpfs_mount *)malloc(sizeof(struct tmpfs_mount), in tmpfs_mount()
446 mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF); in tmpfs_mount()
447 tmp->tm_nodes_max = nodes_max; in tmpfs_mount()
448 tmp->tm_nodes_inuse = 0; in tmpfs_mount()
449 tmp->tm_ea_memory_inuse = 0; in tmpfs_mount()
450 tmp->tm_refcount = 1; in tmpfs_mount()
451 tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX; in tmpfs_mount()
452 tmp->tm_ea_memory_max = ea_max_size > 0 ? in tmpfs_mount()
454 LIST_INIT(&tmp->tm_nodes_used); in tmpfs_mount()
456 tmp->tm_size_max = size_max; in tmpfs_mount()
457 tmp->tm_pages_max = pages; in tmpfs_mount()
458 tmp->tm_pages_used = 0; in tmpfs_mount()
459 new_unrhdr64(&tmp->tm_ino_unr, 2); in tmpfs_mount()
460 tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; in tmpfs_mount()
461 tmp->tm_nonc = nonc; in tmpfs_mount()
462 tmp->tm_nomtime = nomtime; in tmpfs_mount()
463 tmp->tm_pgread = pgread; in tmpfs_mount()
466 error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, in tmpfs_mount()
470 free(tmp, M_TMPFSMNT); in tmpfs_mount()
475 tmp->tm_root = root; in tmpfs_mount()
485 mp->mnt_data = tmp; in tmpfs_mount()
497 struct tmpfs_mount *tmp; in tmpfs_unmount() local
502 tmp = VFS_TO_TMPFS(mp); in tmpfs_unmount()
531 TMPFS_LOCK(tmp); in tmpfs_unmount()
532 while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) { in tmpfs_unmount()
535 tmpfs_dir_destroy(tmp, node); in tmpfs_unmount()
536 if (tmpfs_free_node_locked(tmp, node, true)) in tmpfs_unmount()
537 TMPFS_LOCK(tmp); in tmpfs_unmount()
543 tmpfs_free_tmp(tmp); in tmpfs_unmount()
550 tmpfs_free_tmp(struct tmpfs_mount *tmp) in tmpfs_free_tmp() argument
552 TMPFS_MP_ASSERT_LOCKED(tmp); in tmpfs_free_tmp()
553 MPASS(tmp->tm_refcount > 0); in tmpfs_free_tmp()
555 tmp->tm_refcount--; in tmpfs_free_tmp()
556 if (tmp->tm_refcount > 0) { in tmpfs_free_tmp()
557 TMPFS_UNLOCK(tmp); in tmpfs_free_tmp()
560 TMPFS_UNLOCK(tmp); in tmpfs_free_tmp()
562 mtx_destroy(&tmp->tm_allnode_lock); in tmpfs_free_tmp()
568 MPASS(tmp->tm_nodes_inuse == 0); in tmpfs_free_tmp()
570 free(tmp, M_TMPFSMNT); in tmpfs_free_tmp()
589 struct tmpfs_mount *tmp; in tmpfs_fhtovp() local
598 tmp = VFS_TO_TMPFS(mp); in tmpfs_fhtovp()
600 if (tfd->tfd_id >= tmp->tm_nodes_max) in tmpfs_fhtovp()
603 TMPFS_LOCK(tmp); in tmpfs_fhtovp()
604 LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) { in tmpfs_fhtovp()
611 TMPFS_UNLOCK(tmp); in tmpfs_fhtovp()
615 tmpfs_free_node(tmp, node); in tmpfs_fhtovp()
625 struct tmpfs_mount *tmp; in tmpfs_statfs() local
628 tmp = VFS_TO_TMPFS(mp); in tmpfs_statfs()
633 used = tmpfs_pages_used(tmp); in tmpfs_statfs()
634 if (tmp->tm_pages_max != ULONG_MAX) in tmpfs_statfs()
635 sbp->f_blocks = tmp->tm_pages_max; in tmpfs_statfs()
643 used = tmp->tm_nodes_inuse; in tmpfs_statfs()
644 sbp->f_files = tmp->tm_nodes_max; in tmpfs_statfs()
708 db_print_tmpfs(struct mount *mp, struct tmpfs_mount *tmp) in db_print_tmpfs() argument
711 mp->mnt_stat.f_mntonname, tmp); in db_print_tmpfs()
716 (uintmax_t)tmp->tm_size_max, tmp->tm_pages_max, tmp->tm_pages_used, in db_print_tmpfs()
717 (uintmax_t)tmp->tm_nodes_max, (uintmax_t)tmp->tm_nodes_inuse, in db_print_tmpfs()
718 (uintmax_t)tmp->tm_ea_memory_inuse, (uintmax_t)tmp->tm_refcount, in db_print_tmpfs()
719 (uintmax_t)tmp->tm_maxfilesize, in db_print_tmpfs()
720 tmp->tm_ronly ? 'o' : 'w', tmp->tm_nonc ? "no" : "", in db_print_tmpfs()
721 tmp->tm_nomtime ? "no" : ""); in db_print_tmpfs()
727 struct tmpfs_mount *tmp; in DB_SHOW_COMMAND() local
731 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
732 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()
739 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
740 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()