diff options
author | bz <bz@FreeBSD.org> | 2009-12-13 11:06:39 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2009-12-13 11:06:39 +0000 |
commit | 1ba3a5e4e0b1a21dd0c00df2e5223a60984e3de6 (patch) | |
tree | 00204cde270af98c99229eba8ad58f16ebfb498a /sys/nfsclient/nfs_vnops.c | |
parent | 1d2fa620269999c2637ae14c857ca41f60523cde (diff) | |
download | FreeBSD-src-1ba3a5e4e0b1a21dd0c00df2e5223a60984e3de6.zip FreeBSD-src-1ba3a5e4e0b1a21dd0c00df2e5223a60984e3de6.tar.gz |
Add a few more V_hacks to nfsclient to allow machines with a VIMAGE
kernel to boot from NFS. [1]
Note: this is not a full virtualization of nfsclient. It is only does
what advertised above and nothing more.
Requested by: public demand [1]
Tested by: kris, ..
MFC after: 5 days
Diffstat (limited to 'sys/nfsclient/nfs_vnops.c')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index dc61927..b3c28a3 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -1555,14 +1555,21 @@ nfs_create(struct vop_create_args *ap) struct vattr vattr; int v3 = NFS_ISV3(dvp); + CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); + /* * Oops, not for me.. */ - if (vap->va_type == VSOCK) - return (nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap)); + if (vap->va_type == VSOCK) { + error = nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap); + CURVNET_RESTORE(); + 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); + } if (vap->va_vaflags & VA_EXCLUSIVE) fmode |= O_EXCL; again: @@ -1658,6 +1665,7 @@ nfsmout: KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } mtx_unlock(&(VTONFS(dvp))->n_mtx); + CURVNET_RESTORE(); return (error); } |