[PATCH] [4/7] Add blk_q_mask

Andi Kleen
2008-03-07T09:25:24Z

Converts the queue bounce_pfn to a DMA mask suitable for the mask allocator

Signed-off-by: Andi Kleen <ak@suse.de>

---
include/linux/blkdev.h | 5 +++++
1 file changed, 5 insertions(+)

Index: linux/include/linux/blkdev.h
===================================================================
--- linux.orig/include/linux/blkdev.h
+++ linux/include/linux/blkdev.h
@@ -814,6 +814,11 @@ static inline unsigned int block_size(st
return bdev->bd_block_size;
}

+static inline u64 blk_q_mask(struct request_queue *q)
+{
+ return ~(-1LL << (PAGE_SHIFT + fls64(q->bounce_pfn)));
+}
+
typedef struct {struct page *v;} Sector;

unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *);