NFSD: Rename nfsd4_encode_fattr()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 18 Sep 2023 14:02:18 +0000 (10:02 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:27 +0000 (12:44 -0400)
For better alignment with the specification, NFSD's encoder function
name should match the name of the XDR data type.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4xdr.c

index 5c249d8..1bb03fc 100644 (file)
@@ -3471,10 +3471,10 @@ static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
  * ourselves.
  */
 static __be32
-nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
-               struct svc_export *exp,
-               struct dentry *dentry, const u32 *bmval,
-               struct svc_rqst *rqstp, int ignore_crossmnt)
+nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
+                   struct svc_fh *fhp, struct svc_export *exp,
+                   struct dentry *dentry, const u32 *bmval,
+                   int ignore_crossmnt)
 {
        struct nfsd4_fattr_args args;
        struct svc_fh *tempfh = NULL;
@@ -3592,11 +3592,13 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
        }
 #endif /* CONFIG_NFSD_V4_SECURITY_LABEL */
 
+       /* attrmask */
        status = nfsd4_encode_bitmap4(xdr, u.attrmask[0],
                                      u.attrmask[1], u.attrmask[2]);
        if (status)
                goto out;
 
+       /* attr_vals */
        attrlen_offset = xdr->buf->len;
        attrlen_p = xdr_reserve_space(xdr, XDR_UNIT);
        if (!attrlen_p)
@@ -3656,8 +3658,8 @@ __be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words,
        __be32 ret;
 
        svcxdr_init_encode_from_buffer(&xdr, &dummy, *p, words << 2);
-       ret = nfsd4_encode_fattr(&xdr, fhp, exp, dentry, bmval, rqstp,
-                                                       ignore_crossmnt);
+       ret = nfsd4_encode_fattr4(rqstp, &xdr, fhp, exp, dentry, bmval,
+                                 ignore_crossmnt);
        *p = xdr.p;
        return ret;
 }
@@ -3716,8 +3718,8 @@ nfsd4_encode_dirent_fattr(struct xdr_stream *xdr, struct nfsd4_readdir *cd,
 
        }
 out_encode:
-       nfserr = nfsd4_encode_fattr(xdr, NULL, exp, dentry, cd->rd_bmval,
-                                       cd->rd_rqstp, ignore_crossmnt);
+       nfserr = nfsd4_encode_fattr4(cd->rd_rqstp, xdr, NULL, exp, dentry,
+                                    cd->rd_bmval, ignore_crossmnt);
 out_put:
        dput(dentry);
        exp_put(exp);
@@ -3961,8 +3963,9 @@ nfsd4_encode_getattr(struct nfsd4_compoundres *resp, __be32 nfserr,
        struct svc_fh *fhp = getattr->ga_fhp;
        struct xdr_stream *xdr = resp->xdr;
 
-       return nfsd4_encode_fattr(xdr, fhp, fhp->fh_export, fhp->fh_dentry,
-                                   getattr->ga_bmval, resp->rqstp, 0);
+       /* obj_attributes */
+       return nfsd4_encode_fattr4(resp->rqstp, xdr, fhp, fhp->fh_export,
+                                  fhp->fh_dentry, getattr->ga_bmval, 0);
 }
 
 static __be32