@@ -190,7 +190,7 @@ static inline unsigned get_max_io_size(struct bio *bio,
*
* Returns the maximum number of bytes that can be added as a single segment.
*/
-static inline unsigned get_max_segment_size(const struct queue_limits *lim,
+inline unsigned get_max_segment_size(const struct queue_limits *lim,
struct page *start_page, unsigned long offset)
{
unsigned long mask = lim->seg_boundary_mask;
@@ -203,6 +203,7 @@ static inline unsigned get_max_segment_size(const struct queue_limits *lim,
*/
return min(mask - offset, (unsigned long)lim->max_segment_size - 1) + 1;
}
+EXPORT_SYMBOL_GPL(get_max_segment_size);
/**
* bvec_split_segs - verify whether or not a bvec should be split in the middle
@@ -1150,4 +1150,7 @@ static inline int blk_rq_map_sg(struct request_queue *q, struct request *rq,
}
void blk_dump_rq_flags(struct request *, char *);
+unsigned get_max_segment_size(const struct queue_limits *lim,
+ struct page *start_page, unsigned long offset);
+
#endif /* BLK_MQ_H */