changeset 13902:bff6ffc7348f

nfs4[1] OP_LOOKUP: Use new API to validate and update filehandle
author Dan Kruchinin <dan.kruchinin@nexenta.com>
date Thu, 18 Aug 2011 00:38:50 +0300
parents ec1a2371a008
children dd6bc0879d34
files usr/src/uts/common/fs/nfs/nfs41_srv.c usr/src/uts/common/fs/nfs/nfs4_srv.c
diffstat 2 files changed, 6 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs41_srv.c	Thu Aug 18 00:38:49 2011 +0300
+++ b/usr/src/uts/common/fs/nfs/nfs41_srv.c	Thu Aug 18 00:38:50 2011 +0300
@@ -2353,13 +2353,12 @@
 		}
 	}
 
-	error = mknfs41_fh(&cs->fh, vp, cs->exi);
+	error = rfs4_cs_update_fh(cs, vp);
+	VN_RELE(vp);
 
 err_out:
-	if (error) {
-		VN_RELE(vp);
+	if (error)
 		return (puterrno4(error));
-	}
 
 	/*
 	 * if did lookup on attrdir and didn't lookup .., set named
@@ -2368,13 +2367,8 @@
 	if (attrdir && ! dotdot)
 		FH41_SET_FLAG(fhp, FH41_NAMEDATTR);
 
-	if (cs->vp != NULL)
-		VN_RELE(cs->vp);
-
 	/* Assume false for now, open proc will set this */
 	cs->mandlock = FALSE;
-	cs->vp = vp;
-
 	return (NFS4_OK);
 }
 
--- a/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Aug 18 00:38:49 2011 +0300
+++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Aug 18 00:38:50 2011 +0300
@@ -2744,13 +2744,12 @@
 		}
 	}
 
-	error = makefh4(&cs->fh, vp, cs->exi);
+	error = rfs4_cs_update_fh(cs, vp);
+	VN_RELE(vp);
 
 err_out:
-	if (error) {
-		VN_RELE(vp);
+	if (error)
 		return (puterrno4(error));
-	}
 
 	/*
 	 * if did lookup on attrdir and didn't lookup .., set named
@@ -2759,13 +2758,8 @@
 	if (attrdir && ! dotdot)
 		FH4_SET_FLAG(&cs->fh, FH4_NAMEDATTR);
 
-	if (cs->vp != NULL)
-		VN_RELE(cs->vp);
-
 	/* Assume false for now, open proc will set this */
 	cs->mandlock = FALSE;
-	cs->vp = vp;
-
 	return (NFS4_OK);
 }