History

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

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

Linus Torvalds committed 11 years ago

Commit 133bb592 parents 590dca3 99451878 files · +129 −57Browse files

Showing the changes to include/linux/blkdev.h (1 of 8 files). Show all

Unified · Split

include/linux/blkdev.h+50−0
@@ -1368,6 +1368,26 @@ static inline bool bvec_gap_to_prev(struct request_queue *q, · 1367 unmodified lines
13681368 ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
13691369 }
13701370
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+
13711391 struct work_struct;
13721392 int kblockd_schedule_work(struct work_struct *work);
13731393 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
14941514 return q->limits.max_integrity_segments;
14951515 }
14961516
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+
14971537 #else /* CONFIG_BLK_DEV_INTEGRITY */
14981538
14991539 struct bio;
@@ -1560,6 +1600,16 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g) · 60 unmodified lines
15601600 {
15611601 return 0;
15621602 }
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+}
15631613
15641614 #endif /* CONFIG_BLK_DEV_INTEGRITY */
15651615

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t