diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-14 13:45:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-14 13:45:18 -0500 |
commit | 5e57dc81106b942786f5db8e7ab8788bb9319933 (patch) | |
tree | 4533e01e745bba3614c77200b3fd96dd7af7e04e /fs | |
parent | 0d25e3691186f5ae6feb0229717a60a5169dc5b2 (diff) | |
parent | c8123f8c9cb517403b51aa41c3c46ff5e10b2c17 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block IO fixes from Jens Axboe:
"Second round of updates and fixes for 3.14-rc2. Most of this stuff
has been queued up for a while. The notable exception is the blk-mq
changes, which are naturally a bit more in flux still.
The pull request contains:
- Two bug fixes for the new immutable vecs, causing crashes with raid
or swap. From Kent.
- Various blk-mq tweaks and fixes from Christoph. A fix for
integrity bio's from Nic.
- A few bcache fixes from Kent and Darrick Wong.
- xen-blk{front,back} fixes from David Vrabel, Matt Rushton, Nicolas
Swenson, and Roger Pau Monne.
- Fix for a vec miscount with integrity vectors from Martin.
- Minor annotations or fixes from Masanari Iida and Rashika Kheria.
- Tweak to null_blk to do more normal FIFO processing of requests
from Shlomo Pongratz.
- Elevator switching bypass fix from Tejun.
- Softlockup in blkdev_issue_discard() fix when !CONFIG_PREEMPT from
me"
* 'for-linus' of git://git.kernel.dk/linux-block: (31 commits)
block: add cond_resched() to potentially long running ioctl discard loop
xen-blkback: init persistent_purge_work work_struct
blk-mq: pair blk_mq_start_request / blk_mq_requeue_request
blk-mq: dont assume rq->errors is set when returning an error from ->queue_rq
block: Fix cloning of discard/write same bios
block: Fix type mismatch in ssize_t_blk_mq_tag_sysfs_show
blk-mq: rework flush sequencing logic
null_blk: use blk_complete_request and blk_mq_complete_request
virtio_blk: use blk_mq_complete_request
blk-mq: rework I/O completions
fs: Add prototype declaration to appropriate header file include/linux/bio.h
fs: Mark function as static in fs/bio-integrity.c
block/null_blk: Fix completion processing from LIFO to FIFO
block: Explicitly handle discard/write same segments
block: Fix nr_vecs for inline integrity vectors
blk-mq: Add bio_integrity setup to blk_mq_make_request
blk-mq: initialize sg_reserved_size
blk-mq: handle dma_drain_size
blk-mq: divert __blk_put_request for MQ ops
blk-mq: support at_head inserations for blk_execute_rq
...
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio-integrity.c | 13 | ||||
-rw-r--r-- | fs/bio.c | 15 |
2 files changed, 21 insertions, 7 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c index 0bad24ddc2e7..0129b78a6908 100644 --- a/fs/bio-integrity.c +++ b/fs/bio-integrity.c | |||
@@ -114,6 +114,14 @@ void bio_integrity_free(struct bio *bio) | |||
114 | } | 114 | } |
115 | EXPORT_SYMBOL(bio_integrity_free); | 115 | EXPORT_SYMBOL(bio_integrity_free); |
116 | 116 | ||
117 | static inline unsigned int bip_integrity_vecs(struct bio_integrity_payload *bip) | ||
118 | { | ||
119 | if (bip->bip_slab == BIO_POOL_NONE) | ||
120 | return BIP_INLINE_VECS; | ||
121 | |||
122 | return bvec_nr_vecs(bip->bip_slab); | ||
123 | } | ||
124 | |||
117 | /** | 125 | /** |
118 | * bio_integrity_add_page - Attach integrity metadata | 126 | * bio_integrity_add_page - Attach integrity metadata |
119 | * @bio: bio to update | 127 | * @bio: bio to update |
@@ -129,7 +137,7 @@ int bio_integrity_add_page(struct bio *bio, struct page *page, | |||
129 | struct bio_integrity_payload *bip = bio->bi_integrity; | 137 | struct bio_integrity_payload *bip = bio->bi_integrity; |
130 | struct bio_vec *iv; | 138 | struct bio_vec *iv; |
131 | 139 | ||
132 | if (bip->bip_vcnt >= bvec_nr_vecs(bip->bip_slab)) { | 140 | if (bip->bip_vcnt >= bip_integrity_vecs(bip)) { |
133 | printk(KERN_ERR "%s: bip_vec full\n", __func__); | 141 | printk(KERN_ERR "%s: bip_vec full\n", __func__); |
134 | return 0; | 142 | return 0; |
135 | } | 143 | } |
@@ -226,7 +234,8 @@ unsigned int bio_integrity_tag_size(struct bio *bio) | |||
226 | } | 234 | } |
227 | EXPORT_SYMBOL(bio_integrity_tag_size); | 235 | EXPORT_SYMBOL(bio_integrity_tag_size); |
228 | 236 | ||
229 | int bio_integrity_tag(struct bio *bio, void *tag_buf, unsigned int len, int set) | 237 | static int bio_integrity_tag(struct bio *bio, void *tag_buf, unsigned int len, |
238 | int set) | ||
230 | { | 239 | { |
231 | struct bio_integrity_payload *bip = bio->bi_integrity; | 240 | struct bio_integrity_payload *bip = bio->bi_integrity; |
232 | struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); | 241 | struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); |
@@ -611,7 +611,6 @@ EXPORT_SYMBOL(bio_clone_fast); | |||
611 | struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, | 611 | struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, |
612 | struct bio_set *bs) | 612 | struct bio_set *bs) |
613 | { | 613 | { |
614 | unsigned nr_iovecs = 0; | ||
615 | struct bvec_iter iter; | 614 | struct bvec_iter iter; |
616 | struct bio_vec bv; | 615 | struct bio_vec bv; |
617 | struct bio *bio; | 616 | struct bio *bio; |
@@ -638,10 +637,7 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, | |||
638 | * __bio_clone_fast() anyways. | 637 | * __bio_clone_fast() anyways. |
639 | */ | 638 | */ |
640 | 639 | ||
641 | bio_for_each_segment(bv, bio_src, iter) | 640 | bio = bio_alloc_bioset(gfp_mask, bio_segments(bio_src), bs); |
642 | nr_iovecs++; | ||
643 | |||
644 | bio = bio_alloc_bioset(gfp_mask, nr_iovecs, bs); | ||
645 | if (!bio) | 641 | if (!bio) |
646 | return NULL; | 642 | return NULL; |
647 | 643 | ||
@@ -650,9 +646,18 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, | |||
650 | bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; | 646 | bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; |
651 | bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; | 647 | bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; |
652 | 648 | ||
649 | if (bio->bi_rw & REQ_DISCARD) | ||
650 | goto integrity_clone; | ||
651 | |||
652 | if (bio->bi_rw & REQ_WRITE_SAME) { | ||
653 | bio->bi_io_vec[bio->bi_vcnt++] = bio_src->bi_io_vec[0]; | ||
654 | goto integrity_clone; | ||
655 | } | ||
656 | |||
653 | bio_for_each_segment(bv, bio_src, iter) | 657 | bio_for_each_segment(bv, bio_src, iter) |
654 | bio->bi_io_vec[bio->bi_vcnt++] = bv; | 658 | bio->bi_io_vec[bio->bi_vcnt++] = bv; |
655 | 659 | ||
660 | integrity_clone: | ||
656 | if (bio_integrity(bio_src)) { | 661 | if (bio_integrity(bio_src)) { |
657 | int ret; | 662 | int ret; |
658 | 663 | ||