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.
This commit is contained in:
Rick Macklem 2022-04-09 18:53:25 -07:00
parent c45d934f6b
commit 38c3cf6aed
3 changed files with 22 additions and 27 deletions

View File

@ -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 *);

View File

@ -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 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode *vp,
* 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;

View File

@ -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;