Lines Matching refs:mp
221 VFS_MOUNT(mount_t mp, vnode_t devvp, user_addr_t data, vfs_context_t ctx)
229 if ((mp == dead_mountp) || (mp->mnt_op->vfs_mount == 0))
233 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
240 if (vfs_64bitready(mp)) {
241 error = (*mp->mnt_op->vfs_mount)(mp, devvp, data, ctx);
248 error = (*mp->mnt_op->vfs_mount)(mp, devvp, data, ctx);
261 VFS_START(mount_t mp, int flags, vfs_context_t ctx)
269 if ((mp == dead_mountp) || (mp->mnt_op->vfs_start == 0))
273 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
279 error = (*mp->mnt_op->vfs_start)(mp, flags, ctx);
291 VFS_UNMOUNT(mount_t mp, int flags, vfs_context_t ctx)
299 if ((mp == dead_mountp) || (mp->mnt_op->vfs_unmount == 0))
303 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
309 error = (*mp->mnt_op->vfs_unmount)(mp, flags, ctx);
338 VFS_ROOT(mount_t mp, struct vnode ** vpp, vfs_context_t ctx)
346 if ((mp == dead_mountp) || (mp->mnt_op->vfs_root == 0))
354 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
360 error = (*mp->mnt_op->vfs_root)(mp, vpp, ctx);
372 VFS_QUOTACTL(mount_t mp, int cmd, uid_t uid, caddr_t datap, vfs_context_t ctx)
380 if ((mp == dead_mountp) || (mp->mnt_op->vfs_quotactl == 0))
384 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
390 error = (*mp->mnt_op->vfs_quotactl)(mp, cmd, uid, datap, ctx);
402 VFS_GETATTR(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx)
410 if ((mp == dead_mountp) || (mp->mnt_op->vfs_getattr == 0))
418 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
424 error = (*mp->mnt_op->vfs_getattr)(mp, vfa, ctx);
436 VFS_SETATTR(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx)
444 if ((mp == dead_mountp) || (mp->mnt_op->vfs_setattr == 0))
452 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
458 error = (*mp->mnt_op->vfs_setattr)(mp, vfa, ctx);
470 VFS_SYNC(mount_t mp, int flags, vfs_context_t ctx)
478 if ((mp == dead_mountp) || (mp->mnt_op->vfs_sync == 0))
486 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
492 error = (*mp->mnt_op->vfs_sync)(mp, flags, ctx);
504 VFS_VGET(mount_t mp, ino64_t ino, struct vnode **vpp, vfs_context_t ctx)
512 if ((mp == dead_mountp) || (mp->mnt_op->vfs_vget == 0))
520 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
526 error = (*mp->mnt_op->vfs_vget)(mp, ino, vpp, ctx);
538 VFS_FHTOVP(mount_t mp, int fhlen, unsigned char * fhp, vnode_t * vpp, vfs_context_t ctx)
546 if ((mp == dead_mountp) || (mp->mnt_op->vfs_fhtovp == 0))
554 thread_safe = (mp->mnt_vtable->vfc_vfsflags & VFC_VFSTHREADSAFE);
560 error = (*mp->mnt_op->vfs_fhtovp)(mp, fhlen, fhp, vpp, ctx);
608 vfs_throttle_mask(mount_t mp)
610 return(mp->mnt_throttle_mask);
615 vfs_name(mount_t mp, char * buffer)
617 strncpy(buffer, mp->mnt_vtable->vfc_name, MFSNAMELEN);
622 vfs_typenum(mount_t mp)
624 return(mp->mnt_vtable->vfc_typenum);
629 vfs_mntlabel(mount_t mp)
631 return (void*)mp->mnt_mntlabel;
636 vfs_flags(mount_t mp)
638 return((uint64_t)(mp->mnt_flag & (MNT_CMDFLAGS | MNT_VISFLAGMASK)));
643 vfs_setflags(mount_t mp, uint64_t flags)
647 mount_lock(mp);
648 mp->mnt_flag |= lflags;
649 mount_unlock(mp);
654 vfs_clearflags(mount_t mp , uint64_t flags)
658 mount_lock(mp);
659 mp->mnt_flag &= ~lflags;
660 mount_unlock(mp);
665 vfs_iswriteupgrade(mount_t mp) /* ronly && MNTK_WANTRDWR */
667 return ((mp->mnt_flag & MNT_RDONLY) && (mp->mnt_kern_flag & MNTK_WANTRDWR));
673 vfs_isrdonly(mount_t mp)
675 return (mp->mnt_flag & MNT_RDONLY);
680 vfs_issynchronous(mount_t mp)
682 return (mp->mnt_flag & MNT_SYNCHRONOUS);
687 vfs_isrdwr(mount_t mp)
689 return ((mp->mnt_flag & MNT_RDONLY) == 0);
695 vfs_isupdate(mount_t mp)
697 return (mp->mnt_flag & MNT_UPDATE);
703 vfs_isreload(mount_t mp)
705 return ((mp->mnt_flag & MNT_UPDATE) && (mp->mnt_flag & MNT_RELOAD));
710 vfs_isforce(mount_t mp)
712 if ((mp->mnt_lflag & MNT_LFORCE) || (mp->mnt_kern_flag & MNTK_FRCUNMOUNT))
719 vfs_isunmount(mount_t mp)
721 if ((mp->mnt_lflag & MNT_LUNMOUNT)) {
729 vfs_64bitready(mount_t mp)
731 if ((mp->mnt_vtable->vfc_vfsflags & VFC_VFS64BITREADY))
739 vfs_authcache_ttl(mount_t mp)
741 if ( (mp->mnt_kern_flag & (MNTK_AUTH_OPAQUE | MNTK_AUTH_CACHE_TTL)) )
742 return (mp->mnt_authcache_ttl);
748 vfs_setauthcache_ttl(mount_t mp, int ttl)
750 mount_lock(mp);
751 mp->mnt_kern_flag |= MNTK_AUTH_CACHE_TTL;
752 mp->mnt_authcache_ttl = ttl;
753 mount_unlock(mp);
757 vfs_clearauthcache_ttl(mount_t mp)
759 mount_lock(mp);
760 mp->mnt_kern_flag &= ~MNTK_AUTH_CACHE_TTL;
765 mp->mnt_authcache_ttl = CACHED_LOOKUP_RIGHT_TTL;
766 mount_unlock(mp);
770 vfs_markdependency(mount_t mp)
773 mount_lock(mp);
774 mp->mnt_dependent_process = p;
775 mp->mnt_dependent_pid = proc_pid(p);
776 mount_unlock(mp);
781 vfs_authopaque(mount_t mp)
783 if ((mp->mnt_kern_flag & MNTK_AUTH_OPAQUE))
790 vfs_authopaqueaccess(mount_t mp)
792 if ((mp->mnt_kern_flag & MNTK_AUTH_OPAQUE_ACCESS))
799 vfs_setauthopaque(mount_t mp)
801 mount_lock(mp);
802 mp->mnt_kern_flag |= MNTK_AUTH_OPAQUE;
803 mount_unlock(mp);
807 vfs_setauthopaqueaccess(mount_t mp)
809 mount_lock(mp);
810 mp->mnt_kern_flag |= MNTK_AUTH_OPAQUE_ACCESS;
811 mount_unlock(mp);
815 vfs_clearauthopaque(mount_t mp)
817 mount_lock(mp);
818 mp->mnt_kern_flag &= ~MNTK_AUTH_OPAQUE;
819 mount_unlock(mp);
823 vfs_clearauthopaqueaccess(mount_t mp)
825 mount_lock(mp);
826 mp->mnt_kern_flag &= ~MNTK_AUTH_OPAQUE_ACCESS;
827 mount_unlock(mp);
831 vfs_setextendedsecurity(mount_t mp)
833 mount_lock(mp);
834 mp->mnt_kern_flag |= MNTK_EXTENDED_SECURITY;
835 mount_unlock(mp);
839 vfs_clearextendedsecurity(mount_t mp)
841 mount_lock(mp);
842 mp->mnt_kern_flag &= ~MNTK_EXTENDED_SECURITY;
843 mount_unlock(mp);
847 vfs_extendedsecurity(mount_t mp)
849 return(mp->mnt_kern_flag & MNTK_EXTENDED_SECURITY);
854 vfs_maxsymlen(mount_t mp)
856 return(mp->mnt_maxsymlinklen);
861 vfs_setmaxsymlen(mount_t mp, uint32_t symlen)
863 mp->mnt_maxsymlinklen = symlen;
868 vfs_statfs(mount_t mp)
870 return(&mp->mnt_vfsstat);
874 vfs_getattr(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx)
878 if ((error = VFS_GETATTR(mp, vfa, ctx)) != 0)
893 vfs_setattr(mount_t mp, struct vfs_attr *vfa, vfs_context_t ctx)
897 if (vfs_isrdonly(mp))
900 error = VFS_SETATTR(mp, vfa, ctx);
912 vfs_fsprivate(mount_t mp)
914 return(mp->mnt_data);
919 vfs_setfsprivate(mount_t mp, void *mntdata)
921 mount_lock(mp);
922 mp->mnt_data = mntdata;
923 mount_unlock(mp);
932 vfs_devblocksize(mount_t mp) {
934 return(mp->mnt_devblocksize);
941 vfs_vnodecovered(mount_t mp)
943 vnode_t vp = mp->mnt_vnodecovered;
961 vfs_devvp(mount_t mp)
963 vnode_t vp = mp->mnt_devvp;
976 vfs_ioattr(mount_t mp, struct vfsioattr *ioattrp)
978 if (mp == NULL) {
988 ioattrp->io_maxreadcnt = mp->mnt_maxreadcnt;
989 ioattrp->io_maxwritecnt = mp->mnt_maxwritecnt;
990 ioattrp->io_segreadcnt = mp->mnt_segreadcnt;
991 ioattrp->io_segwritecnt = mp->mnt_segwritecnt;
992 ioattrp->io_maxsegreadsize = mp->mnt_maxsegreadsize;
993 ioattrp->io_maxsegwritesize = mp->mnt_maxsegwritesize;
994 ioattrp->io_devblocksize = mp->mnt_devblocksize;
995 ioattrp->io_flags = mp->mnt_ioflags;
1006 vfs_setioattr(mount_t mp, struct vfsioattr * ioattrp)
1008 if (mp == NULL)
1010 mp->mnt_maxreadcnt = ioattrp->io_maxreadcnt;
1011 mp->mnt_maxwritecnt = ioattrp->io_maxwritecnt;
1012 mp->mnt_segreadcnt = ioattrp->io_segreadcnt;
1013 mp->mnt_segwritecnt = ioattrp->io_segwritecnt;
1014 mp->mnt_maxsegreadsize = ioattrp->io_maxsegreadsize;
1015 mp->mnt_maxsegwritesize = ioattrp->io_maxsegwritesize;
1016 mp->mnt_devblocksize = ioattrp->io_devblocksize;
1017 mp->mnt_ioflags = ioattrp->io_flags;
1622 mount_t mp;
1624 if ((vp->v_type == VDIR) && ((mp = vp->v_mountedhere) != NULL) &&
1625 (mp->mnt_vnodecovered == vp))
1626 return (mp);
2937 mount_t mp;
2939 mp = mount_list_lookupby_fsid(fsid, 0 /* locked */, 1 /* withref */);
2940 if (mp == NULL) {
2944 error = vfs_busy(mp, LK_NOWAIT);
2945 mount_iterdrop(mp);
2951 mount_lock(mp);
2952 if (mp->mnt_triggercallback != NULL) {
2954 mount_unlock(mp);
2958 mp->mnt_triggercallback = vtc;
2959 mp->mnt_triggerdata = data;
2960 mount_unlock(mp);
2962 mp->mnt_triggercallback(mp, VTC_REPLACE, data, ctx);
2965 vfs_unbusy(mp);