Lines Matching refs:mp

117 tmpfs_update_mtime_lazy(struct mount *mp)  in tmpfs_update_mtime_lazy()  argument
121 MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, tmpfs_update_mtime_lazy_filter, NULL) { in tmpfs_update_mtime_lazy()
130 tmpfs_update_mtime_all(struct mount *mp) in tmpfs_update_mtime_all() argument
134 if (VFS_TO_TMPFS(mp)->tm_nomtime) in tmpfs_update_mtime_all()
136 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { in tmpfs_update_mtime_all()
154 tmpfs_check_rw_maps_cb(struct mount *mp __unused, vm_map_t map __unused, in tmpfs_check_rw_maps_cb()
169 tmpfs_revoke_rw_maps_cb(struct mount *mp __unused, vm_map_t map, in tmpfs_revoke_rw_maps_cb()
188 tmpfs_all_rw_maps(struct mount *mp, bool (*cb)(struct mount *mp, vm_map_t, in tmpfs_all_rw_maps() argument
248 if (vp->v_mount != mp) { in tmpfs_all_rw_maps()
253 terminate = cb(mp, map, entry, cb_arg); in tmpfs_all_rw_maps()
272 tmpfs_check_rw_maps(struct mount *mp) in tmpfs_check_rw_maps() argument
277 tmpfs_all_rw_maps(mp, tmpfs_check_rw_maps_cb, &ca); in tmpfs_check_rw_maps()
282 tmpfs_rw_to_ro(struct mount *mp) in tmpfs_rw_to_ro() argument
287 forced = (mp->mnt_flag & MNT_FORCE) != 0; in tmpfs_rw_to_ro()
290 if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0) in tmpfs_rw_to_ro()
292 error = vfs_write_suspend_umnt(mp); in tmpfs_rw_to_ro()
295 if (!forced && tmpfs_check_rw_maps(mp)) { in tmpfs_rw_to_ro()
299 VFS_TO_TMPFS(mp)->tm_ronly = 1; in tmpfs_rw_to_ro()
300 MNT_ILOCK(mp); in tmpfs_rw_to_ro()
301 mp->mnt_flag |= MNT_RDONLY; in tmpfs_rw_to_ro()
302 MNT_IUNLOCK(mp); in tmpfs_rw_to_ro()
304 tmpfs_all_rw_maps(mp, tmpfs_revoke_rw_maps_cb, NULL); in tmpfs_rw_to_ro()
305 tmpfs_update_mtime_all(mp); in tmpfs_rw_to_ro()
306 error = vflush(mp, 0, flags, curthread); in tmpfs_rw_to_ro()
308 VFS_TO_TMPFS(mp)->tm_ronly = 0; in tmpfs_rw_to_ro()
309 MNT_ILOCK(mp); in tmpfs_rw_to_ro()
310 mp->mnt_flag &= ~MNT_RDONLY; in tmpfs_rw_to_ro()
311 MNT_IUNLOCK(mp); in tmpfs_rw_to_ro()
314 if (!tmpfs_check_rw_maps(mp)) in tmpfs_rw_to_ro()
318 vfs_write_resume(mp, 0); in tmpfs_rw_to_ro()
323 tmpfs_mount(struct mount *mp) in tmpfs_mount() argument
342 if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts)) in tmpfs_mount()
345 if (mp->mnt_flag & MNT_UPDATE) { in tmpfs_mount()
347 if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) in tmpfs_mount()
349 tmp = VFS_TO_TMPFS(mp); in tmpfs_mount()
350 if (vfs_getopt_size(mp->mnt_optnew, "size", &size_max) == 0) { in tmpfs_mount()
361 if (vfs_getopt_size(mp->mnt_optnew, "easize", &ea_max_size) == 0) { in tmpfs_mount()
364 if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) && in tmpfs_mount()
367 return (tmpfs_rw_to_ro(mp)); in tmpfs_mount()
368 } else if (!vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) && in tmpfs_mount()
372 MNT_ILOCK(mp); in tmpfs_mount()
373 mp->mnt_flag &= ~MNT_RDONLY; in tmpfs_mount()
374 MNT_IUNLOCK(mp); in tmpfs_mount()
376 tmp->tm_nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, in tmpfs_mount()
378 MNT_ILOCK(mp); in tmpfs_mount()
379 if ((mp->mnt_flag & MNT_UNION) == 0) { in tmpfs_mount()
380 mp->mnt_kern_flag |= MNTK_FPLOOKUP; in tmpfs_mount()
382 mp->mnt_kern_flag &= ~MNTK_FPLOOKUP; in tmpfs_mount()
384 MNT_IUNLOCK(mp); in tmpfs_mount()
388 vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); in tmpfs_mount()
389 error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); in tmpfs_mount()
390 VOP_UNLOCK(mp->mnt_vnodecovered); in tmpfs_mount()
394 if (mp->mnt_cred->cr_ruid != 0 || in tmpfs_mount()
395 vfs_scanopt(mp->mnt_optnew, "gid", "%d", &root_gid) != 1) in tmpfs_mount()
397 if (mp->mnt_cred->cr_ruid != 0 || in tmpfs_mount()
398 vfs_scanopt(mp->mnt_optnew, "uid", "%d", &root_uid) != 1) in tmpfs_mount()
400 if (mp->mnt_cred->cr_ruid != 0 || in tmpfs_mount()
401 vfs_scanopt(mp->mnt_optnew, "mode", "%ho", &root_mode) != 1) in tmpfs_mount()
403 if (vfs_getopt_size(mp->mnt_optnew, "inodes", &nodes_max) != 0) in tmpfs_mount()
405 if (vfs_getopt_size(mp->mnt_optnew, "size", &size_max) != 0) in tmpfs_mount()
407 if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0) in tmpfs_mount()
409 if (vfs_getopt_size(mp->mnt_optnew, "easize", &ea_max_size) != 0) in tmpfs_mount()
411 nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; in tmpfs_mount()
412 nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL, NULL) == 0; in tmpfs_mount()
413 pgread = vfs_getopt(mp->mnt_optnew, "pgread", NULL, NULL) == 0; in tmpfs_mount()
461 tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; in tmpfs_mount()
467 error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, in tmpfs_mount()
478 MNT_ILOCK(mp); in tmpfs_mount()
479 mp->mnt_flag |= MNT_LOCAL; in tmpfs_mount()
480 mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | in tmpfs_mount()
482 if (!nonc && (mp->mnt_flag & MNT_UNION) == 0) in tmpfs_mount()
483 mp->mnt_kern_flag |= MNTK_FPLOOKUP; in tmpfs_mount()
484 MNT_IUNLOCK(mp); in tmpfs_mount()
486 mp->mnt_data = tmp; in tmpfs_mount()
487 mp->mnt_stat.f_namemax = MAXNAMLEN; in tmpfs_mount()
488 vfs_getnewfsid(mp); in tmpfs_mount()
489 vfs_mountedfrom(mp, "tmpfs"); in tmpfs_mount()
496 tmpfs_unmount(struct mount *mp, int mntflags) in tmpfs_unmount() argument
503 tmp = VFS_TO_TMPFS(mp); in tmpfs_unmount()
506 error = vfs_write_suspend_umnt(mp); in tmpfs_unmount()
515 error = vflush(mp, 0, flags, curthread); in tmpfs_unmount()
517 vfs_write_resume(mp, VR_START_WRITE); in tmpfs_unmount()
520 MNT_ILOCK(mp); in tmpfs_unmount()
521 if (mp->mnt_nvnodelistsize == 0) { in tmpfs_unmount()
522 MNT_IUNLOCK(mp); in tmpfs_unmount()
525 MNT_IUNLOCK(mp); in tmpfs_unmount()
527 vfs_write_resume(mp, VR_START_WRITE); in tmpfs_unmount()
543 mp->mnt_data = NULL; in tmpfs_unmount()
545 vfs_write_resume(mp, VR_START_WRITE); in tmpfs_unmount()
575 tmpfs_root(struct mount *mp, int flags, struct vnode **vpp) in tmpfs_root() argument
579 error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp); in tmpfs_root()
586 tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, in tmpfs_fhtovp() argument
603 tmp = VFS_TO_TMPFS(mp); in tmpfs_fhtovp()
619 error = tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp); in tmpfs_fhtovp()
628 tmpfs_statfs(struct mount *mp, struct statfs *sbp) in tmpfs_statfs() argument
633 tmp = VFS_TO_TMPFS(mp); in tmpfs_statfs()
660 tmpfs_sync(struct mount *mp, int waitfor) in tmpfs_sync() argument
664 MNT_ILOCK(mp); in tmpfs_sync()
665 mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED; in tmpfs_sync()
666 MNT_IUNLOCK(mp); in tmpfs_sync()
668 tmpfs_update_mtime_lazy(mp); in tmpfs_sync()
713 db_print_tmpfs(struct mount *mp, struct tmpfs_mount *tmp) in db_print_tmpfs() argument
715 db_printf("mp %p (%s) tmp %p\n", mp, in db_print_tmpfs()
716 mp->mnt_stat.f_mntonname, tmp); in db_print_tmpfs()
731 struct mount *mp; in DB_SHOW_COMMAND() local
735 mp = (struct mount *)addr; in DB_SHOW_COMMAND()
736 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
737 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()
741 TAILQ_FOREACH(mp, &mountlist, mnt_list) { in DB_SHOW_COMMAND()
742 if (strcmp(mp->mnt_stat.f_fstypename, tmpfs_vfsconf.vfc_name) == in DB_SHOW_COMMAND()
744 tmp = VFS_TO_TMPFS(mp); in DB_SHOW_COMMAND()
745 db_print_tmpfs(mp, tmp); in DB_SHOW_COMMAND()