diff options
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r-- | block/blk-settings.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c index 9a8ffdd0ce3d..1344a0ea5cc6 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -140,7 +140,7 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_addr) | |||
140 | /* Assume anything <= 4GB can be handled by IOMMU. | 140 | /* Assume anything <= 4GB can be handled by IOMMU. |
141 | Actually some IOMMUs can handle everything, but I don't | 141 | Actually some IOMMUs can handle everything, but I don't |
142 | know of a way to test this here. */ | 142 | know of a way to test this here. */ |
143 | if (b_pfn < (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT)) | 143 | if (b_pfn <= (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT)) |
144 | dma = 1; | 144 | dma = 1; |
145 | q->bounce_pfn = max_low_pfn; | 145 | q->bounce_pfn = max_low_pfn; |
146 | #else | 146 | #else |
@@ -293,8 +293,24 @@ void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b) | |||
293 | EXPORT_SYMBOL(blk_queue_stack_limits); | 293 | EXPORT_SYMBOL(blk_queue_stack_limits); |
294 | 294 | ||
295 | /** | 295 | /** |
296 | * blk_queue_dma_drain - Set up a drain buffer for excess dma. | 296 | * blk_queue_dma_pad - set pad mask |
297 | * @q: the request queue for the device | ||
298 | * @mask: pad mask | ||
299 | * | ||
300 | * Set pad mask. Direct IO requests are padded to the mask specified. | ||
297 | * | 301 | * |
302 | * Appending pad buffer to a request modifies ->data_len such that it | ||
303 | * includes the pad buffer. The original requested data length can be | ||
304 | * obtained using blk_rq_raw_data_len(). | ||
305 | **/ | ||
306 | void blk_queue_dma_pad(struct request_queue *q, unsigned int mask) | ||
307 | { | ||
308 | q->dma_pad_mask = mask; | ||
309 | } | ||
310 | EXPORT_SYMBOL(blk_queue_dma_pad); | ||
311 | |||
312 | /** | ||
313 | * blk_queue_dma_drain - Set up a drain buffer for excess dma. | ||
298 | * @q: the request queue for the device | 314 | * @q: the request queue for the device |
299 | * @dma_drain_needed: fn which returns non-zero if drain is necessary | 315 | * @dma_drain_needed: fn which returns non-zero if drain is necessary |
300 | * @buf: physically contiguous buffer | 316 | * @buf: physically contiguous buffer |
@@ -316,7 +332,7 @@ EXPORT_SYMBOL(blk_queue_stack_limits); | |||
316 | * device can support otherwise there won't be room for the drain | 332 | * device can support otherwise there won't be room for the drain |
317 | * buffer. | 333 | * buffer. |
318 | */ | 334 | */ |
319 | extern int blk_queue_dma_drain(struct request_queue *q, | 335 | int blk_queue_dma_drain(struct request_queue *q, |
320 | dma_drain_needed_fn *dma_drain_needed, | 336 | dma_drain_needed_fn *dma_drain_needed, |
321 | void *buf, unsigned int size) | 337 | void *buf, unsigned int size) |
322 | { | 338 | { |