Mercurial > illumos > nfs4.1
changeset 13907:8766b8c793ca
Bnfs4[1]: OP_PUTROOTFH use new filehandle update/invalidate API
NOTE: We don't need to explicitly hold rootdir vnode anymore.
It holds automatically during filehandle update process
(see nfs4-op-secinfo-cs-fh)
author | Dan Kruchinin <dan.kruchinin@nexenta.com> |
---|---|
date | Thu, 18 Aug 2011 00:51:47 +0300 |
parents | 9a5d43c845f6 |
children | bbb5a8c3ecb4 |
files | usr/src/uts/common/fs/nfs/nfs41_srv.c usr/src/uts/common/fs/nfs/nfs4_srv.c |
diffstat | 2 files changed, 16 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs41_srv.c Thu Aug 18 00:38:50 2011 +0300 +++ b/usr/src/uts/common/fs/nfs/nfs41_srv.c Thu Aug 18 00:51:47 2011 +0300 @@ -2941,11 +2941,7 @@ DTRACE_NFSV4_1(op__putrootfh__start, struct compound_state *, cs); - if (cs->vp) { - VN_RELE(cs->vp); - cs->vp = NULL; - } - + rfs4_cs_invalidate_fh(cs); if (cs->cr) crfree(cs->cr); @@ -2982,21 +2978,17 @@ * Now make a filehandle based on the root * export and root vnode. */ - error = mknfs41_fh(&cs->fh, rootdir, exi); - if (error != 0) { - *cs->statusp = resp->status = puterrno4(error); - goto final; - } - sav_exi = cs->exi; cs->exi = exi; - - VN_HOLD(rootdir); - cs->vp = rootdir; + error = rfs4_cs_update_fh(cs, rootdir); + if (error != 0) { + cs->exi = sav_exi; + *cs->statusp = resp->status = puterrno4(error); + goto final; + } if ((resp->status = call_checkauth4(cs, req)) != NFS4_OK) { - VN_RELE(rootdir); - cs->vp = NULL; + rfs4_cs_invalidate_fh(cs); cs->exi = sav_exi; goto final; }
--- a/usr/src/uts/common/fs/nfs/nfs4_srv.c Thu Aug 18 00:38:50 2011 +0300 +++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c Thu Aug 18 00:51:47 2011 +0300 @@ -3414,11 +3414,7 @@ DTRACE_NFSV4_1(op__putrootfh__start, struct compound_state *, cs); - if (cs->vp) { - VN_RELE(cs->vp); - cs->vp = NULL; - } - + rfs4_cs_invalidate_fh(cs); if (cs->cr) crfree(cs->cr); @@ -3456,21 +3452,17 @@ * Now make a filehandle based on the root * export and root vnode. */ - error = makefh4(&cs->fh, rootdir, exi); - if (error != 0) { - *cs->statusp = resp->status = puterrno4(error); - goto out; - } - sav_exi = cs->exi; cs->exi = exi; - - VN_HOLD(rootdir); - cs->vp = rootdir; + error = rfs4_cs_update_fh(cs, rootdir); + if (error != 0) { + cs->exi = sav_exi; + *cs->statusp = resp->status = puterrno4(error); + goto out; + } if ((resp->status = call_checkauth4(cs, req)) != NFS4_OK) { - VN_RELE(rootdir); - cs->vp = NULL; + rfs4_cs_invalidate_fh(cs); cs->exi = sav_exi; goto out; }