Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Aug 2010 23:58:26 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r210740 - in stable/8/sys/fs: nfs nfsclient
Message-ID:  <201008012358.o71NwQFL052445@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Aug  1 23:58:26 2010
New Revision: 210740
URL: http://svn.freebsd.org/changeset/base/210740

Log:
  MFC: r210201
  Change the nfscl_mustflush() function in the experimental NFSv4
  client to return a boolean_t in order to make it more compatible
  with style(9).

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
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (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	Sun Aug  1 23:36:39 2010	(r210739)
+++ stable/8/sys/fs/nfs/nfs_var.h	Sun Aug  1 23:58:26 2010	(r210740)
@@ -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 *);
-int nfscl_mustflush(vnode_t);
+boolean_t 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	Sun Aug  1 23:36:39 2010	(r210739)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Sun Aug  1 23:58:26 2010	(r210740)
@@ -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 int
+APPLESTATIC boolean_t
 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 (1);
+		return (TRUE);
 	NFSLOCKCLSTATE();
 	clp = nfscl_findcl(nmp);
 	if (clp == NULL) {
 		NFSUNLOCKCLSTATE();
-		return (1);
+		return (TRUE);
 	}
 	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 (0);
+		return (FALSE);
 	}
 	NFSUNLOCKCLSTATE();
-	return (1);
+	return (TRUE);
 }
 
 /*

Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clsubs.c	Sun Aug  1 23:36:39 2010	(r210739)
+++ stable/8/sys/fs/nfsclient/nfs_clsubs.c	Sun Aug  1 23:58:26 2010	(r210740)
@@ -188,7 +188,8 @@ ncl_getattrcache(struct vnode *vp, struc
 	struct nfsnode *np;
 	struct vattr *vap;
 	struct nfsmount *nmp;
-	int timeo, mustflush;
+	int timeo;
+	boolean_t mustflush;
 	
 	np = VTONFS(vp);
 	vap = &np->n_vattr.na_vattr;
@@ -230,7 +231,7 @@ ncl_getattrcache(struct vnode *vp, struc
 #endif
 
 	if ((time_second - np->n_attrstamp) >= timeo &&
-	    (mustflush != 0 || np->n_attrstamp == 0)) {
+	    (mustflush || np->n_attrstamp == 0)) {
 		newnfsstats.attrcache_misses++;
 		mtx_unlock(&np->n_mtx);
 #ifdef NFS_ACDEBUG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008012358.o71NwQFL052445>