|
@@ -1514,6 +1514,26 @@ queue_max_integrity_segments(struct request_queue *q)
|
|
|
return q->limits.max_integrity_segments;
|
|
|
}
|
|
|
|
|
|
+static inline bool integrity_req_gap_back_merge(struct request *req,
|
|
|
+ struct bio *next)
|
|
|
+{
|
|
|
+ struct bio_integrity_payload *bip = bio_integrity(req->bio);
|
|
|
+ struct bio_integrity_payload *bip_next = bio_integrity(next);
|
|
|
+
|
|
|
+ return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1],
|
|
|
+ bip_next->bip_vec[0].bv_offset);
|
|
|
+}
|
|
|
+
|
|
|
+static inline bool integrity_req_gap_front_merge(struct request *req,
|
|
|
+ struct bio *bio)
|
|
|
+{
|
|
|
+ struct bio_integrity_payload *bip = bio_integrity(bio);
|
|
|
+ struct bio_integrity_payload *bip_next = bio_integrity(req->bio);
|
|
|
+
|
|
|
+ return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1],
|
|
|
+ bip_next->bip_vec[0].bv_offset);
|
|
|
+}
|
|
|
+
|
|
|
#else /* CONFIG_BLK_DEV_INTEGRITY */
|
|
|
|
|
|
struct bio;
|
|
@@ -1580,6 +1600,16 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g)
|
|
|
{
|
|
|
return 0;
|
|
|
}
|
|
|
+static inline bool integrity_req_gap_back_merge(struct request *req,
|
|
|
+ struct bio *next)
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
+static inline bool integrity_req_gap_front_merge(struct request *req,
|
|
|
+ struct bio *bio)
|
|
|
+{
|
|
|
+ return false;
|
|
|
+}
|
|
|
|
|
|
#endif /* CONFIG_BLK_DEV_INTEGRITY */
|
|
|
|