diff options
Diffstat (limited to 'include/linux/bio.h')
| -rw-r--r-- | include/linux/bio.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 5a645769f020..b39e5000ff58 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -186,6 +186,15 @@ static inline void *bio_data(struct bio *bio) | |||
| 186 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ | 186 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ |
| 187 | __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) | 187 | __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) |
| 188 | 188 | ||
| 189 | /* | ||
| 190 | * Check if adding a bio_vec after bprv with offset would create a gap in | ||
| 191 | * the SG list. Most drivers don't care about this, but some do. | ||
| 192 | */ | ||
| 193 | static inline bool bvec_gap_to_prev(struct bio_vec *bprv, unsigned int offset) | ||
| 194 | { | ||
| 195 | return offset || ((bprv->bv_offset + bprv->bv_len) & (PAGE_SIZE - 1)); | ||
| 196 | } | ||
| 197 | |||
| 189 | #define bio_io_error(bio) bio_endio((bio), -EIO) | 198 | #define bio_io_error(bio) bio_endio((bio), -EIO) |
| 190 | 199 | ||
| 191 | /* | 200 | /* |
| @@ -299,6 +308,7 @@ struct bio_integrity_payload { | |||
| 299 | 308 | ||
| 300 | unsigned short bip_slab; /* slab the bip came from */ | 309 | unsigned short bip_slab; /* slab the bip came from */ |
| 301 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ | 310 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ |
| 311 | unsigned short bip_max_vcnt; /* integrity bio_vec slots */ | ||
| 302 | unsigned bip_owns_buf:1; /* should free bip_buf */ | 312 | unsigned bip_owns_buf:1; /* should free bip_buf */ |
| 303 | 313 | ||
| 304 | struct work_struct bip_work; /* I/O completion */ | 314 | struct work_struct bip_work; /* I/O completion */ |
| @@ -644,10 +654,6 @@ struct biovec_slab { | |||
| 644 | 654 | ||
| 645 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 655 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
| 646 | 656 | ||
| 647 | |||
| 648 | |||
| 649 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) | ||
| 650 | |||
| 651 | #define bip_for_each_vec(bvl, bip, iter) \ | 657 | #define bip_for_each_vec(bvl, bip, iter) \ |
| 652 | for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter) | 658 | for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter) |
| 653 | 659 | ||
