svn commit: r316829 - in head/sys/fs: nfs nfsclient

Rick Macklem rmacklem at FreeBSD.org
Fri Apr 14 13:25:47 UTC 2017


Author: rmacklem
Date: Fri Apr 14 13:25:45 2017
New Revision: 316829
URL: https://svnweb.freebsd.org/changeset/base/316829

Log:
  Remove unused "cred" argument to ncl_flush().
  
  The "cred" argument of ncl_flush() is unused and it was confusing to have
  the code passing in NULL for this argument in some cases. This patch deletes
  this argument.
  There is no semantic change because of this patch.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfs_var.h
  head/sys/fs/nfsclient/nfs_clnode.c
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfs/nfs_var.h
==============================================================================
--- head/sys/fs/nfs/nfs_var.h	Fri Apr 14 12:54:39 2017	(r316828)
+++ head/sys/fs/nfs/nfs_var.h	Fri Apr 14 13:25:45 2017	(r316829)
@@ -592,7 +592,7 @@ int nfscl_maperr(NFSPROC_T *, int, uid_t
 void nfscl_init(void);
 
 /* nfs_clbio.c */
-int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int, int);
+int ncl_flush(vnode_t, int, NFSPROC_T *, int, int);
 
 /* nfs_clnode.c */
 void ncl_invalcaches(vnode_t);

Modified: head/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnode.c	Fri Apr 14 12:54:39 2017	(r316828)
+++ head/sys/fs/nfsclient/nfs_clnode.c	Fri Apr 14 13:25:45 2017	(r316829)
@@ -248,7 +248,7 @@ ncl_inactive(struct vop_inactive_args *a
 		} else
 			retv = TRUE;
 		if (retv == TRUE) {
-			(void)ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0);
+			(void)ncl_flush(vp, MNT_WAIT, ap->a_td, 1, 0);
 			(void)nfsrpc_close(vp, 1, ap->a_td);
 		}
 	}

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 14 12:54:39 2017	(r316828)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Fri Apr 14 13:25:45 2017	(r316829)
@@ -3878,8 +3878,7 @@ nfscl_recalldeleg(struct nfsclclient *cl
 	if ((dp->nfsdl_flags & NFSCLDL_WRITE) && (np->n_flag & NMODIFIED)) {
 		np->n_flag |= NDELEGRECALL;
 		NFSUNLOCKNODE(np);
-		ret = ncl_flush(vp, MNT_WAIT, cred, p, 1,
-		    called_from_renewthread);
+		ret = ncl_flush(vp, MNT_WAIT, p, 1, called_from_renewthread);
 		NFSLOCKNODE(np);
 		np->n_flag &= ~NDELEGRECALL;
 	}

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Fri Apr 14 12:54:39 2017	(r316828)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Fri Apr 14 13:25:45 2017	(r316829)
@@ -709,12 +709,12 @@ nfs_close(struct vop_close_args *ap)
 		     * traditional vnode locking implemented for Vnode Ops.
 		     */
 		    int cm = newnfs_commit_on_close ? 1 : 0;
-		    error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0);
+		    error = ncl_flush(vp, MNT_WAIT, ap->a_td, cm, 0);
 		    /* np->n_flag &= ~NMODIFIED; */
 		} else if (NFS_ISV4(vp)) { 
 			if (nfscl_mustflush(vp) != 0) {
 				int cm = newnfs_commit_on_close ? 1 : 0;
-				error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td,
+				error = ncl_flush(vp, MNT_WAIT, ap->a_td,
 				    cm, 0);
 				/*
 				 * as above w.r.t races when clearing
@@ -2631,7 +2631,7 @@ nfs_fsync(struct vop_fsync_args *ap)
 		 */
 		return (0);
 	}
-	return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0));
+	return (ncl_flush(ap->a_vp, ap->a_waitfor, ap->a_td, 1, 0));
 }
 
 /*
@@ -2643,7 +2643,7 @@ nfs_fsync(struct vop_fsync_args *ap)
  * waiting for a buffer write to complete.
  */
 int
-ncl_flush(struct vnode *vp, int waitfor, struct ucred *cred, struct thread *td,
+ncl_flush(struct vnode *vp, int waitfor, struct thread *td,
     int commit, int called_from_renewthread)
 {
 	struct nfsnode *np = VTONFS(vp);
@@ -3024,7 +3024,7 @@ nfs_advlock(struct vop_advlock_args *ap)
 		if (ap->a_op == F_UNLCK &&
 		    nfscl_checkwritelocked(vp, ap->a_fl, cred, td, ap->a_id,
 		    ap->a_flags))
-			(void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0);
+			(void) ncl_flush(vp, MNT_WAIT, td, 1, 0);
 
 		/*
 		 * Loop around doing the lock op, while a blocking lock
@@ -3404,7 +3404,7 @@ nfs_set_text(struct vop_set_text_args *a
 	}
 
 	/* Now, flush the buffer cache. */
-	ncl_flush(vp, MNT_WAIT, NULL, curthread, 0, 0);
+	ncl_flush(vp, MNT_WAIT, curthread, 0, 0);
 
 	/* And, finally, make sure that n_mtime is up to date. */
 	np = VTONFS(vp);


More information about the svn-src-head mailing list