git: 38c3cf6aedec - main - nfscl: Clean up the code by removing unused arguments

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Sun, 10 Apr 2022 01:55:10 UTC
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=38c3cf6aedecf50a3e3d4d4daaebfe2c1db32e2a

commit 38c3cf6aedecf50a3e3d4d4daaebfe2c1db32e2a
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-04-10 01:53:25 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-04-10 01:53:25 +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 nfscl_postop_attr().
    Future commits will do the same for other functions.
---
 sys/fs/nfs/nfs_var.h            |  3 +--
 sys/fs/nfsclient/nfs_clport.c   |  5 ++---
 sys/fs/nfsclient/nfs_clrpcops.c | 41 +++++++++++++++++++----------------------
 3 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index 0af1daa429cf..8feb900af67e 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -373,8 +373,7 @@ u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *);
 int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **);
 int nfscl_mtofh(struct nfsrv_descript *, struct nfsfh **,
         struct nfsvattr *, int *);
-int nfscl_postop_attr(struct nfsrv_descript *, struct nfsvattr *, int *,
-    void *);
+int nfscl_postop_attr(struct nfsrv_descript *, struct nfsvattr *, int *);
 int nfscl_wcc_data(struct nfsrv_descript *, vnode_t,
     struct nfsvattr *, int *, int *, uint64_t *);
 int nfsm_loadattr(struct nfsrv_descript *, struct nfsvattr *);
diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
index e9deb7bb7f88..34f83b09d9e9 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -804,7 +804,7 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode *vp,
 				NFSUNLOCKNODE(np);
 			}
 		}
-		error = nfscl_postop_attr(nd, nap, flagp, NULL);
+		error = nfscl_postop_attr(nd, nap, flagp);
 		if (wccflagp != NULL && *flagp == 0)
 			*wccflagp = 0;
 	} else if ((nd->nd_flag & (ND_NOMOREDATA | ND_NFSV4 | ND_V4WCCATTR))
@@ -840,8 +840,7 @@ nfsmout:
  * Get postop attributes.
  */
 int
-nfscl_postop_attr(struct nfsrv_descript *nd, struct nfsvattr *nap, int *retp,
-    void *stuff)
+nfscl_postop_attr(struct nfsrv_descript *nd, struct nfsvattr *nap, int *retp)
 {
 	u_int32_t *tl;
 	int error = 0;
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 3029875df986..25890b7c8699 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -326,7 +326,7 @@ nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred,
 	if (error)
 		return (error);
 	if (nd->nd_flag & ND_NFSV3) {
-		error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+		error = nfscl_postop_attr(nd, nap, attrflagp);
 		if (error)
 			goto nfsmout;
 	}
@@ -339,7 +339,7 @@ nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred,
 		}
 		rmode = fxdr_unsigned(u_int32_t, *tl);
 		if (nd->nd_flag & ND_NFSV4)
-			error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+			error = nfscl_postop_attr(nd, nap, attrflagp);
 
 		/*
 		 * It's not obvious what should be done about
@@ -1382,7 +1382,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap,
 	if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4 && !error)
 		error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL);
 	if (!(nd->nd_flag & ND_NFSV3) && !nd->nd_repstat && !error)
-		error = nfscl_postop_attr(nd, rnap, attrflagp, stuff);
+		error = nfscl_postop_attr(nd, rnap, attrflagp);
 	m_freem(nd->nd_mrep);
 	if (nd->nd_repstat && !error)
 		error = nd->nd_repstat;
@@ -1494,7 +1494,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred,
 		    return (0);
 		}
 		if (nd->nd_flag & ND_NFSV3)
-		    error = nfscl_postop_attr(nd, dnap, dattrflagp, stuff);
+		    error = nfscl_postop_attr(nd, dnap, dattrflagp);
 		else if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) ==
 		    ND_NFSV4) {
 			/* Load the directory attributes. */
@@ -1548,7 +1548,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred,
 	if (error)
 		goto nfsmout;
 
-	error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+	error = nfscl_postop_attr(nd, nap, attrflagp);
 	if (openmode != 0 && error == 0) {
 		NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID +
 		    10 * NFSX_UNSIGNED);
@@ -1621,7 +1621,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred,
 		}
 	}
 	if ((nd->nd_flag & ND_NFSV3) && !error)
-		error = nfscl_postop_attr(nd, dnap, dattrflagp, stuff);
+		error = nfscl_postop_attr(nd, dnap, dattrflagp);
 nfsmout:
 	m_freem(nd->nd_mrep);
 	if (!error && nd->nd_repstat)
@@ -1658,7 +1658,7 @@ nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred,
 	if (error)
 		return (error);
 	if (nd->nd_flag & ND_NFSV3)
