[v2,14/14] block: blk-integrity: remove blk_rq_count_integrity_sg()
Commit Message
blk_rq_nr_nr_integrity_segments() allows you to obtain the number of
integrity. Therefore, blk_rq_count_integrity_sg() is no longer necessary.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
---
block/blk-integrity.c | 39 -----------------------------------
include/linux/blk-integrity.h | 1 -
2 files changed, 40 deletions(-)
@@ -16,45 +16,6 @@
#include "blk.h"
-/**
- * blk_rq_count_integrity_sg - Count number of integrity scatterlist elements
- * @q: request queue
- * @bio: bio with integrity metadata attached
- *
- * Description: Returns the number of elements required in a
- * scatterlist corresponding to the integrity metadata in a bio.
- */
-int blk_rq_count_integrity_sg(struct request_queue *q, struct bio *bio)
-{
- struct bio_vec iv, ivprv = { NULL };
- unsigned int segments = 0;
- unsigned int seg_size = 0;
- struct bvec_iter iter;
- int prev = 0;
-
- bio_for_each_integrity_vec(iv, bio, iter) {
-
- if (prev) {
- if (!biovec_phys_mergeable(q, &ivprv, &iv))
- goto new_segment;
- if (seg_size + iv.bv_len > queue_max_segment_size(q))
- goto new_segment;
-
- seg_size += iv.bv_len;
- } else {
-new_segment:
- segments++;
- seg_size = iv.bv_len;
- }
-
- prev = 1;
- ivprv = iv;
- }
-
- return segments;
-}
-EXPORT_SYMBOL(blk_rq_count_integrity_sg);
-
/**
* blk_integrity_compare - Compare integrity profile of two disks
* @gd1: Disk to compare
@@ -41,7 +41,6 @@ void blk_integrity_unregister(struct gendisk *);
int blk_integrity_compare(struct gendisk *, struct gendisk *);
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)
{