git: 41c029d506a5 - main - nfscl: Clean up the code by removing unused arguments

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Mon, 13 Jun 2022 22:59:46 UTC
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=41c029d506a5acb5be2a4892379cca6bf00f9923

commit 41c029d506a5acb5be2a4892379cca6bf00f9923
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-06-13 22:57:42 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-06-13 22:57:42 +0000

    nfscl: Clean up the code by removing unused arguments
    
    The "void *stuff" (also called fstuff and dstuff) argument
    was used by the Mac OSX port.  For FreeBSD, this argument
    is always NULL, so remove it to clean up the code.
    
    This commit gets rid of "stuff" for assorted functions
    defined in nfs_clrpcops.c and called in nfs_clvnops.c.
    Future commits will do the same for other functions.
    
    This commit should not result in a semantics change.
---
 sys/fs/nfs/nfs_var.h            |  7 +++----
 sys/fs/nfsclient/nfs_clrpcops.c | 13 +++++--------
 sys/fs/nfsclient/nfs_clvnops.c  | 19 ++++++++-----------
 3 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index c4dc2451523e..c1ba03a9f2fc 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -443,7 +443,7 @@ int nfsrpc_null(vnode_t, struct ucred *, NFSPROC_T *);
 int nfsrpc_access(vnode_t, int, struct ucred *, NFSPROC_T *,
     struct nfsvattr *, int *);
 int nfsrpc_accessrpc(vnode_t, u_int32_t, struct ucred *,
-    NFSPROC_T *, struct nfsvattr *, int *, u_int32_t *, void *);
+    NFSPROC_T *, struct nfsvattr *, int *, u_int32_t *);
 int nfsrpc_open(vnode_t, int, struct ucred *, NFSPROC_T *);
 int nfsrpc_openrpc(struct nfsmount *, vnode_t, u_int8_t *, int, u_int8_t *, int,
     u_int32_t, struct nfsclopen *, u_int8_t *, int, struct nfscldeleg **, int,
@@ -457,12 +457,11 @@ int nfsrpc_openconfirm(vnode_t, u_int8_t *, int, struct nfsclopen *,
     struct ucred *, NFSPROC_T *);
 int nfsrpc_setclient(struct nfsmount *, struct nfsclclient *, int,
     bool *, struct ucred *, NFSPROC_T *);
-int nfsrpc_getattr(vnode_t, struct ucred *, NFSPROC_T *,
-    struct nfsvattr *, void *);
+int nfsrpc_getattr(vnode_t, struct ucred *, NFSPROC_T *, struct nfsvattr *);
 int nfsrpc_getattrnovp(struct nfsmount *, u_int8_t *, int, int,
     struct ucred *, NFSPROC_T *, struct nfsvattr *, u_int64_t *, uint32_t *);
 int nfsrpc_setattr(vnode_t, struct vattr *, NFSACL_T *, struct ucred *,
-    NFSPROC_T *, struct nfsvattr *, int *, void *);
+    NFSPROC_T *, struct nfsvattr *, int *);
 int nfsrpc_lookup(vnode_t, char *, int, struct ucred *, NFSPROC_T *,
     struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *,
     void *, uint32_t);
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index b785446b1ae6..02205802dc16 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -281,8 +281,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred,
 	/*
 	 * Now, just call nfsrpc_accessrpc() to do the actual RPC.
 	 */
-	error = nfsrpc_accessrpc(vp, mode, cred, p, nap, attrflagp, &rmode,
-	    NULL);
+	error = nfsrpc_accessrpc(vp, mode, cred, p, nap, attrflagp, &rmode);
 
 	/*
 	 * The NFS V3 spec does not clarify whether or not
@@ -299,8 +298,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred,
  */
 int
 nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred,
