block: add gfp_mask argument to blk_rq_map_user and blk_rq_map_user_iov

Currently, blk_rq_map_user and blk_rq_map_user_iov always do
GFP_KERNEL allocation.

This adds gfp_mask argument to blk_rq_map_user and blk_rq_map_user_iov
so sg can use it (sg always does GFP_ATOMIC allocation).

Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: Douglas Gilbert <[email protected]>
Cc: Mike Christie <[email protected]>
Cc: James Bottomley <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
FUJITA Tomonori 2008-08-28 16:17:05 +09:00 • committed by Jens Axboe
commit a3bce90edd
8 changed files with 47 additions and 34 deletions

View file

@ -283,7 +283,8 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, int has_write_perm)
next_rq->cmd_type = rq->cmd_type;
dxferp = (void*)(unsigned long)hdr->din_xferp;
ret = blk_rq_map_user(q, next_rq, dxferp, hdr->din_xfer_len);
ret = blk_rq_map_user(q, next_rq, dxferp, hdr->din_xfer_len,
GFP_KERNEL);
if (ret)
goto out;
}
@ -298,7 +299,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, int has_write_perm)
dxfer_len = 0;
if (dxfer_len) {
ret = blk_rq_map_user(q, rq, dxferp, dxfer_len);
ret = blk_rq_map_user(q, rq, dxferp, dxfer_len, GFP_KERNEL);
if (ret)
goto out;
}