Skip to content

Commit fcef2af

Browse files
committed
SUNRPC: Hoist init_encode out of svc_authenticate()
Now that each ->accept method has been converted, the svcxdr_init_encode() calls can be hoisted back up into the generic RPC server code. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 72a1e53 commit fcef2af

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,6 @@ svcauth_gss_accept(struct svc_rqst *rqstp)
15891589
int ret;
15901590
struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id);
15911591

1592-
svcxdr_init_encode(rqstp);
1593-
15941592
rqstp->rq_auth_stat = rpc_autherr_badcred;
15951593
if (!svcdata)
15961594
svcdata = kmalloc(sizeof(*svcdata), GFP_KERNEL);

net/sunrpc/svc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *resv)
12621262
if (rqstp->rq_prog == progp->pg_prog)
12631263
break;
12641264

1265+
svcxdr_init_encode(rqstp);
1266+
12651267
/*
12661268
* Decode auth data, and add verifier to reply buffer.
12671269
* We do this before anything else in order to get a decent

net/sunrpc/svcauth_unix.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ svcauth_null_accept(struct svc_rqst *rqstp)
772772
if (cred->cr_group_info == NULL)
773773
return SVC_CLOSE; /* kmalloc failure - client must retry */
774774

775-
svcxdr_init_encode(rqstp);
776775
if (xdr_stream_encode_opaque_auth(&rqstp->rq_res_stream,
777776
RPC_AUTH_NULL, NULL, 0) < 0)
778777
return SVC_CLOSE;
@@ -855,7 +854,6 @@ svcauth_tls_accept(struct svc_rqst *rqstp)
855854
if (cred->cr_group_info == NULL)
856855
return SVC_CLOSE;
857856

858-
svcxdr_init_encode(rqstp);
859857
if (rqstp->rq_xprt->xpt_ops->xpo_start_tls) {
860858
p = xdr_reserve_space(&rqstp->rq_res_stream, XDR_UNIT * 2 + 8);
861859
if (!p)
@@ -959,7 +957,6 @@ svcauth_unix_accept(struct svc_rqst *rqstp)
959957
return SVC_DENIED;
960958
}
961959

962-
svcxdr_init_encode(rqstp);
963960
if (xdr_stream_encode_opaque_auth(&rqstp->rq_res_stream,
964961
RPC_AUTH_NULL, NULL, 0) < 0)
965962
return SVC_CLOSE;

0 commit comments

Comments
 (0)