Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213039
b: refs/heads/master
c: 1441779
h: refs/heads/master
i:
  213037: 67aa208
  213035: 05eacf2
  213031: 5c2521f
  213023: 4dc5572
v: v3
  • Loading branch information
Namhyung Kim authored and Jens Axboe committed Sep 15, 2010
1 parent 3713c4a commit ddd966a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 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: 8dcbdc742fec9e6c542ff9cb599d2ee620753d07
refs/heads/master: 144177991ca624841ddbd1e7edff958fc0f6d1fe
5 changes: 3 additions & 2 deletions trunk/block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq,
* direct dma. else, set up kernel bounce buffers
*/
uaddr = (unsigned long) ubuf;
if (blk_rq_aligned(q, ubuf, len) && !map_data)
if (blk_rq_aligned(q, uaddr, len) && !map_data)
bio = bio_map_user(q, NULL, uaddr, len, reading, gfp_mask);
else
bio = bio_copy_user(q, map_data, uaddr, len, reading, gfp_mask);
Expand Down Expand Up @@ -288,6 +288,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
unsigned int len, gfp_t gfp_mask)
{
int reading = rq_data_dir(rq) == READ;
unsigned long addr = (unsigned long) kbuf;
int do_copy = 0;
struct bio *bio;
int ret;
Expand All @@ -297,7 +298,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
if (!len || !kbuf)
return -EINVAL;

do_copy = !blk_rq_aligned(q, kbuf, len) || object_is_on_stack(kbuf);
do_copy = !blk_rq_aligned(q, addr, len) || object_is_on_stack(kbuf);
if (do_copy)
bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading);
else
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,11 +1097,11 @@ static inline int queue_dma_alignment(struct request_queue *q)
return q ? q->dma_alignment : 511;
}

static inline int blk_rq_aligned(struct request_queue *q, void *addr,
static inline int blk_rq_aligned(struct request_queue *q, unsigned long addr,
unsigned int len)
{
unsigned int alignment = queue_dma_alignment(q) | q->dma_pad_mask;
return !((unsigned long)addr & alignment) && !(len & alignment);
return !(addr & alignment) && !(len & alignment);
}

/* assumes size > 256 */
Expand Down

0 comments on commit ddd966a

Please sign in to comment.