Skip to content

Commit

Permalink
block: changes for blk_rq_unmap_user new API
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Jul 16, 2007
1 parent 3d6392c commit ac6b91b
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,7 @@ EXPORT_SYMBOL_GPL(blk_fill_sghdr_rq);
*/
int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr)
{
struct bio *bio = rq->bio;

/*
* also releases request
*/
if (!hdr->iovec_count)
return blk_rq_unmap_user(bio, hdr->dxfer_len);

rq_for_each_bio(bio, rq)
bio_unmap_user(bio);

blk_rq_unmap_user(rq->bio);
blk_put_request(rq);
return 0;
}
Expand Down Expand Up @@ -335,7 +325,6 @@ static int sg_io(struct file *file, request_queue_t *q,
has_write_perm = file->f_mode & FMODE_WRITE;

if (blk_fill_sghdr_rq(q, rq, hdr, has_write_perm)) {
blk_rq_unmap_user(bio, hdr->dxfer_len);
blk_put_request(rq);
return -EFAULT;
}
Expand Down

0 comments on commit ac6b91b

Please sign in to comment.