Pull block updates from Jens Axboe: "This is a bit bigger than it should be, but I could (did) not want to send it off last week due to both wanting extra testing, and expecting a fix for the bounce regression as well. In any case, this contains: - Fix for the blk-merge.c compilation warning on gcc 5.x from me. - A set of back/front SG gap merge fixes, from me and from Sagi. This ensures that we honor SG gapping for integrity payloads as well. - Two small fixes for null_blk from Matias, fixing a leak and a capacity propagation issue. - A blkcg fix from Tejun, fixing a NULL dereference. - A fast clone optimization from Ming, fixing a performance regression since the arbitrarily sized bio's were introduced. - Also from Ming, a regression fix for bouncing IOs" * 'for-linus' of git://git.kernel.dk/linux-block: block: fix bounce_end_io block: blk-merge: fast-clone bio when splitting rw bios block: blkg_destroy_all() should clear q->root_blkg and ->root_rl.blkg block: Copy a user iovec if it includes gaps block: Refuse adding appending a gapped integrity page to a bio block: Refuse request/bio merges with gaps in the integrity payload block: Check for gaps on front and back merges null_blk: fix wrong capacity when bs is not 512 bytes null_blk: fix memory leak on cleanup block: fix bogus compiler warnings in blk-merge.c
Showing the changes to include/linux/blkdev.h (1 of 8 files). Show all
Unified · Split
| @@ -1368,6 +1368,26 @@ static inline bool bvec_gap_to_prev(struct request_queue *q, · 1367 unmodified lines | |||
| 1368 | ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); | 1368 | ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); |
| 1369 | } | 1369 | } |
| 1370 | 1370 | ||
| 1371 | static inline bool bio_will_gap(struct request_queue *q, struct bio *prev, | ||
| 1372 | struct bio *next) | ||
| 1373 | { | ||
| 1374 | if (!bio_has_data(prev)) | ||
| 1375 | return false; | ||
| 1376 | |||
| 1377 | return bvec_gap_to_prev(q, &prev->bi_io_vec[prev->bi_vcnt - 1], | ||
| 1378 | next->bi_io_vec[0].bv_offset); | ||
| 1379 | } | ||
| 1380 | |||
| 1381 | static inline bool req_gap_back_merge(struct request *req, struct bio *bio) | ||
| 1382 | { | ||
| 1383 | return bio_will_gap(req->q, req->biotail, bio); | ||
| 1384 | } | ||
| 1385 | |||
| 1386 | static inline bool req_gap_front_merge(struct request *req, struct bio *bio) | ||
| 1387 | { | ||
| 1388 | return bio_will_gap(req->q, bio, req->bio); | ||
| 1389 | } | ||
| 1390 | |||
| 1371 | struct work_struct; | 1391 | struct work_struct; |
| 1372 | int kblockd_schedule_work(struct work_struct *work); | 1392 | int kblockd_schedule_work(struct work_struct *work); |
| 1373 | int kblockd_schedule_delayed_work(struct delayed_work *dwork, unsigned long delay); | 1393 | int kblockd_schedule_delayed_work(struct delayed_work *dwork, unsigned long delay); |
| @@ -1494,6 +1514,26 @@ queue_max_integrity_segments(struct request_queue *q) · 120 unmodified lines | |||
| 1494 | return q->limits.max_integrity_segments; | 1514 | return q->limits.max_integrity_segments; |
| 1495 | } | 1515 | } |
| 1496 | 1516 | ||
| 1517 | static inline bool integrity_req_gap_back_merge(struct request *req, | ||
| 1518 | struct bio *next) | ||
| 1519 | { | ||
| 1520 | struct bio_integrity_payload *bip = bio_integrity(req->bio); | ||
| 1521 | struct bio_integrity_payload *bip_next = bio_integrity(next); | ||
| 1522 | |||
| 1523 | return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1], | ||
| 1524 | bip_next->bip_vec[0].bv_offset); | ||
| 1525 | } | ||
| 1526 | |||
| 1527 | static inline bool integrity_req_gap_front_merge(struct request *req, | ||
| 1528 | struct bio *bio) | ||
| 1529 | { | ||
| 1530 | struct bio_integrity_payload *bip = bio_integrity(bio); | ||
| 1531 | struct bio_integrity_payload *bip_next = bio_integrity(req->bio); | ||
| 1532 | |||
| 1533 | return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1], | ||
| 1534 | bip_next->bip_vec[0].bv_offset); | ||
| 1535 | } | ||
| 1536 | |||
| 1497 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 1537 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
| 1498 | 1538 | ||
| 1499 | struct bio; | 1539 | struct bio; |
| @@ -1560,6 +1600,16 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g) · 60 unmodified lines | |||
| 1560 | { | 1600 | { |
| 1561 | return 0; | 1601 | return 0; |
| 1562 | } | 1602 | } |
| 1603 | static inline bool integrity_req_gap_back_merge(struct request *req, | ||
| 1604 | struct bio *next) | ||
| 1605 | { | ||
| 1606 | return false; | ||
| 1607 | } | ||
| 1608 | static inline bool integrity_req_gap_front_merge(struct request *req, | ||
| 1609 | struct bio *bio) | ||
| 1610 | { | ||
| 1611 | return false; | ||
| 1612 | } | ||
| 1563 | 1613 | ||
| 1564 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 1614 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
| 1565 | 1615 | ||