Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147047
b: refs/heads/master
c: 3a5a392
h: refs/heads/master
i:
  147045: 189ae27
  147043: 28aaa5f
  147039: 2e6e0b0
v: v3
  • Loading branch information
James Bottomley authored and Jens Axboe committed May 19, 2009
1 parent 0c0f63d commit 382333b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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: b2858d7d1639c04ca3c54988d76c5f7300b76f1c
refs/heads/master: 3a5a39276d2a32b05b1ee25b384516805b17cf87
12 changes: 10 additions & 2 deletions trunk/block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,16 @@ EXPORT_SYMBOL(blk_rq_unmap_user);
*
* Description:
* Data will be mapped directly if possible. Otherwise a bounce
* buffer is used.
* buffer is used. Can be called multple times to append multple
* buffers.
*/
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;
int do_copy = 0;
struct bio *bio;
int ret;

if (len > (q->max_hw_sectors << 9))
return -EINVAL;
Expand All @@ -311,7 +313,13 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
if (do_copy)
rq->cmd_flags |= REQ_COPY_USER;

blk_rq_bio_prep(q, rq, bio);
ret = blk_rq_append_bio(q, rq, bio);
if (unlikely(ret)) {
/* request is too big */
bio_put(bio);
return ret;
}

blk_queue_bounce(q, &rq->bio);
rq->buffer = NULL;
return 0;
Expand Down

0 comments on commit 382333b

Please sign in to comment.