Lines Matching full:mp
116 tmpfs_update_mtime_lazy(struct mount *mp) in tmpfs_update_mtime_lazy() argument
120 MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, tmpfs_update_mtime_lazy_filter, NULL) { in tmpfs_update_mtime_lazy()
129 tmpfs_update_mtime_all(struct mount *mp) in tmpfs_update_mtime_all() argument
133 if (VFS_TO_TMPFS(mp)->tm_nomtime) in tmpfs_update_mtime_all()
135 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { in tmpfs_update_mtime_all()
153 tmpfs_check_rw_maps_cb(struct mount *mp __unused, vm_map_t map __unused, in tmpfs_check_rw_maps_cb()
168 tmpfs_revoke_rw_maps_cb(struct mount *mp __unused, vm_map_t map, in tmpfs_revoke_rw_maps_cb()
187 tmpfs_all_rw_maps(struct mount *mp, bool (*cb)(struct mount *mp, vm_map_t, in tmpfs_all_rw_maps() argument
247 if (vp->v_mount != mp) { in tmpfs_all_rw_maps()
252 terminate = cb(mp, map, entry, cb_arg); in tmpfs_all_rw_maps()
271 tmpfs_check_rw_maps(struct mount *mp) in tmpfs_check_rw_maps() argument
276 tmpfs_all_rw_maps(mp, tmpfs_check_rw_maps_cb, &ca); in tmpfs_check_rw_maps()
281 tmpfs_rw_to_ro(struct mount *mp) in tmpfs_rw_to_ro() argument
286 forced = (mp->mnt_flag & MNT_FORCE) != 0; in tmpfs_rw_to_ro()
289 if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0) in tmpfs_rw_to_ro()
291 error = vfs_write_suspend_umnt(mp); in tmpfs_rw_to_ro()
294 if (!forced && tmpfs_check_rw_maps(mp)) { in tmpfs_rw_to_ro()
298 VFS_TO_TMPFS(mp)->tm_ronly = 1; in tmpfs_rw_to_ro()
299 MNT_ILOCK(mp); in tmpfs_rw_to_ro()
300 mp->mnt_flag |= MNT_RDONLY; in tmpfs_rw_to_ro()
301 MNT_IUNLOCK(mp); in tmpfs_rw_to_ro()
303 tmpfs_all_rw_maps(mp, tmpfs_revoke_rw_maps_cb, NULL); in tmpfs_rw_to_ro()
304 tmpfs_update_mtime_all(mp); in tmpfs_rw_to_ro()
305 error = vflush(mp, 0, flags, curthread); in tmpfs_rw_to_ro()
307 VFS_TO_TMPFS(mp)->tm_ronly = 0; in tmpfs_rw_to_ro()
308 MNT_ILOCK(mp); in tmpfs_rw_to_ro()
309 mp->mnt_flag &= ~MNT_RDONLY; in tmpfs_rw_to_ro()
310 MNT_IUNLOCK(mp); in tmpfs_rw_to_ro()
313 if (!tmpfs_check_rw_maps(mp)) in tmpfs_rw_to_ro()
317 vfs_write_resume(mp, 0); in tmpfs_rw_to_ro()
322 tmpfs_mount(struct mount *mp) in tmpfs_mount() argument
341 if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts)) in tmpfs_mount()
344 if (mp->mnt_flag & MNT_UPDATE) { in tmpfs_mount()
346 if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) in tmpfs_mount()
348 tmp = VFS_TO_TMPFS(mp); in tmpfs_mount()
349 if (vfs_getopt_size(mp->mnt_optnew, "size", &size_max) == 0) { in tmpfs_mount()
360 if (vfs_getopt_size(mp->mnt_optnew, "easize", &ea_max_size) == 0) { in tmpfs_mount()
363 if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) && in tmpfs_mount()
366 return (tmpfs_rw_to_ro(mp)); in tmpfs_mount()
367 } else if (!vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) && in tmpfs_mount()
371 MNT_ILOCK(mp); in tmpfs_mount()
372 mp->mnt_flag &= ~MNT_RDONLY; in tmpfs_mount()
373 MNT_IUNLOCK(mp); in tmpfs_mount()
375 tmp->tm_nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, in tmpfs_mount()
377 MNT_ILOCK(mp); in tmpfs_mount()
378 if ((mp->mnt_flag & MNT_UNION) == 0) { in tmpfs_mount()
379 mp->mnt_kern_flag |= MNTK_FPLOOKUP; in tmpfs_mount()
381 mp->mnt_kern_flag &= ~MNTK_FPLOOKUP; in tmpfs_mount()
383 MNT_IUNLOCK(mp); in tmpfs_mount()
387 vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); in tmpfs_mount()
388 error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); in tmpfs_mount()
389 VOP_UNLOCK(mp->mnt_vnodecovered); in tmpfs_mount()
393 if (mp->mnt_cred->cr_ruid != 0 || in tmpfs_mount()
394 vfs_scanopt(mp->mnt_optnew, "gid", "%d", &root_gid) != 1) in tmpfs_mount()
396 if (mp->mnt_cred->cr_ruid != 0 || in tmpfs_mount()
397 vfs_scanopt(mp->mnt_optnew, "uid", "%d", &root_uid) != 1) in tmpfs_mount()
399 if (mp->mnt_cred->cr_ruid != 0 || in tmpfs_mount()
400 vfs_scanopt(mp->mnt_optnew, "mode", "%ho", &root_mode) != 1) in tmpfs_mount()
402 if (vfs_getopt_size(mp->mnt_optnew, "inodes", &nodes_max) != 0) in tmpfs_mount()
404 if (vfs_getopt_size(mp->mnt_optnew, "size", &size_max) != 0) in tmpfs_mount()
406 if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0) in tmpfs_mount()
408 if (vfs_getopt_size(mp->mnt_optnew, "easize", &ea_max_size) != 0) in tmpfs_mount()
410 nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; in tmpfs_mount()
411 nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, NULL) == 0; in tmpfs_mount()
412 pgread = vfs_getopt(mp->mnt_optnew, "pgread", NULL, NULL) == 0; in tmpfs_mount()
460 tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; in tmpfs_mount()
466 error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, in tmpfs_mount()
477 MNT_ILOCK(mp); in tmpfs_mount()
478 mp->mnt_flag |= MNT_LOCAL; in tmpfs_mount()
479 mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | in tmpfs_mount()
481 if (!nonc && (mp->mnt_flag & MNT_UNION) == 0) in tmpfs_mount()
482 mp->mnt_kern_flag |= MNTK_FPLOOKUP; in tmpfs_mount()
483 MNT_IUNLOCK(mp); in tmpfs_mount()
485 mp->mnt_data = tmp; in tmpfs_mount()
486 mp->mnt_stat.f_namemax = MAXNAMLEN; in tmpfs_mount()
487 vfs_getnewfsid(mp); in tmpfs_mount()
488 vfs_mountedfrom(mp, "tmpfs"); in tmpfs_mount()
495 tmpfs_unmount(struct mount *mp, int mntflags) in tmpfs_unmount() argument
502 tmp = VFS_TO_TMPFS(mp); in tmpfs_unmount()
505 error = vfs_write_suspend_umnt(mp); in tmpfs_unmount()
514 error = vflush(mp, 0, flags, curthread); in tmpfs_unmount()
516 vfs_write_resume(mp, VR_START_WRITE); in tmpfs_unmount()
519 MNT_ILOCK(mp); in tmpfs_unmount()
520 if (mp->mnt_nvnodelistsize == 0) { in tmpfs_unmount()
521 MNT_IUNLOCK(mp); in tmpfs_unmount()
524 MNT_IUNLOCK(mp); in tmpfs_unmount()
526 vfs_write_resume(mp, VR_START_WRITE); in tmpfs_unmount()
542 mp->mnt_data = NULL; in tmpfs_unmount()
544 vfs_write_resume(mp, VR_START_WRITE); in tmpfs_unmount()
574 tmpfs_root(struct mount *mp, int flags, struct vnode **vpp) in tmpfs_root() argument
578 error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp); in tmpfs_root()
585 tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, in tmpfs_fhtovp() argument
598 tmp = VFS_TO_TMPFS(mp); in tmpfs_fhtovp()
614 error = tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp); in tmpfs_fhtovp()
623 tmpfs_statfs(struct mount *mp, struct statfs *sbp) in tmpfs_statfs() argument
628 tmp = VFS_TO_TMPFS(mp); in tmpfs_statfs()
655 tmpfs_sync(struct mount *mp, int waitfor) in tmpfs_sync() argument
659 MNT_ILOCK(mp); in tmpfs_sync()
660 mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED; in tmpfs_sync()
661 MNT_IUNLOCK(mp); in tmpfs_sync()
663 tmpfs_update_mtime_lazy(mp); in tmpfs_sync()
708 db_print_tmpfs(struct mount *mp, struct tmpfs_mount *tmp) in db_print_tmpfs() argument
710 db_printf("mp %p (%s) tmp %p\n", mp, in db_print_tmpfs()
711 mp->mnt_stat.f_mntonname, tmp); in db_print_tmpfs()
726 struct mount *mp; in DB_SHOW_COMMAND() local
730 mp = (struct mount *)addr; in DB_SHOW_COMMAND()
731 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
732 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()
736 TAILQ_FOREACH(mp, &mountlist, mnt_list) { in DB_SHOW_COMMAND()
737 if (strcmp(mp->mnt_stat.f_fstypename, tmpfs_vfsconf.vfc_name) == in DB_SHOW_COMMAND()
739 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
740 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()