Lines Matching refs:tmp
327 struct tmpfs_mount *tmp; in tmpfs_mount() local
349 tmp = VFS_TO_TMPFS(mp); in tmpfs_mount()
358 if (size_max != tmp->tm_size_max) in tmpfs_mount()
362 tmp->tm_ea_memory_max = ea_max_size; in tmpfs_mount()
365 !tmp->tm_ronly) { in tmpfs_mount()
369 tmp->tm_ronly) { in tmpfs_mount()
371 tmp->tm_ronly = 0; in tmpfs_mount()
376 tmp->tm_nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, in tmpfs_mount()
444 tmp = (struct tmpfs_mount *)malloc(sizeof(struct tmpfs_mount), in tmpfs_mount()
447 mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF); in tmpfs_mount()
448 tmp->tm_nodes_max = nodes_max; in tmpfs_mount()
449 tmp->tm_nodes_inuse = 0; in tmpfs_mount()
450 tmp->tm_ea_memory_inuse = 0; in tmpfs_mount()
451 tmp->tm_refcount = 1; in tmpfs_mount()
452 tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX; in tmpfs_mount()
453 tmp->tm_ea_memory_max = ea_max_size > 0 ? in tmpfs_mount()
455 LIST_INIT(&tmp->tm_nodes_used); in tmpfs_mount()
457 tmp->tm_size_max = size_max; in tmpfs_mount()
458 tmp->tm_pages_max = pages; in tmpfs_mount()
459 tmp->tm_pages_used = 0; in tmpfs_mount()
460 new_unrhdr64(&tmp->tm_ino_unr, 2); in tmpfs_mount()
461 tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; in tmpfs_mount()
462 tmp->tm_nonc = nonc; in tmpfs_mount()
463 tmp->tm_nomtime = nomtime; in tmpfs_mount()
464 tmp->tm_pgread = pgread; in tmpfs_mount()
467 error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, in tmpfs_mount()
471 free(tmp, M_TMPFSMNT); in tmpfs_mount()
476 tmp->tm_root = root; in tmpfs_mount()
486 mp->mnt_data = tmp; in tmpfs_mount()
498 struct tmpfs_mount *tmp; in tmpfs_unmount() local
503 tmp = VFS_TO_TMPFS(mp); in tmpfs_unmount()
532 TMPFS_LOCK(tmp); in tmpfs_unmount()
533 while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) { in tmpfs_unmount()
536 tmpfs_dir_destroy(tmp, node); in tmpfs_unmount()
537 if (tmpfs_free_node_locked(tmp, node, true)) in tmpfs_unmount()
538 TMPFS_LOCK(tmp); in tmpfs_unmount()
544 tmpfs_free_tmp(tmp); in tmpfs_unmount()
551 tmpfs_free_tmp(struct tmpfs_mount *tmp) in tmpfs_free_tmp() argument
553 TMPFS_MP_ASSERT_LOCKED(tmp); in tmpfs_free_tmp()
554 MPASS(tmp->tm_refcount > 0); in tmpfs_free_tmp()
556 tmp->tm_refcount--; in tmpfs_free_tmp()
557 if (tmp->tm_refcount > 0) { in tmpfs_free_tmp()
558 TMPFS_UNLOCK(tmp); in tmpfs_free_tmp()
561 TMPFS_UNLOCK(tmp); in tmpfs_free_tmp()
563 mtx_destroy(&tmp->tm_allnode_lock); in tmpfs_free_tmp()
569 MPASS(tmp->tm_nodes_inuse == 0); in tmpfs_free_tmp()
571 free(tmp, M_TMPFSMNT); in tmpfs_free_tmp()
590 struct tmpfs_mount *tmp; in tmpfs_fhtovp() local
603 tmp = VFS_TO_TMPFS(mp); in tmpfs_fhtovp()
605 if (tfd.tfd_id >= tmp->tm_nodes_max) in tmpfs_fhtovp()
608 TMPFS_LOCK(tmp); in tmpfs_fhtovp()
609 LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) { in tmpfs_fhtovp()
616 TMPFS_UNLOCK(tmp); in tmpfs_fhtovp()
620 tmpfs_free_node(tmp, node); in tmpfs_fhtovp()
630 struct tmpfs_mount *tmp; in tmpfs_statfs() local
633 tmp = VFS_TO_TMPFS(mp); in tmpfs_statfs()
638 used = tmpfs_pages_used(tmp); in tmpfs_statfs()
639 if (tmp->tm_pages_max != ULONG_MAX) in tmpfs_statfs()
640 sbp->f_blocks = tmp->tm_pages_max; in tmpfs_statfs()
648 used = tmp->tm_nodes_inuse; in tmpfs_statfs()
649 sbp->f_files = tmp->tm_nodes_max; in tmpfs_statfs()
713 db_print_tmpfs(struct mount *mp, struct tmpfs_mount *tmp) in db_print_tmpfs() argument
716 mp->mnt_stat.f_mntonname, tmp); in db_print_tmpfs()
721 (uintmax_t)tmp->tm_size_max, tmp->tm_pages_max, tmp->tm_pages_used, in db_print_tmpfs()
722 (uintmax_t)tmp->tm_nodes_max, (uintmax_t)tmp->tm_nodes_inuse, in db_print_tmpfs()
723 (uintmax_t)tmp->tm_ea_memory_inuse, (uintmax_t)tmp->tm_refcount, in db_print_tmpfs()
724 (uintmax_t)tmp->tm_maxfilesize, in db_print_tmpfs()
725 tmp->tm_ronly ? 'o' : 'w', tmp->tm_nonc ? "no" : "", in db_print_tmpfs()
726 tmp->tm_nomtime ? "no" : ""); in db_print_tmpfs()
732 struct tmpfs_mount *tmp; in DB_SHOW_COMMAND() local
736 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
737 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()
744 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
745 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()