aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2017-06-08 11:53:16 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-07-13 16:00:13 -0400
commitd933cc32019063fc4beb8b20528ca724bd1b7a52 (patch)
treecacecb76cf7ccaa4a9b3a72cc1032348c34ed530 /net
parente2f6ef09156284e35f780be47559809753d4b499 (diff)
xprtrdma: Replace PAGE_MASK with offset_in_page()
Clean up. Reported by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprtrdma/rpc_rdma.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
index b6584ae8e251..ca4d6e4528f3 100644
--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -141,7 +141,7 @@ static bool rpcrdma_args_inline(struct rpcrdma_xprt *r_xprt,
141 141
142 if (xdr->page_len) { 142 if (xdr->page_len) {
143 remaining = xdr->page_len; 143 remaining = xdr->page_len;
144 offset = xdr->page_base & ~PAGE_MASK; 144 offset = offset_in_page(xdr->page_base);
145 count = 0; 145 count = 0;
146 while (remaining) { 146 while (remaining) {
147 remaining -= min_t(unsigned int, 147 remaining -= min_t(unsigned int,
@@ -222,7 +222,7 @@ rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf,
222 222
223 len = xdrbuf->page_len; 223 len = xdrbuf->page_len;
224 ppages = xdrbuf->pages + (xdrbuf->page_base >> PAGE_SHIFT); 224 ppages = xdrbuf->pages + (xdrbuf->page_base >> PAGE_SHIFT);
225 page_base = xdrbuf->page_base & ~PAGE_MASK; 225 page_base = offset_in_page(xdrbuf->page_base);
226 p = 0; 226 p = 0;
227 while (len && n < RPCRDMA_MAX_SEGS) { 227 while (len && n < RPCRDMA_MAX_SEGS) {
228 if (!ppages[p]) { 228 if (!ppages[p]) {
@@ -540,7 +540,7 @@ rpcrdma_prepare_msg_sges(struct rpcrdma_ia *ia, struct rpcrdma_req *req,
540 goto out; 540 goto out;
541 541
542 page = virt_to_page(xdr->tail[0].iov_base); 542 page = virt_to_page(xdr->tail[0].iov_base);
543 page_base = (unsigned long)xdr->tail[0].iov_base & ~PAGE_MASK; 543 page_base = offset_in_page(xdr->tail[0].iov_base);
544 544
545 /* If the content in the page list is an odd length, 545 /* If the content in the page list is an odd length,
546 * xdr_write_pages() has added a pad at the beginning 546 * xdr_write_pages() has added a pad at the beginning
@@ -557,7 +557,7 @@ rpcrdma_prepare_msg_sges(struct rpcrdma_ia *ia, struct rpcrdma_req *req,
557 */ 557 */
558 if (xdr->page_len) { 558 if (xdr->page_len) {
559 ppages = xdr->pages + (xdr->page_base >> PAGE_SHIFT); 559 ppages = xdr->pages + (xdr->page_base >> PAGE_SHIFT);
560 page_base = xdr->page_base & ~PAGE_MASK; 560 page_base = offset_in_page(xdr->page_base);
561 remaining = xdr->page_len; 561 remaining = xdr->page_len;
562 while (remaining) { 562 while (remaining) {
563 sge_no++; 563 sge_no++;
@@ -587,7 +587,7 @@ rpcrdma_prepare_msg_sges(struct rpcrdma_ia *ia, struct rpcrdma_req *req,
587 */ 587 */
588 if (xdr->tail[0].iov_len) { 588 if (xdr->tail[0].iov_len) {
589 page = virt_to_page(xdr->tail[0].iov_base); 589 page = virt_to_page(xdr->tail[0].iov_base);
590 page_base = (unsigned long)xdr->tail[0].iov_base & ~PAGE_MASK; 590 page_base = offset_in_page(xdr->tail[0].iov_base);
591 len = xdr->tail[0].iov_len; 591 len = xdr->tail[0].iov_len;
592 592
593map_tail: 593map_tail:
@@ -878,9 +878,9 @@ rpcrdma_inline_fixup(struct rpc_rqst *rqst, char *srcp, int copy_len, int pad)
878 srcp += curlen; 878 srcp += curlen;
879 copy_len -= curlen; 879 copy_len -= curlen;
880 880
881 page_base = rqst->rq_rcv_buf.page_base; 881 ppages = rqst->rq_rcv_buf.pages +
882 ppages = rqst->rq_rcv_buf.pages + (page_base >> PAGE_SHIFT); 882 (rqst->rq_rcv_buf.page_base >> PAGE_SHIFT);
883 page_base &= ~PAGE_MASK; 883 page_base = offset_in_page(rqst->rq_rcv_buf.page_base);
884 fixup_copy_count = 0; 884 fixup_copy_count = 0;
885 if (copy_len && rqst->rq_rcv_buf.page_len) { 885 if (copy_len && rqst->rq_rcv_buf.page_len) {
886 int pagelist_len; 886 int pagelist_len;