Reduce recursions on curvnet and thus spamming the console with warning
messages for kernels built with options VIMAGE and VNET_DEBUG enabled. Reviewed by: bz MFC after: 3 days
This commit is contained in:
parent
1a933e8f10
commit
5d005b51e5
@ -423,14 +423,18 @@ nfs_mountroot(struct mount *mp)
|
|||||||
char buf[128];
|
char buf[128];
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
|
CURVNET_SET(TD_TO_VNET(td));
|
||||||
|
|
||||||
#if defined(BOOTP_NFSROOT) && defined(BOOTP)
|
#if defined(BOOTP_NFSROOT) && defined(BOOTP)
|
||||||
bootpc_init(); /* use bootp to get nfs_diskless filled in */
|
bootpc_init(); /* use bootp to get nfs_diskless filled in */
|
||||||
#elif defined(NFS_ROOT)
|
#elif defined(NFS_ROOT)
|
||||||
nfs_setup_diskless();
|
nfs_setup_diskless();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (nfs_diskless_valid == 0)
|
if (nfs_diskless_valid == 0) {
|
||||||
|
CURVNET_RESTORE();
|
||||||
return (-1);
|
return (-1);
|
||||||
|
}
|
||||||
if (nfs_diskless_valid == 1)
|
if (nfs_diskless_valid == 1)
|
||||||
nfs_convert_diskless();
|
nfs_convert_diskless();
|
||||||
|
|
||||||
@ -516,6 +520,7 @@ nfs_mountroot(struct mount *mp)
|
|||||||
nd->root_args.hostname = buf;
|
nd->root_args.hostname = buf;
|
||||||
if ((error = nfs_mountdiskless(buf,
|
if ((error = nfs_mountdiskless(buf,
|
||||||
&nd->root_saddr, &nd->root_args, td, &vp, mp)) != 0) {
|
&nd->root_saddr, &nd->root_args, td, &vp, mp)) != 0) {
|
||||||
|
CURVNET_RESTORE();
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,6 +534,7 @@ nfs_mountroot(struct mount *mp)
|
|||||||
sizeof (prison0.pr_hostname));
|
sizeof (prison0.pr_hostname));
|
||||||
mtx_unlock(&prison0.pr_mtx);
|
mtx_unlock(&prison0.pr_mtx);
|
||||||
inittodr(ntohl(nd->root_time));
|
inittodr(ntohl(nd->root_time));
|
||||||
|
CURVNET_RESTORE();
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -827,8 +833,6 @@ nfs_mount(struct mount *mp)
|
|||||||
has_fh_opt = 0;
|
has_fh_opt = 0;
|
||||||
has_hostname_opt = 0;
|
has_hostname_opt = 0;
|
||||||
|
|
||||||
CURVNET_SET(CRED_TO_VNET(curthread->td_ucred));
|
|
||||||
|
|
||||||
if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
|
if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
@ -1128,7 +1132,6 @@ out:
|
|||||||
mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED);
|
mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED);
|
||||||
MNT_IUNLOCK(mp);
|
MNT_IUNLOCK(mp);
|
||||||
}
|
}
|
||||||
CURVNET_RESTORE();
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1555,19 +1555,15 @@ nfs_create(struct vop_create_args *ap)
|
|||||||
struct vattr vattr;
|
struct vattr vattr;
|
||||||
int v3 = NFS_ISV3(dvp);
|
int v3 = NFS_ISV3(dvp);
|
||||||
|
|
||||||
CURVNET_SET(CRED_TO_VNET(curthread->td_ucred));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Oops, not for me..
|
* Oops, not for me..
|
||||||
*/
|
*/
|
||||||
if (vap->va_type == VSOCK) {
|
if (vap->va_type == VSOCK) {
|
||||||
error = nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap);
|
error = nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap);
|
||||||
CURVNET_RESTORE();
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) {
|
if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) {
|
||||||
CURVNET_RESTORE();
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
if (vap->va_vaflags & VA_EXCLUSIVE)
|
if (vap->va_vaflags & VA_EXCLUSIVE)
|
||||||
@ -1665,7 +1661,6 @@ nfsmout:
|
|||||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||||
}
|
}
|
||||||
mtx_unlock(&(VTONFS(dvp))->n_mtx);
|
mtx_unlock(&(VTONFS(dvp))->n_mtx);
|
||||||
CURVNET_RESTORE();
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user