aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-09-24 09:43:49 +0200
committerJens Axboe <axboe@kernel.dk>2018-09-24 12:33:53 -0600
commit27ca1d4ed04ea29dc77b47190a3cc82697023e76 (patch)
tree8b69a5b53cc879fcb683ef026b092edd53b65bde /block
parentblock: move req_gap_{back,front}_merge to blk-merge.c (diff)
downloadlinux-dev-27ca1d4ed04ea29dc77b47190a3cc82697023e76.tar.xz
linux-dev-27ca1d4ed04ea29dc77b47190a3cc82697023e76.zip
block: move req_gap_back_merge to blk.h
No need to expose these helpers outside the block layer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/block/blk.h b/block/blk.h
index 441c2de1d4b9..63035c95689c 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -149,6 +149,25 @@ static inline void blk_queue_enter_live(struct request_queue *q)
percpu_ref_get(&q->q_usage_counter);
}
+static inline bool __bvec_gap_to_prev(struct request_queue *q,
+ struct bio_vec *bprv, unsigned int offset)
+{
+ return offset ||
+ ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
+}
+
+/*
+ * Check if adding a bio_vec after bprv with offset would create a gap in
+ * the SG list. Most drivers don't care about this, but some do.
+ */
+static inline bool bvec_gap_to_prev(struct request_queue *q,
+ struct bio_vec *bprv, unsigned int offset)
+{
+ if (!queue_virt_boundary(q))
+ return false;
+ return __bvec_gap_to_prev(q, bprv, offset);
+}
+
#ifdef CONFIG_BLK_DEV_INTEGRITY
void blk_flush_integrity(void);
bool __bio_integrity_endio(struct bio *);