-		error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+		error = nfscl_postop_attr(nd, nap, attrflagp);
 	if (!nd->nd_repstat && !error) {
 		NFSM_STRSIZ(len, NFS_MAXPATHLEN);
 		/*
@@ -1677,7 +1677,7 @@ nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred,
 		}
 		error = nfsm_mbufuio(nd, uiop, len);
 		if ((nd->nd_flag & ND_NFSV4) && !error && cangetattr)
-			error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+			error = nfscl_postop_attr(nd, nap, attrflagp);
 	}
 	if (nd->nd_repstat && !error)
 		error = nd->nd_repstat;
@@ -1801,7 +1801,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct ucred *cred,
 		if (error)
 			return (error);
 		if (nd->nd_flag & ND_NFSV3) {
-			error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+			error = nfscl_postop_attr(nd, nap, attrflagp);
 		} else if (!nd->nd_repstat && (nd->nd_flag & ND_NFSV2)) {
 			error = nfsm_loadattr(nd, nap);
 			if (!error)
@@ -2940,7 +2940,7 @@ nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen,
 	if (error)
 		return (error);
 	if (nd->nd_flag & ND_NFSV3) {
-		error = nfscl_postop_attr(nd, nap, attrflagp, dstuff);
+		error = nfscl_postop_attr(nd, nap, attrflagp);
 		if (!error)
 			error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp,
 			    NULL, NULL);
@@ -3389,8 +3389,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
 			return (error);
 		if (!(nd->nd_flag & ND_NFSV2)) {
 			if (nd->nd_flag & ND_NFSV3)
-				error = nfscl_postop_attr(nd, nap, attrflagp,
-				    stuff);
+				error = nfscl_postop_attr(nd, nap, attrflagp);
 			if (!nd->nd_repstat && !error) {
 				NFSM_DISSECT(tl, u_int32_t *, NFSX_HYPER);
 				NFSLOCKNODE(dnp);
@@ -3544,8 +3543,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
 			if (tryformoredirs)
 				more_dirs = !eof;
 			if (nd->nd_flag & ND_NFSV4) {
-				error = nfscl_postop_attr(nd, nap, attrflagp,
-				    stuff);
+				error = nfscl_postop_attr(nd, nap, attrflagp);
 				if (error)
 					goto nfsmout;
 			}
@@ -3830,7 +3828,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
 		if (error)
 			return (error);
 		if (nd->nd_flag & ND_NFSV3)
-			error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+			error = nfscl_postop_attr(nd, nap, attrflagp);
 		if (nd->nd_repstat || error) {
 			if (!error)
 				error = nd->nd_repstat;
@@ -4082,8 +4080,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
 			if (tryformoredirs)
 				more_dirs = !eof;
 			if (nd->nd_flag & ND_NFSV4) {
-				error = nfscl_postop_attr(nd, nap, attrflagp,
-				    stuff);
+				error = nfscl_postop_attr(nd, nap, attrflagp);
 				if (error)
 					goto nfsmout;
 			}
@@ -4187,7 +4184,7 @@ nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred,
 		}
 		NFSUNLOCKMNT(nmp);
 		if (nd->nd_flag & ND_NFSV4)
-			error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+			error = nfscl_postop_attr(nd, nap, attrflagp);
 	}
 nfsmout:
 	if (!error && nd->nd_repstat)
@@ -4626,7 +4623,7 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp,
 		if (error)
 			return (error);
 		if (nd->nd_flag & ND_NFSV3) {
-			error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+			error = nfscl_postop_attr(nd, nap, attrflagp);
 			if (error)
 				goto nfsmout;
 		}
@@ -4698,7 +4695,7 @@ nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
 		error = nfscl_request(nd, vp, p, cred, stuff);
 		if (error)
 			return (error);
-		error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+		error = nfscl_postop_attr(nd, nap, attrflagp);
 		if (nd->nd_repstat && !error)
 			error = nd->nd_repstat;
 		if (!error) {
@@ -4734,7 +4731,7 @@ nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred,
 	error = nfscl_request(nd, vp, p, cred, stuff);
 	if (error)
 		return (error);
-	error = nfscl_postop_attr(nd, nap, attrflagp, stuff);
+	error = nfscl_postop_attr(nd, nap, attrflagp);
 	if (nd->nd_repstat && !error)
 		error = nd->nd_repstat;
 	if (!error) {
@@ -6692,7 +6689,7 @@ nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4stateid_t *stateidp, int *eofp,
 	if (error != 0)
 		return (error);
 	if (vers == NFS_VER3) {
-		error = nfscl_postop_attr(nd, &na, &attrflag, NULL);
+		error = nfscl_postop_attr(nd, &na, &attrflag);
 		NFSCL_DEBUG(4, "nfsrpc_readds: postop=%d\n", error);
 		if (error != 0)
 			goto nfsmout;