@@ -43,6 +43,11 @@ int blk_rq_map_integrity_sg(struct request_queue *, struct bio *,
struct scatterlist *);
int blk_rq_count_integrity_sg(struct request_queue *, struct bio *);
+static inline unsigned short blk_rq_nr_integrity_segments(struct request *rq)
+{
+ return rq->nr_integrity_segments;
+}
+
static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
{
struct blk_integrity *bi = &disk->queue->integrity;
@@ -120,6 +125,10 @@ static inline int blk_rq_count_integrity_sg(struct request_queue *q,
{
return 0;
}
+static inline unsigned short blk_rq_nr_integrity_segments(struct request *rq)
+{
+ return 0;
+}
static inline int blk_rq_map_integrity_sg(struct request_queue *q,
struct bio *b,
struct scatterlist *s)
Since request always has the number of integrity segments in the process of generating and merging, a function for simply obtained this has been added. Cc: Christoph Hellwig <hch@lst.de> Cc: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com> --- include/linux/blk-integrity.h | 9 +++++++++ 1 file changed, 9 insertions(+)