diff options
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r-- | include/linux/bio.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 70654521dab6..5a4d39b4686b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -250,6 +250,17 @@ static inline unsigned bio_segments(struct bio *bio) | |||
250 | struct bio_vec bv; | 250 | struct bio_vec bv; |
251 | struct bvec_iter iter; | 251 | struct bvec_iter iter; |
252 | 252 | ||
253 | /* | ||
254 | * We special case discard/write same, because they interpret bi_size | ||
255 | * differently: | ||
256 | */ | ||
257 | |||
258 | if (bio->bi_rw & REQ_DISCARD) | ||
259 | return 1; | ||
260 | |||
261 | if (bio->bi_rw & REQ_WRITE_SAME) | ||
262 | return 1; | ||
263 | |||
253 | bio_for_each_segment(bv, bio, iter) | 264 | bio_for_each_segment(bv, bio, iter) |
254 | segs++; | 265 | segs++; |
255 | 266 | ||
@@ -332,6 +343,7 @@ extern struct bio *bio_clone_fast(struct bio *, gfp_t, struct bio_set *); | |||
332 | extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs); | 343 | extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs); |
333 | 344 | ||
334 | extern struct bio_set *fs_bio_set; | 345 | extern struct bio_set *fs_bio_set; |
346 | unsigned int bio_integrity_tag_size(struct bio *bio); | ||
335 | 347 | ||
336 | static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs) | 348 | static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs) |
337 | { | 349 | { |