-    NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep,
-    void *stuff)
+    NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep)
 {
 	u_int32_t *tl;
 	u_int32_t supported, rmode;
@@ -1204,7 +1202,7 @@ nfsmout:
  */
 int
 nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
-    struct nfsvattr *nap, void *stuff)
+    struct nfsvattr *nap)
 {
 	struct nfsrv_descript nfsd, *nd = &nfsd;
 	int error;
@@ -1271,8 +1269,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred,
  */
 int
 nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp,
-    struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp,
-    void *stuff)
+    struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp)
 {
 	int error, expireret = 0, openerr, retrycnt;
 	u_int32_t clidrev = 0, mode;
@@ -5036,7 +5033,7 @@ nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
 
 	if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp))
 		return (EOPNOTSUPP);
-	error = nfsrpc_setattr(vp, NULL, aclp, cred, p, NULL, NULL, stuff);
+	error = nfsrpc_setattr(vp, NULL, aclp, cred, p, NULL, NULL);
 	return (error);
 }
 
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index af48b5036969..10f6cae17a65 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -407,7 +407,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct thread *td,
 	struct nfsvattr nfsva;
 
 	error = nfsrpc_accessrpc(vp, wmode, cred, td, &nfsva, &attrflag,
-	    &rmode, NULL);
+	    &rmode);
 	if (attrflag)
 		(void) nfscl_loadattrcache(&vp, &nfsva, NULL, 0, 1);
 	if (!error) {
@@ -948,8 +948,7 @@ nfs_close(struct vop_close_args *ap)
 		if (error == 0 && nfscl_mustflush(vp) != 0 &&
 		    vp->v_type == VREG &&
 		    (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOCTO) == 0) {
-			ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva,
-			    NULL);
+			ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva);
 			if (!ret) {
 				np->n_change = nfsva.na_filerev;
 				(void) nfscl_loadattrcache(&vp, &nfsva, NULL,
@@ -1029,7 +1028,7 @@ nfs_getattr(struct vop_getattr_args *ap)
 			return (0);
 		}
 	}
-	error = nfsrpc_getattr(vp, ap->a_cred, td, &nfsva, NULL);
+	error = nfsrpc_getattr(vp, ap->a_cred, td, &nfsva);
 	if (!error)
 		error = nfscl_loadattrcache(&vp, &nfsva, vap, 0, 0);
 	if (!error) {
@@ -1186,8 +1185,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
 		NFSUNLOCKNODE(np);
 		KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
 	}
-	error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag,
-	    NULL);
+	error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag);
 	if (attrflag) {
 		ret = nfscl_loadattrcache(&vp, &nfsva, NULL, 0, 1);
 		if (ret && !error)
@@ -1806,8 +1804,8 @@ again:
 	if (!error) {
 		newvp = NFSTOV(np);
 		if (attrflag == 0)
-			error = nfsrpc_getattr(newvp, cnp->cn_cred,
-			    curthread, &nfsva, NULL);
+			error = nfsrpc_getattr(newvp, cnp->cn_cred, curthread,
+			    &nfsva);
 		if (error == 0)
 			error = nfscl_loadattrcache(&newvp, &nfsva, NULL, 0, 1);
 	}
@@ -1824,15 +1822,14 @@ again:
 	} else if (NFS_ISV34(dvp) && (fmode & O_EXCL)) {
 		if (nfscl_checksattr(vap, &nfsva)) {
 			error = nfsrpc_setattr(newvp, vap, NULL, cnp->cn_cred,
-			    curthread, &nfsva, &attrflag, NULL);
+			    curthread, &nfsva, &attrflag);
 			if (error && (vap->va_uid != (uid_t)VNOVAL ||
 			    vap->va_gid != (gid_t)VNOVAL)) {
 				/* try again without setting uid/gid */
 				vap->va_uid = (uid_t)VNOVAL;
 				vap->va_gid = (uid_t)VNOVAL;
 				error = nfsrpc_setattr(newvp, vap, NULL, 
-				    cnp->cn_cred, curthread, &nfsva,
-				    &attrflag, NULL);
+				    cnp->cn_cred, curthread, &nfsva, &attrflag);
 			}
 			if (attrflag)
 				(void) nfscl_loadattrcache(&newvp, &nfsva, NULL,