svn commit: r211160 - in stable/8/sys/fs: nfs nfsclient

Rick Macklem rmacklem at FreeBSD.org
Wed Aug 11 03:08:04 UTC 2010


Author: rmacklem
Date: Wed Aug 11 03:08:03 2010
New Revision: 211160
URL: http://svn.freebsd.org/changeset/base/211160

Log:
  MFC: r210786
  Modify the return value for nfscl_mustflush() from boolean_t,
  which I mistakenly thought was correct w.r.t. style(9), back
  to int and add the checks for != 0. This is just a stylistic
  modification.

Modified:
  stable/8/sys/fs/nfs/nfs_var.h
  stable/8/sys/fs/nfsclient/nfs_clstate.c
  stable/8/sys/fs/nfsclient/nfs_clsubs.c
  stable/8/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_var.h
==============================================================================
--- stable/8/sys/fs/nfs/nfs_var.h	Wed Aug 11 02:28:39 2010	(r211159)
+++ stable/8/sys/fs/nfs/nfs_var.h	Wed Aug 11 03:08:03 2010	(r211160)
@@ -469,7 +469,7 @@ void nfscl_docb(struct nfsrv_descript *,
 void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *);
 int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t,
     u_int64_t, struct flock *, NFSPROC_T *);
-boolean_t nfscl_mustflush(vnode_t);
+int nfscl_mustflush(vnode_t);
 int nfscl_nodeleg(vnode_t, int);
 int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *);
 int nfscl_getref(struct nfsmount *);

Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clstate.c	Wed Aug 11 02:28:39 2010	(r211159)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Wed Aug 11 03:08:03 2010	(r211160)
@@ -3735,7 +3735,7 @@ nfscl_tryclose(struct nfsclopen *op, str
  * to the server. This might be a big performance win in some environments.
  * (Not useful until the client does caching on local stable storage.)
  */
-APPLESTATIC boolean_t
+APPLESTATIC int
 nfscl_mustflush(vnode_t vp)
 {
 	struct nfsclclient *clp;
@@ -3746,12 +3746,12 @@ nfscl_mustflush(vnode_t vp)
 	np = VTONFS(vp);
 	nmp = VFSTONFS(vnode_mount(vp));
 	if (!NFSHASNFSV4(nmp))
-		return (TRUE);
+		return (1);
 	NFSLOCKCLSTATE();
 	clp = nfscl_findcl(nmp);
 	if (clp == NULL) {
 		NFSUNLOCKCLSTATE();
-		return (TRUE);
+		return (1);
 	}
 	dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
 	if (dp != NULL && (dp->nfsdl_flags & (NFSCLDL_WRITE | NFSCLDL_RECALL))
@@ -3759,10 +3759,10 @@ nfscl_mustflush(vnode_t vp)
 	    (dp->nfsdl_sizelimit >= np->n_size ||
 	     !NFSHASSTRICT3530(nmp))) {
 		NFSUNLOCKCLSTATE();
-		return (FALSE);
+		return (0);
 	}
 	NFSUNLOCKCLSTATE();
-	return (TRUE);
+	return (1);
 }
 
 /*

Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clsubs.c	Wed Aug 11 02:28:39 2010	(r211159)
+++ stable/8/sys/fs/nfsclient/nfs_clsubs.c	Wed Aug 11 03:08:03 2010	(r211160)
@@ -187,8 +187,7 @@ ncl_getattrcache(struct vnode *vp, struc
 	struct nfsnode *np;
 	struct vattr *vap;
 	struct nfsmount *nmp;
-	int timeo;
-	boolean_t mustflush;
+	int timeo, mustflush;
 	
 	np = VTONFS(vp);
 	vap = &np->n_vattr.na_vattr;
@@ -230,7 +229,7 @@ ncl_getattrcache(struct vnode *vp, struc
 #endif
 
 	if ((time_second - np->n_attrstamp) >= timeo &&
-	    (mustflush || np->n_attrstamp == 0)) {
+	    (mustflush != 0 || np->n_attrstamp == 0)) {
 		newnfsstats.attrcache_misses++;
 		mtx_unlock(&np->n_mtx);
 #ifdef NFS_ACDEBUG

Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clvnops.c	Wed Aug 11 02:28:39 2010	(r211159)
+++ stable/8/sys/fs/nfsclient/nfs_clvnops.c	Wed Aug 11 03:08:03 2010	(r211160)
@@ -506,7 +506,8 @@ nfs_open(struct vop_open_args *ap)
 	 * Now, if this Open will be doing reading, re-validate/flush the
 	 * cache, so that Close/Open coherency is maintained.
 	 */
-	if ((fmode & FREAD) && (!NFS_ISV4(vp) || nfscl_mustflush(vp))) {
+	if ((fmode & FREAD) != 0 &&
+	    (!NFS_ISV4(vp) || nfscl_mustflush(vp) != 0)) {
 		mtx_lock(&np->n_mtx);
 		if (np->n_flag & NMODIFIED) {
 			mtx_unlock(&np->n_mtx);			
@@ -678,7 +679,7 @@ nfs_close(struct vop_close_args *ap)
 		    error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0);
 		    /* np->n_flag &= ~NMODIFIED; */
 		} else if (NFS_ISV4(vp)) { 
-			if (nfscl_mustflush(vp)) {
+			if (nfscl_mustflush(vp) != 0) {
 				int cm = newnfs_commit_on_close ? 1 : 0;
 				error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td,
 				    cm, 0);
@@ -720,7 +721,7 @@ nfs_close(struct vop_close_args *ap)
 		/*
 		 * Get attributes so "change" is up to date.
 		 */
-		if (error == 0 && nfscl_mustflush(vp)) {
+		if (error == 0 && nfscl_mustflush(vp) != 0) {
 			ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva,
 			    NULL);
 			if (!ret) {


More information about the svn-src-all mailing list