sunrpc: properly type pc_encode callbacks
Drop the resp argument as it can trivially be derived from the rqstp argument. With that all functions now have the same prototype, and we can remove the unsafe casting to kxdrproc_t. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
@@ -200,8 +200,10 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p)
|
||||
}
|
||||
|
||||
int
|
||||
nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
|
||||
nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p)
|
||||
{
|
||||
struct nlm_res *resp = rqstp->rq_resp;
|
||||
|
||||
if (!(p = nlm_encode_testres(p, resp)))
|
||||
return 0;
|
||||
return xdr_ressize_check(rqstp, p);
|
||||
@@ -280,8 +282,10 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p)
|
||||
}
|
||||
|
||||
int
|
||||
nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
|
||||
nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p)
|
||||
{
|
||||
struct nlm_res *resp = rqstp->rq_resp;
|
||||
|
||||
if (!(p = nlm_encode_cookie(p, &resp->cookie)))
|
||||
return 0;
|
||||
*p++ = resp->status;
|
||||
@@ -290,8 +294,10 @@ nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
|
||||
}
|
||||
|
||||
int
|
||||
nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
|
||||
nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p)
|
||||
{
|
||||
struct nlm_res *resp = rqstp->rq_resp;
|
||||
|
||||
if (!(p = nlm_encode_cookie(p, &resp->cookie)))
|
||||
return 0;
|
||||
*p++ = resp->status;
|
||||
@@ -342,7 +348,7 @@ nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p)
|
||||
}
|
||||
|
||||
int
|
||||
nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
|
||||
nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p)
|
||||
{
|
||||
return xdr_ressize_check(rqstp, p);
|
||||
}
|
||||
|
Reference in New Issue
Block a user