diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-11-23 20:20:16 -0500 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:50 -0500 |
commit | d57a5f7c6605f15f3b5134837e68b448a7cea88e (patch) | |
tree | 95088fe201493ff655fc4da1fe159aca0e8f53dc /include/linux/bio.h | |
parent | 1cb9dda4f4332aa560a2db39f92a96e1a8273cf8 (diff) |
bio-integrity: Convert to bvec_iter
The bio integrity is also stored in a bvec array, so if we use the bvec
iter code we just added, the integrity code won't need to implement its
own iteration stuff (bio_integrity_mark_head(), bio_integrity_mark_tail())
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r-- | include/linux/bio.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 04e592e74c92..930cb73c894b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -244,16 +244,15 @@ static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter, | |||
244 | struct bio_integrity_payload { | 244 | struct bio_integrity_payload { |
245 | struct bio *bip_bio; /* parent bio */ | 245 | struct bio *bip_bio; /* parent bio */ |
246 | 246 | ||
247 | sector_t bip_sector; /* virtual start sector */ | 247 | struct bvec_iter bip_iter; |
248 | 248 | ||
249 | /* kill - should just use bip_vec */ | ||
249 | void *bip_buf; /* generated integrity data */ | 250 | void *bip_buf; /* generated integrity data */ |
250 | bio_end_io_t *bip_end_io; /* saved I/O completion fn */ | ||
251 | 251 | ||
252 | unsigned int bip_size; | 252 | bio_end_io_t *bip_end_io; /* saved I/O completion fn */ |
253 | 253 | ||
254 | unsigned short bip_slab; /* slab the bip came from */ | 254 | unsigned short bip_slab; /* slab the bip came from */ |
255 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ | 255 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ |
256 | unsigned short bip_idx; /* current bip_vec index */ | ||
257 | unsigned bip_owns_buf:1; /* should free bip_buf */ | 256 | unsigned bip_owns_buf:1; /* should free bip_buf */ |
258 | 257 | ||
259 | struct work_struct bip_work; /* I/O completion */ | 258 | struct work_struct bip_work; /* I/O completion */ |
@@ -626,16 +625,12 @@ struct biovec_slab { | |||
626 | 625 | ||
627 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 626 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
628 | 627 | ||
629 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) | ||
630 | #define bip_vec(bip) bip_vec_idx(bip, 0) | ||
631 | 628 | ||
632 | #define __bip_for_each_vec(bvl, bip, i, start_idx) \ | ||
633 | for (bvl = bip_vec_idx((bip), (start_idx)), i = (start_idx); \ | ||
634 | i < (bip)->bip_vcnt; \ | ||
635 | bvl++, i++) | ||
636 | 629 | ||
637 | #define bip_for_each_vec(bvl, bip, i) \ | 630 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) |
638 | __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) | 631 | |
632 | #define bip_for_each_vec(bvl, bip, iter) \ | ||
633 | for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter) | ||
639 | 634 | ||
640 | #define bio_for_each_integrity_vec(_bvl, _bio, _iter) \ | 635 | #define bio_for_each_integrity_vec(_bvl, _bio, _iter) \ |
641 | for_each_bio(_bio) \ | 636 | for_each_bio(_bio) \ |