Lines Matching full:mp

87 static int	ffs_sync_lazy(struct mount *mp);
239 ffs_check_blkno(struct mount *mp, ino_t inum, ufs2_daddr_t daddr, int blksize)
246 KASSERT((mp->mnt_flag & MNT_UNTRUSTED) != 0,
248 ump = VFSTOUFS(mp);
275 "number %jd\n", mp->mnt_stat.f_mntonname, inum, daddr);
347 ffs_mount(struct mount *mp)
362 if (vfs_filteropt(mp->mnt_optnew, ffs_opts))
377 vfs_deleteopt(mp->mnt_optnew, "groupquota");
378 vfs_deleteopt(mp->mnt_optnew, "userquota");
380 fspec = vfs_getopts(mp->mnt_optnew, "from", &error);
385 if (vfs_getopt(mp->mnt_optnew, "untrusted", NULL, NULL) == 0)
388 if (vfs_getopt(mp->mnt_optnew, "acls", NULL, NULL) == 0)
391 if (vfs_getopt(mp->mnt_optnew, "snapshot", NULL, NULL) == 0) {
397 vfs_deleteopt(mp->mnt_optnew, "snapshot");
398 vfs_deleteopt(mp->mnt_opt, "snapshot");
401 if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) {
403 vfs_mount_error(mp,
411 MNT_ILOCK(mp);
412 mp->mnt_kern_flag &= ~MNTK_FPLOOKUP;
413 mp->mnt_flag |= mntorflags;
414 MNT_IUNLOCK(mp);
419 if (mp->mnt_flag & MNT_SNAPSHOT) {
420 if ((mp->mnt_flag & MNT_UPDATE) == 0)
422 return (ffs_snapshot(mp, fspec));
428 if (mp->mnt_flag & MNT_UPDATE)
429 vfs_unbusy(mp);
437 if ((mp->mnt_flag & MNT_UPDATE) != 0) {
440 * update busies mp before setting MNT_UPDATE. We
444 error1 = vfs_busy(mp, MBF_NOWAIT);
460 if ((mp->mnt_flag & MNT_RDONLY) == 0)
478 if ((mp->mnt_flag & MNT_UPDATE) == 0) {
479 if ((error = ffs_mountfs(ndp.ni_vp, mp, td)) != 0) {
488 ump = VFSTOUFS(mp);
503 vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) {
507 if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0)
509 error = vfs_write_suspend_umnt(mp);
514 if (MOUNTEDSOFTDEP(mp)) {
515 MNT_ILOCK(mp);
516 mp->mnt_flag &= ~MNT_SOFTDEP;
517 MNT_IUNLOCK(mp);
527 if (mp->mnt_flag & MNT_FORCE)
530 error = softdep_flushfiles(mp, flags, td);
532 error = ffs_flushfiles(mp, flags, td);
537 MNT_ILOCK(mp);
538 mp->mnt_flag |= MNT_SOFTDEP;
539 MNT_IUNLOCK(mp);
541 vfs_write_resume(mp, 0);
560 MNT_ILOCK(mp);
561 mp->mnt_flag |= MNT_SOFTDEP;
562 MNT_IUNLOCK(mp);
564 vfs_write_resume(mp, 0);
568 softdep_unmount(mp);
575 MNT_ILOCK(mp);
576 mp->mnt_flag |= MNT_RDONLY;
577 MNT_IUNLOCK(mp);
582 vfs_write_resume(mp, 0);
584 if ((mp->mnt_flag & MNT_RELOAD) &&
585 (error = ffs_reload(mp, 0)) != 0) {
592 !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) {
609 if ((mp->mnt_flag & MNT_FORCE) ||
615 mp->mnt_stat.f_mntonname);
617 vfs_mount_error(mp,
619 mp->mnt_stat.f_mntonname,
635 if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0)
637 error = vfs_write_suspend_umnt(mp);
641 MNT_ILOCK(mp);
643 if (MOUNTEDSOFTDEP(mp) && (mp->mnt_flag &
646 mp->mnt_flag &= ~saved_mnt_flag;
647 MNT_IUNLOCK(mp);
651 (error = softdep_mount(devvp, mp, fs, td->td_ucred))){
653 MNT_ILOCK(mp);
654 mp->mnt_flag |= saved_mnt_flag;
655 MNT_IUNLOCK(mp);
656 vfs_write_resume(mp, 0);
663 softdep_unmount(mp);
664 MNT_ILOCK(mp);
665 mp->mnt_flag |= saved_mnt_flag;
666 MNT_IUNLOCK(mp);
667 vfs_write_resume(mp, 0);
671 ffs_snapshot_mount(mp);
672 vfs_write_resume(mp, 0);
681 if (MOUNTEDSOFTDEP(mp)) {
683 MNT_ILOCK(mp);
684 mp->mnt_flag &= ~MNT_ASYNC;
685 MNT_IUNLOCK(mp);
692 MNT_ILOCK(mp);
693 mp->mnt_flag |= MNT_ACLS;
694 MNT_IUNLOCK(mp);
699 MNT_ILOCK(mp);
700 mp->mnt_flag |= MNT_NFS4ACLS;
701 MNT_IUNLOCK(mp);
706 MNT_ILOCK(mp);
710 if ((mp->mnt_kern_flag & MNTK_FPLOOKUP) != 0)
711 panic("MNTK_FPLOOKUP set on mount %p when it should not be", mp);
712 if ((mp->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS | MNT_UNION)) == 0)
713 mp->mnt_kern_flag |= MNTK_FPLOOKUP;
714 MNT_IUNLOCK(mp);
716 vfs_mountedfrom(mp, fspec);
757 ffs_reload(struct mount *mp, int flags)
766 ump = VFSTOUFS(mp);
768 MNT_ILOCK(mp);
769 if ((mp->mnt_flag & MNT_RDONLY) == 0 && (flags & FFSR_FORCE) == 0) {
770 MNT_IUNLOCK(mp);
773 MNT_IUNLOCK(mp);
778 devvp = VFSTOUFS(mp)->um_devvp;
794 fs = VFSTOUFS(mp)->um_fs;
799 fs = VFSTOUFS(mp)->um_fs = newfs;
805 "files %d\n", mp->mnt_stat.f_mntonname,
816 MNT_ILOCK(mp);
817 mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2);
818 wakeup(&mp->mnt_flag);
819 MNT_IUNLOCK(mp);
823 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {
835 MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp);
849 MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp);
855 MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp);
869 ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td)
884 ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
886 devvp = mntfs_allocvp(mp, odevvp);
891 (uintptr_t)mp) == 0) {
910 mp->mnt_iosize_max = dev->si_iosize_max;
911 if (mp->mnt_iosize_max > maxphys)
912 mp->mnt_iosize_max = maxphys;
915 vfs_mount_error(mp,
921 if ((mp->mnt_flag & (MNT_ROOTFS | MNT_FORCE)) != 0)
931 if (ronly || (mp->mnt_flag & MNT_FORCE) ||
935 mp->mnt_stat.f_mntonname);
937 vfs_mount_error(mp, "R/W mount on %s denied. "
939 mp->mnt_stat.f_mntonname,
946 (mp->mnt_flag & MNT_FORCE)) {
948 mp->mnt_stat.f_mntonname,
957 "files %d\n", mp->mnt_stat.f_mntonname,
968 mp->mnt_gjprovider = malloc((uint64_t)len, M_UFSMNT, M_WAITOK);
970 mp->mnt_gjprovider) == 0) {
971 mp->mnt_gjprovider = realloc(mp->mnt_gjprovider, len,
973 MNT_ILOCK(mp);
974 mp->mnt_flag |= MNT_GJOURNAL;
975 MNT_IUNLOCK(mp);
977 if ((mp->mnt_flag & MNT_RDONLY) == 0)
980 mp->mnt_stat.f_mntonname);
981 free(mp->mnt_gjprovider, M_UFSMNT);
982 mp->mnt_gjprovider = NULL;
986 "UFS_GJOURNAL support\n", mp->mnt_stat.f_mntonname);
989 mp->mnt_gjprovider = NULL;
1010 if ((mp->mnt_flag & MNT_UNTRUSTED) != 0)
1018 mp->mnt_data = ump;
1019 mp->mnt_stat.f_fsid.val[0] = fs->fs_id[0];
1020 mp->mnt_stat.f_fsid.val[1] = fs->fs_id[1];
1023 (nmp = vfs_getvfs(&mp->mnt_stat.f_fsid))) {
1026 vfs_getnewfsid(mp);
1030 MNT_ILOCK(mp);
1031 mp->mnt_flag |= MNT_LOCAL;
1032 MNT_IUNLOCK(mp);
1035 MNT_ILOCK(mp);
1036 mp->mnt_flag |= MNT_MULTILABEL;
1037 MNT_IUNLOCK(mp);
1040 "no MAC support\n", mp->mnt_stat.f_mntonname);
1045 MNT_ILOCK(mp);
1047 if (mp->mnt_flag & MNT_NFS4ACLS)
1050 mp->mnt_stat.f_mntonname);
1051 mp->mnt_flag &= ~MNT_NFS4ACLS;
1052 mp->mnt_flag |= MNT_ACLS;
1054 MNT_IUNLOCK(mp);
1057 mp->mnt_stat.f_mntonname);
1062 MNT_ILOCK(mp);
1064 if (mp->mnt_flag & MNT_ACLS)
1067 mp->mnt_stat.f_mntonname);
1068 mp->mnt_flag &= ~MNT_ACLS;
1069 mp->mnt_flag |= MNT_NFS4ACLS;
1071 MNT_IUNLOCK(mp);
1074 "ACLs support\n", mp->mnt_stat.f_mntonname);
1086 mp->mnt_stat.f_mntonname);
1090 mp->mnt_stat.f_mntonname);
1096 "%s trim", mp->mnt_stat.f_mntonname);
1108 ump->um_mountp = mp;
1124 strlcpy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname, MAXMNTLEN);
1125 mp->mnt_stat.f_iosize = fs->fs_bsize;
1127 if (mp->mnt_flag & MNT_ROOTFS) {
1133 mp->mnt_time = fs->fs_time;
1139 (error = softdep_mount(devvp, mp, fs, cred)) != 0) {
1140 ffs_flushfiles(mp, FORCECLOSE, td);
1144 ffs_snapshot_mount(mp);
1152 MNT_ILOCK(mp);
1153 mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED |
1155 MNT_IUNLOCK(mp);
1168 (void) ufs_extattr_autostart(mp, td);
1186 if (mp->mnt_gjprovider != NULL) {
1187 free(mp->mnt_gjprovider, M_UFSMNT);
1188 mp->mnt_gjprovider = NULL;
1192 mp->mnt_data = NULL;
1228 ffs_unmount(struct mount *mp, int mntflags)
1231 struct ufsmount *ump = VFSTOUFS(mp);
1245 if ((error = ufs_extattr_stop(mp, td))) {
1248 "returned errno %d\n", mp->mnt_stat.f_mntonname,
1257 error = vfs_write_suspend_umnt(mp);
1261 if (MOUNTEDSOFTDEP(mp))
1262 error = softdep_flushfiles(mp, flags, td);
1264 error = ffs_flushfiles(mp, flags, td);
1277 if (MOUNTEDSOFTDEP(mp))
1278 softdep_unmount(mp);
1291 vfs_write_resume(mp, VR_START_WRITE);
1310 if (mp->mnt_gjprovider != NULL) {
1311 free(mp->mnt_gjprovider, M_UFSMNT);
1312 mp->mnt_gjprovider = NULL;
1318 mp->mnt_data = NULL;
1319 if (td->td_su == mp) {
1321 vfs_rel(mp);
1327 vfs_write_resume(mp, VR_START_WRITE);
1333 (void) ufs_extattr_autostart(mp, td);
1345 ffs_flushfiles(struct mount *mp, int flags, struct thread *td)
1350 ump = VFSTOUFS(mp);
1353 if (mp->mnt_flag & MNT_QUOTA) {
1355 error = vflush(mp, 0, SKIPSYSTEM|flags, td);
1359 error = quotaoff(td, mp, i);
1377 if ((error = vflush(mp, 0, SKIPSYSTEM | flags, td)) != 0)
1379 ffs_snapshot_unmount(mp);
1398 if (qerror == 0 && (error = vflush(mp, 0, flags, td)) != 0)
1428 ffs_statfs(struct mount *mp, struct statfs *sbp)
1433 ump = VFSTOUFS(mp);
1485 ffs_sync_lazy(struct mount *mp)
1492 if ((mp->mnt_flag & MNT_NOATIME) != 0) {
1494 qsync(mp);
1498 MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, ffs_sync_lazy_filter, NULL) {
1528 if (VFSTOUFS(mp)->um_fs->fs_fmod != 0 &&
1529 (error = ffs_sbupdate(VFSTOUFS(mp), MNT_LAZY, 0)) != 0)
1543 ffs_sync(struct mount *mp, int waitfor)
1548 struct ufsmount *ump = VFSTOUFS(mp);
1568 return (ffs_sync_lazy(mp));
1585 MNT_ILOCK(mp);
1586 secondary_writes = mp->mnt_secondary_writes;
1587 secondary_accwrites = mp->mnt_secondary_accwrites;
1588 MNT_IUNLOCK(mp);
1591 softdep_get_depcounts(mp, &softdep_deps, &softdep_accdeps);
1593 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {
1613 MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp);
1652 if (MOUNTEDSOFTDEP(mp) && (error == 0 || error == EAGAIN))
1661 if (softdep_check_suspend(mp,
1667 MNT_IUNLOCK(mp);
1670 mtx_assert(MNT_MTX(mp), MA_OWNED);
1671 mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED;
1672 MNT_IUNLOCK(mp);
1688 ffs_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
1690 return (ffs_vgetf(mp, ino, flags, vpp, 0));
1694 ffs_vgetf(struct mount *mp,
1711 error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL);
1739 ump = VFSTOUFS(mp);
1744 error = getnewvnode("ufs", mp, fs->fs_magic == FS_UFS1_MAGIC ?
1779 error = insmntque(vp, mp);
1847 error = ufs_vinit(mp, I_IS_UFS1(ip) ? &ffs_fifoops1 : &ffs_fifoops2,
1877 if ((mp->mnt_flag & MNT_MULTILABEL) && ip->i_mode) {
1883 error = mac_vnode_associate_extattr(mp, vp);
1911 ffs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
1916 return (ffs_inotovp(mp, ufhp->ufid_ino, ufhp->ufid_gen, flags,
1926 ffs_inotovp(struct mount *mp,
1941 ump = VFSTOUFS(mp);
1963 if (ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags) != 0)
2111 ffs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
2116 return (ufs_extattrctl(mp, cmd, filename_vp, attrnamespace,
2119 return (vfs_stdextattrctl(mp, cmd, filename_vp, attrnamespace,
2436 ffs_own_mount(const struct mount *mp)
2439 if (mp->mnt_op == &ufs_vfsops)
2452 struct mount *mp;
2461 TAILQ_FOREACH(mp, &mountlist, mnt_list) {
2462 if (!strcmp(mp->mnt_stat.f_fstypename, ufs_vfsconf.vfc_name))
2463 db_print_ffs(VFSTOUFS(mp));