From: Ashok Vairavan Date: Sun, 4 Feb 2018 02:18:36 +0000 (-0800) Subject: Revert "block: Copy a user iovec if it includes gaps" X-Git-Tag: v4.1.12-124.31.3~1202 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=94b5662cd75dec6fe9c9b546cd21daade2085079;p=users%2Fjedix%2Flinux-maple.git Revert "block: Copy a user iovec if it includes gaps" This reverts commit cc500383c29a734102683003e2485dac6c6a0f05. In UEK4, the decision is made to do complete switch to queue_virt_boundary discarding the use of SG_GAPS flags. Hence, this partial porting of new queue limit mask is reverted. Also, this partial patch is broken for stacked devices. Orabug: 27484719 Signed-off-by: Ashok Vairavan Reviewed-by: Kyle Fortin --- diff --git a/block/blk-map.c b/block/blk-map.c index 55979c98b18a..fd36d3742b94 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -9,24 +9,6 @@ #include "blk.h" -static bool iovec_gap_to_prv(struct request_queue *q, - struct iovec *prv, struct iovec *cur) -{ - unsigned long prev_end; - - if (!queue_virt_boundary(q)) - return false; - - if (prv->iov_base == NULL && prv->iov_len == 0) - /* prv is not set - don't check */ - return false; - - prev_end = (unsigned long)(prv->iov_base + prv->iov_len); - - return (((unsigned long)cur->iov_base & queue_virt_boundary(q)) || - prev_end & queue_virt_boundary(q)); -} - int blk_rq_append_bio(struct request_queue *q, struct request *rq, struct bio *bio) { @@ -85,7 +67,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, struct bio *bio; int unaligned = 0; struct iov_iter i; - struct iovec iov, prv = {.iov_base = NULL, .iov_len = 0}; + struct iovec iov; if (!iter || !iter->count) return -EINVAL; @@ -104,12 +86,8 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, /* * Keep going so we check length of all segments */ - if ((uaddr & queue_dma_alignment(q)) || - iovec_gap_to_prv(q, &prv, &iov)) + if (uaddr & queue_dma_alignment(q)) unaligned = 1; - - prv.iov_base = iov.iov_base; - prv.iov_len = iov.iov_len; } if (unaligned || (q->dma_pad_mask & iter->count) || map_data)