diff options
author | FUJITA Tomonori <tomof@acm.org> | 2006-12-20 05:17:43 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-16 02:52:44 -0400 |
commit | ac6b91b8035bd269a1fd42474f907d107c074805 (patch) | |
tree | 275d86f1bd2ee22be7355f3cd4e0b9e3472b99d8 | |
parent | 3d6392cfbd7dc11f23058e3493683afab4ac13a3 (diff) |
block: changes for blk_rq_unmap_user new API
This converts block/scsi_ioctl.c use blk_rq_unmap_user new
API. blk_unmap_sghdr_rq is too simple and it might be better to remove
it.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/scsi_ioctl.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 88fd008d38bd..daded70ffbb1 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -245,17 +245,7 @@ EXPORT_SYMBOL_GPL(blk_fill_sghdr_rq); | |||
245 | */ | 245 | */ |
246 | int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr) | 246 | int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr) |
247 | { | 247 | { |
248 | struct bio *bio = rq->bio; | 248 | blk_rq_unmap_user(rq->bio); |
249 | |||
250 | /* | ||
251 | * also releases request | ||
252 | */ | ||
253 | if (!hdr->iovec_count) | ||
254 | return blk_rq_unmap_user(bio, hdr->dxfer_len); | ||
255 | |||
256 | rq_for_each_bio(bio, rq) | ||
257 | bio_unmap_user(bio); | ||
258 | |||
259 | blk_put_request(rq); | 249 | blk_put_request(rq); |
260 | return 0; | 250 | return 0; |
261 | } | 251 | } |
@@ -335,7 +325,6 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
335 | has_write_perm = file->f_mode & FMODE_WRITE; | 325 | has_write_perm = file->f_mode & FMODE_WRITE; |
336 | 326 | ||
337 | if (blk_fill_sghdr_rq(q, rq, hdr, has_write_perm)) { | 327 | if (blk_fill_sghdr_rq(q, rq, hdr, has_write_perm)) { |
338 | blk_rq_unmap_user(bio, hdr->dxfer_len); | ||
339 | blk_put_request(rq); | 328 | blk_put_request(rq); |
340 | return -EFAULT; | 329 | return -EFAULT; |
341 | } | 330 | } |