diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2006-12-19 05:12:46 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2006-12-19 05:12:46 -0500 |
commit | 8e5cfc45e7527eb5c8a9a22d56a7b9227e7c0913 (patch) | |
tree | 7be7c45168af77518bd6a47601e2f9e31b967dba /block/scsi_ioctl.c | |
parent | 48785bb9fa39415d7553e234946442579dfcf591 (diff) |
[PATCH] Fixup blk_rq_unmap_user() API
The blk_rq_unmap_user() API is not very nice. It expects the caller to
know that rq->bio has to be reset to the original bio, and it will
silently do nothing if that is not done. Instead make it explicit that
we need to pass in the first bio, by expecting a bio argument.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r-- | block/scsi_ioctl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index f322b6a441d8..2528a0c0dec8 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -333,8 +333,7 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
333 | hdr->sb_len_wr = len; | 333 | hdr->sb_len_wr = len; |
334 | } | 334 | } |
335 | 335 | ||
336 | rq->bio = bio; | 336 | if (blk_rq_unmap_user(bio)) |
337 | if (blk_rq_unmap_user(rq)) | ||
338 | ret = -EFAULT; | 337 | ret = -EFAULT; |
339 | 338 | ||
340 | /* may not have succeeded, but output values written to control | 339 | /* may not have succeeded, but output values written to control |