Skip to content

Commit 5df2567

Browse files
committed
SUNRPC: Remove no-longer-used helper functions
The svc_get/put helpers are no longer used. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 5f69d5f commit 5df2567

File tree

1 file changed

+1
-65
lines changed
  • include/linux/sunrpc

1 file changed

+1
-65
lines changed

include/linux/sunrpc/svc.h

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -193,40 +193,6 @@ extern u32 svc_max_payload(const struct svc_rqst *rqstp);
193193
#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE \
194194
+ 2 + 1)
195195

196-
static inline u32 svc_getnl(struct kvec *iov)
197-
{
198-
__be32 val, *vp;
199-
vp = iov->iov_base;
200-
val = *vp++;
201-
iov->iov_base = (void*)vp;
202-
iov->iov_len -= sizeof(__be32);
203-
return ntohl(val);
204-
}
205-
206-
static inline void svc_putnl(struct kvec *iov, u32 val)
207-
{
208-
__be32 *vp = iov->iov_base + iov->iov_len;
209-
*vp = htonl(val);
210-
iov->iov_len += sizeof(__be32);
211-
}
212-
213-
static inline __be32 svc_getu32(struct kvec *iov)
214-
{
215-
__be32 val, *vp;
216-
vp = iov->iov_base;
217-
val = *vp++;
218-
iov->iov_base = (void*)vp;
219-
iov->iov_len -= sizeof(__be32);
220-
return val;
221-
}
222-
223-
static inline void svc_putu32(struct kvec *iov, __be32 val)
224-
{
225-
__be32 *vp = iov->iov_base + iov->iov_len;
226-
*vp = val;
227-
iov->iov_len += sizeof(__be32);
228-
}
229-
230196
/*
231197
* The context of a single thread, including the request currently being
232198
* processed.
@@ -345,29 +311,6 @@ static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst)
345311
return (struct sockaddr *) &rqst->rq_daddr;
346312
}
347313

348-
/*
349-
* Check buffer bounds after decoding arguments
350-
*/
351-
static inline int
352-
xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p)
353-
{
354-
char *cp = (char *)p;
355-
struct kvec *vec = &rqstp->rq_arg.head[0];
356-
return cp >= (char*)vec->iov_base
357-
&& cp <= (char*)vec->iov_base + vec->iov_len;
358-
}
359-
360-
static inline int
361-
xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p)
362-
{
363-
struct kvec *vec = &rqstp->rq_res.head[0];
364-
char *cp = (char*)p;
365-
366-
vec->iov_len = cp - (char*)vec->iov_base;
367-
368-
return vec->iov_len <= PAGE_SIZE;
369-
}
370-
371314
static inline void svc_free_res_pages(struct svc_rqst *rqstp)
372315
{
373316
while (rqstp->rq_next_page != rqstp->rq_respages) {
@@ -540,21 +483,14 @@ static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
540483
* svcxdr_init_decode - Prepare an xdr_stream for Call decoding
541484
* @rqstp: controlling server RPC transaction context
542485
*
543-
* This function currently assumes the RPC header in rq_arg has
544-
* already been decoded. Upon return, xdr->p points to the
545-
* location of the upper layer header.
546486
*/
547487
static inline void svcxdr_init_decode(struct svc_rqst *rqstp)
548488
{
549489
struct xdr_stream *xdr = &rqstp->rq_arg_stream;
550490
struct xdr_buf *buf = &rqstp->rq_arg;
551491
struct kvec *argv = buf->head;
552492

553-
/*
554-
* svc_getnl() and friends do not keep the xdr_buf's ::len
555-
* field up to date. Refresh that field before initializing
556-
* the argument decoding stream.
557-
*/
493+
WARN_ON(buf->len != buf->head->iov_len + buf->page_len + buf->tail->iov_len);
558494
buf->len = buf->head->iov_len + buf->page_len + buf->tail->iov_len;
559495

560496
xdr_init_decode(xdr, buf, argv->iov_base, NULL);

0 commit comments

Comments
 (0)