summaryrefslogtreecommitdiffstats
path: root/block/blk-integrity.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-09-24 09:43:52 +0200
committerJens Axboe <axboe@kernel.dk>2018-09-24 20:33:57 +0200
commit3dccdae54fe836a22cee9dc6df9fd1708ae075ce (patch)
tree95d8808538de6f977086e2603d75694d7c1848bc /block/blk-integrity.c
parentblock: add a missing BIOVEC_SEG_BOUNDARY check in bio_add_pc_page (diff)
downloadlinux-3dccdae54fe836a22cee9dc6df9fd1708ae075ce.tar.xz
linux-3dccdae54fe836a22cee9dc6df9fd1708ae075ce.zip
block: merge BIOVEC_SEG_BOUNDARY into biovec_phys_mergeable
These two checks should always be performed together, so merge them into a single helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-integrity.c')
-rw-r--r--block/blk-integrity.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 0f7267916509..d1ab089e0919 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -49,12 +49,8 @@ int blk_rq_count_integrity_sg(struct request_queue *q, struct bio *bio)
bio_for_each_integrity_vec(iv, bio, iter) {
if (prev) {
- if (!biovec_phys_mergeable(&ivprv, &iv))
+ if (!biovec_phys_mergeable(q, &ivprv, &iv))
goto new_segment;
-
- if (!BIOVEC_SEG_BOUNDARY(q, &ivprv, &iv))
- goto new_segment;
-
if (seg_size + iv.bv_len > queue_max_segment_size(q))
goto new_segment;
@@ -95,12 +91,8 @@ int blk_rq_map_integrity_sg(struct request_queue *q, struct bio *bio,
bio_for_each_integrity_vec(iv, bio, iter) {
if (prev) {
- if (!biovec_phys_mergeable(&ivprv, &iv))
+ if (!biovec_phys_mergeable(q, &ivprv, &iv))
goto new_segment;
-
- if (!BIOVEC_SEG_BOUNDARY(q, &ivprv, &iv))
- goto new_segment;
-
if (sg->length + iv.bv_len > queue_max_segment_size(q))
goto new_segment;