Commit 09426ef2 authored by Chuck Lever's avatar Chuck Lever

NFSD: Shrink size of struct nfsd4_copy_notify

struct nfsd4_copy_notify is part of struct nfsd4_op, which resides
in an 8-element array.

sizeof(struct nfsd4_op):
Before: /* size: 2208, cachelines: 35, members: 5 */
After:  /* size: 1696, cachelines: 27, members: 5 */
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent bb4d8427
...@@ -1953,9 +1953,9 @@ nfsd4_copy_notify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -1953,9 +1953,9 @@ nfsd4_copy_notify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
/* For now, only return one server address in cpn_src, the /* For now, only return one server address in cpn_src, the
* address used by the client to connect to this server. * address used by the client to connect to this server.
*/ */
cn->cpn_src.nl4_type = NL4_NETADDR; cn->cpn_src->nl4_type = NL4_NETADDR;
status = nfsd4_set_netaddr((struct sockaddr *)&rqstp->rq_daddr, status = nfsd4_set_netaddr((struct sockaddr *)&rqstp->rq_daddr,
&cn->cpn_src.u.nl4_addr); &cn->cpn_src->u.nl4_addr);
WARN_ON_ONCE(status); WARN_ON_ONCE(status);
if (status) { if (status) {
nfs4_put_cpntf_state(nn, cps); nfs4_put_cpntf_state(nn, cps);
......
...@@ -1952,10 +1952,17 @@ nfsd4_decode_copy_notify(struct nfsd4_compoundargs *argp, ...@@ -1952,10 +1952,17 @@ nfsd4_decode_copy_notify(struct nfsd4_compoundargs *argp,
{ {
__be32 status; __be32 status;
cn->cpn_src = svcxdr_tmpalloc(argp, sizeof(*cn->cpn_src));
if (cn->cpn_src == NULL)
return nfserr_jukebox;
cn->cpn_dst = svcxdr_tmpalloc(argp, sizeof(*cn->cpn_dst));
if (cn->cpn_dst == NULL)
return nfserr_jukebox;
status = nfsd4_decode_stateid4(argp, &cn->cpn_src_stateid); status = nfsd4_decode_stateid4(argp, &cn->cpn_src_stateid);
if (status) if (status)
return status; return status;
return nfsd4_decode_nl4_server(argp, &cn->cpn_dst); return nfsd4_decode_nl4_server(argp, cn->cpn_dst);
} }
static __be32 static __be32
...@@ -4898,7 +4905,8 @@ nfsd4_encode_copy_notify(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -4898,7 +4905,8 @@ nfsd4_encode_copy_notify(struct nfsd4_compoundres *resp, __be32 nfserr,
*p++ = cpu_to_be32(1); *p++ = cpu_to_be32(1);
return nfsd42_encode_nl4_server(resp, &cn->cpn_src); nfserr = nfsd42_encode_nl4_server(resp, cn->cpn_src);
return nfserr;
} }
static __be32 static __be32
......
...@@ -595,13 +595,13 @@ struct nfsd4_offload_status { ...@@ -595,13 +595,13 @@ struct nfsd4_offload_status {
struct nfsd4_copy_notify { struct nfsd4_copy_notify {
/* request */ /* request */
stateid_t cpn_src_stateid; stateid_t cpn_src_stateid;
struct nl4_server cpn_dst; struct nl4_server *cpn_dst;
/* response */ /* response */
stateid_t cpn_cnr_stateid; stateid_t cpn_cnr_stateid;
u64 cpn_sec; u64 cpn_sec;
u32 cpn_nsec; u32 cpn_nsec;
struct nl4_server cpn_src; struct nl4_server *cpn_src;
}; };
struct nfsd4_op { struct nfsd4_op {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment