Skip to content

Commit

Permalink
block: Fix bounce limit setting in DM
Browse files Browse the repository at this point in the history
blk_queue_bounce_limit() is more than a wrapper about the request queue
limits.bounce_pfn variable.  Introduce blk_queue_bounce_pfn() which can
be called by stacking drivers that wish to set the bounce limit
explicitly.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
martinkpetersen authored and Jens Axboe committed Jun 3, 2009
1 parent dbdc9dd commit a05c020
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,23 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_mask)
}
EXPORT_SYMBOL(blk_queue_bounce_limit);

/**
* blk_queue_bounce_pfn - set the bounce buffer limit for queue
* @q: the request queue for the device
* @pfn: max address
*
* Description:
* This function is similar to blk_queue_bounce_limit except it
* neither changes allocation flags, nor does it set up the ISA DMA
* pool. This function should only be used by stacking drivers.
* Hardware drivers should use blk_queue_bounce_limit instead.
*/
void blk_queue_bounce_pfn(struct request_queue *q, u64 pfn)
{
q->limits.bounce_pfn = pfn;
}
EXPORT_SYMBOL(blk_queue_bounce_pfn);

/**
* blk_queue_max_sectors - set max sectors for a request for this queue
* @q: the request queue for the device
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
blk_queue_max_segment_size(q, t->limits.max_segment_size);
blk_queue_max_hw_sectors(q, t->limits.max_hw_sectors);
blk_queue_segment_boundary(q, t->limits.seg_boundary_mask);
blk_queue_bounce_limit(q, t->limits.bounce_pfn);
blk_queue_bounce_pfn(q, t->limits.bounce_pfn);

if (t->limits.no_cluster)
queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);
Expand Down
1 change: 1 addition & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
extern void blk_cleanup_queue(struct request_queue *);
extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
extern void blk_queue_bounce_limit(struct request_queue *, u64);
extern void blk_queue_bounce_pfn(struct request_queue *, u64);
extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short);
Expand Down

0 comments on commit a05c020

Please sign in to comment.