Commit ee5e0cb4 authored by Chuck Lever's avatar Chuck Lever Committed by Linus Torvalds

[PATCH] rename svc_get/putlong as svc_get/putu32

This renames the svc_getlong and svc_putlong macros as svc_getu32 and
svc_putu32.  this is simple clean up and is obviously correct.  it was
part of the patch that implements stricter type checking for rpc auth
flavors.
parent b9239fb2
......@@ -272,7 +272,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp, int type)
case RC_NOCACHE:
break;
case RC_REPLSTAT:
svc_putlong(&rqstp->rq_resbuf, rp->c_replstat);
svc_putu32(&rqstp->rq_resbuf, rp->c_replstat);
rtn = RC_REPLY;
break;
case RC_REPLBUFF:
......
......@@ -302,7 +302,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp)
}
if (rqstp->rq_proc != 0)
svc_putlong(&rqstp->rq_resbuf, nfserr);
svc_putu32(&rqstp->rq_resbuf, nfserr);
/* Encode result.
* For NFSv2, additional info is never returned in case of an error.
......
......@@ -82,8 +82,8 @@ struct svc_buf {
struct iovec iov[RPCSVC_MAXIOV];
int nriov;
};
#define svc_getlong(argp, val) { (val) = *(argp)->buf++; (argp)->len--; }
#define svc_putlong(resp, val) { *(resp)->buf++ = (val); (resp)->len++; }
#define svc_getu32(argp, val) { (val) = *(argp)->buf++; (argp)->len--; }
#define svc_putu32(resp, val) { *(resp)->buf++ = (val); (resp)->len++; }
/*
* The context of a single thread, including the request currently being
......
......@@ -247,8 +247,8 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
vers = ntohl(*bufp++);
/* First words of reply: */
svc_putlong(resp, xdr_one); /* REPLY */
svc_putlong(resp, xdr_zero); /* ACCEPT */
svc_putu32(resp, xdr_one); /* REPLY */
svc_putu32(resp, xdr_zero); /* ACCEPT */
if (dir != 0) /* direction != CALL */
goto err_bad_dir;
......@@ -300,7 +300,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
/* Build the reply header. */
statp = resp->buf;
svc_putlong(resp, rpc_success); /* RPC_SUCCESS */
svc_putu32(resp, rpc_success); /* RPC_SUCCESS */
/* Bump per-procedure stats counter */
procp->pc_count++;
......@@ -371,17 +371,17 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
err_bad_rpc:
serv->sv_stats->rpcbadfmt++;
resp->buf[-1] = xdr_one; /* REJECT */
svc_putlong(resp, xdr_zero); /* RPC_MISMATCH */
svc_putlong(resp, xdr_two); /* Only RPCv2 supported */
svc_putlong(resp, xdr_two);
svc_putu32(resp, xdr_zero); /* RPC_MISMATCH */
svc_putu32(resp, xdr_two); /* Only RPCv2 supported */
svc_putu32(resp, xdr_two);
goto sendit;
err_bad_auth:
dprintk("svc: authentication failed (%d)\n", ntohl(auth_stat));
serv->sv_stats->rpcbadauth++;
resp->buf[-1] = xdr_one; /* REJECT */
svc_putlong(resp, xdr_one); /* AUTH_ERROR */
svc_putlong(resp, auth_stat); /* status */
svc_putu32(resp, xdr_one); /* AUTH_ERROR */
svc_putu32(resp, auth_stat); /* status */
goto sendit;
err_bad_prog:
......@@ -391,7 +391,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
/* else it is just a Solaris client seeing if ACLs are supported */
#endif
serv->sv_stats->rpcbadfmt++;
svc_putlong(resp, rpc_prog_unavail);
svc_putu32(resp, rpc_prog_unavail);
goto sendit;
err_bad_vers:
......@@ -399,9 +399,9 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
printk("svc: unknown version (%d)\n", vers);
#endif
serv->sv_stats->rpcbadfmt++;
svc_putlong(resp, rpc_prog_mismatch);
svc_putlong(resp, htonl(progp->pg_lovers));
svc_putlong(resp, htonl(progp->pg_hivers));
svc_putu32(resp, rpc_prog_mismatch);
svc_putu32(resp, htonl(progp->pg_lovers));
svc_putu32(resp, htonl(progp->pg_hivers));
goto sendit;
err_bad_proc:
......@@ -409,7 +409,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
printk("svc: unknown procedure (%d)\n", proc);
#endif
serv->sv_stats->rpcbadfmt++;
svc_putlong(resp, rpc_proc_unavail);
svc_putu32(resp, rpc_proc_unavail);
goto sendit;
err_garbage:
......@@ -417,6 +417,6 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
printk("svc: failed to decode args\n");
#endif
serv->sv_stats->rpcbadfmt++;
svc_putlong(resp, rpc_garbage_args);
svc_putu32(resp, rpc_garbage_args);
goto sendit;
}
......@@ -48,7 +48,7 @@ svc_authenticate(struct svc_rqst *rqstp, u32 *statp, u32 *authp)
*statp = rpc_success;
*authp = rpc_auth_ok;
svc_getlong(&rqstp->rq_argbuf, flavor);
svc_getu32(&rqstp->rq_argbuf, flavor);
flavor = ntohl(flavor);
dprintk("svc: svc_authenticate (%d)\n", flavor);
......@@ -105,8 +105,8 @@ svcauth_null(struct svc_rqst *rqstp, u32 *statp, u32 *authp)
/* Put NULL verifier */
rqstp->rq_verfed = 1;
svc_putlong(resp, RPC_AUTH_NULL);
svc_putlong(resp, 0);
svc_putu32(resp, RPC_AUTH_NULL);
svc_putu32(resp, 0);
}
static void
......@@ -152,8 +152,8 @@ svcauth_unix(struct svc_rqst *rqstp, u32 *statp, u32 *authp)
/* Put NULL verifier */
rqstp->rq_verfed = 1;
svc_putlong(resp, RPC_AUTH_NULL);
svc_putlong(resp, 0);
svc_putu32(resp, RPC_AUTH_NULL);
svc_putu32(resp, 0);
return;
......
......@@ -1091,8 +1091,8 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
rqstp->rq_userset = 0;
rqstp->rq_verfed = 0;
svc_getlong(&rqstp->rq_argbuf, rqstp->rq_xid);
svc_putlong(&rqstp->rq_resbuf, rqstp->rq_xid);
svc_getu32(&rqstp->rq_argbuf, rqstp->rq_xid);
svc_putu32(&rqstp->rq_resbuf, rqstp->rq_xid);
/* Assume that the reply consists of a single buffer. */
rqstp->rq_resbuf.nriov = 1;
......
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