fdescfs: allow shared locking of root vnode

Eliminates fdescfs from lock profile when running poudriere.
This commit is contained in:
Mateusz Guzik 2021-05-19 17:59:20 +02:00
parent 43999a5cba
commit 4fe925b81e

View File

@ -107,12 +107,23 @@ fdesc_mount(struct mount *mp)
mp->mnt_data = NULL;
return (error);
}
VN_LOCK_ASHARE(rvp);
rvp->v_type = VDIR;
rvp->v_vflag |= VV_ROOT;
fmp->f_root = rvp;
VOP_UNLOCK(rvp);
MNT_ILOCK(mp);
/* XXX -- don't mark as local to work around fts() problems */
/*mp->mnt_flag |= MNT_LOCAL;*/
/*
* Enable shared locking so that there is no contention on the root
* vnode. Note only root vnode enables shared locking for itself,
* so this end up being a nop for the rest.
*/
mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED;
MNT_IUNLOCK(mp);
vfs_getnewfsid(mp);
vfs_mountedfrom(mp, "fdescfs");
@ -163,7 +174,7 @@ fdesc_root(struct mount *mp, int flags, struct vnode **vpp)
* Return locked reference to root.
*/
vp = VFSTOFDESC(mp)->f_root;
vget(vp, LK_EXCLUSIVE | LK_RETRY);
vget(vp, flags | LK_RETRY);
*vpp = vp;
return (0);
}