Skip to content

Commit 1c4bc3a

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the queue_bounce_pfn helper
Only used inside the bounce code, and opencoding it makes it more obvious what is going on. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3bce016 commit 1c4bc3a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

block/bounce.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
203203
bio_for_each_segment(from, *bio_orig, iter) {
204204
if (i++ < BIO_MAX_PAGES)
205205
sectors += from.bv_len >> 9;
206-
if (page_to_pfn(from.bv_page) > queue_bounce_pfn(q))
206+
if (page_to_pfn(from.bv_page) > q->limits.bounce_pfn)
207207
bounce = true;
208208
}
209209
if (!bounce)
@@ -220,7 +220,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig,
220220
bio_for_each_segment_all(to, bio, i) {
221221
struct page *page = to->bv_page;
222222

223-
if (page_to_pfn(page) <= queue_bounce_pfn(q))
223+
if (page_to_pfn(page) <= q->limits.bounce_pfn)
224224
continue;
225225

226226
to->bv_page = mempool_alloc(pool, q->bounce_gfp);
@@ -272,7 +272,7 @@ void blk_queue_bounce(struct request_queue *q, struct bio **bio_orig)
272272
* don't waste time iterating over bio segments
273273
*/
274274
if (!(q->bounce_gfp & GFP_DMA)) {
275-
if (queue_bounce_pfn(q) >= blk_max_pfn)
275+
if (q->limits.bounce_pfn >= blk_max_pfn)
276276
return;
277277
pool = page_pool;
278278
} else {

include/linux/blkdev.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,11 +1385,6 @@ enum blk_default_limits {
13851385

13861386
#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
13871387

1388-
static inline unsigned long queue_bounce_pfn(struct request_queue *q)
1389-
{
1390-
return q->limits.bounce_pfn;
1391-
}
1392-
13931388
static inline unsigned long queue_segment_boundary(struct request_queue *q)
13941389
{
13951390
return q->limits.seg_boundary_mask;

0 commit comments

Comments
 (0)