changeset 13912:7d52c1baebba

nfs4[1]: OP_CREATEFILE use new filehandle update/invalidate API
author Dan Kruchinin <dan.kruchinin@nexenta.com>
date Thu, 18 Aug 2011 00:55:35 +0300
parents b3a6c9f27806
children 11c9c22dec09
files usr/src/uts/common/fs/nfs/nfs41_srv.c usr/src/uts/common/fs/nfs/nfs4_srv.c
diffstat 2 files changed, 4 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs41_srv.c	Thu Aug 18 00:55:35 2011 +0300
+++ b/usr/src/uts/common/fs/nfs/nfs41_srv.c	Thu Aug 18 00:55:35 2011 +0300
@@ -4802,14 +4802,14 @@
 		}
 	}
 
-	error = mknfs41_fh(&cs->fh, vp, cs->exi);
+	error = rfs4_cs_update_fh(cs, vp);
+	VN_RELE(vp);
 	/*
 	 * Force modified data and metadata out to stable storage.
 	 */
 	(void) VOP_FSYNC(vp, FNODSYNC, cs->cr, NULL);
 
 	if (error) {
-		VN_RELE(vp);
 		*attrset = NFS4_EMPTY_ATTRMAP(avers);
 		return (puterrno4(error));
 	}
@@ -4819,11 +4819,6 @@
 		FH41_SET_FLAG((nfs41_fh_fmt_t *)cs->fh.nfs_fh4_val,
 		    FH41_NAMEDATTR);
 
-	if (cs->vp)
-		VN_RELE(cs->vp);
-
-	cs->vp = vp;
-
 	/*
 	 * if we did not create the file, we will need to check
 	 * the access bits on the file
--- a/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Aug 18 00:55:35 2011 +0300
+++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Aug 18 00:55:35 2011 +0300
@@ -6361,7 +6361,8 @@
 		}
 	}
 
-	error = makefh4(&cs->fh, vp, cs->exi);
+	error = rfs4_cs_update_fh(cs, vp);
+	VN_RELE(vp);
 
 	/*
 	 * Force modified data and metadata out to stable storage.
@@ -6369,7 +6370,6 @@
 	(void) VOP_FSYNC(vp, FNODSYNC, cs->cr, NULL);
 
 	if (error) {
-		VN_RELE(vp);
 		*attrset = NFS4_EMPTY_ATTRMAP(avers);
 		return (puterrno4(error));
 	}
@@ -6378,11 +6378,6 @@
 	if (dvp->v_flag & V_XATTRDIR)
 		FH4_SET_FLAG(&cs->fh, FH4_NAMEDATTR);
 
-	if (cs->vp)
-		VN_RELE(cs->vp);
-
-	cs->vp = vp;
-
 	/*
 	 * if we did not create the file, we will need to check
 	 * the access bits on the file