Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20930
b: refs/heads/master
c: 5ee1af9
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Mar 9, 2006
1 parent 9ac97d6 commit 43a6802
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9262c12c0084ddba445a9a42e98994018e51400
refs/heads/master: 5ee1af9f519e6dc5a7d7912e87a1aaec857c8818
33 changes: 19 additions & 14 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,26 +625,31 @@ static inline int ordered_bio_endio(struct request *rq, struct bio *bio,
* Different hardware can have different requirements as to what pages
* it can do I/O directly to. A low level driver can call
* blk_queue_bounce_limit to have lower memory pages allocated as bounce
* buffers for doing I/O to pages residing above @page. By default
* the block layer sets this to the highest numbered "low" memory page.
* buffers for doing I/O to pages residing above @page.
**/
void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr)
{
unsigned long bounce_pfn = dma_addr >> PAGE_SHIFT;

/*
* set appropriate bounce gfp mask -- unfortunately we don't have a
* full 4GB zone, so we have to resort to low memory for any bounces.
* ISA has its own < 16MB zone.
*/
if (bounce_pfn < blk_max_low_pfn) {
BUG_ON(dma_addr < BLK_BOUNCE_ISA);
int dma = 0;

q->bounce_gfp = GFP_NOIO;
#if BITS_PER_LONG == 64
/* Assume anything <= 4GB can be handled by IOMMU.
Actually some IOMMUs can handle everything, but I don't
know of a way to test this here. */
if (bounce_pfn < (0xffffffff>>PAGE_SHIFT))
dma = 1;
q->bounce_pfn = max_low_pfn;
#else
if (bounce_pfn < blk_max_low_pfn)
dma = 1;
q->bounce_pfn = bounce_pfn;
#endif
if (dma) {
init_emergency_isa_pool();
q->bounce_gfp = GFP_NOIO | GFP_DMA;
} else
q->bounce_gfp = GFP_NOIO;

q->bounce_pfn = bounce_pfn;
q->bounce_pfn = bounce_pfn;
}
}

EXPORT_SYMBOL(blk_queue_bounce_limit);
Expand Down

0 comments on commit 43a6802

Please sign in to comment.