Commit ac6b91b8035bd269a1fd42474f907d107c074805

Authored by FUJITA Tomonori
Committed by Jens Axboe
1 parent 3d6392cfbd

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>

Showing 1 changed file with 1 additions and 12 deletions Side-by-side Diff

... ... @@ -245,17 +245,7 @@
245 245 */
246 246 int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr)
247 247 {
248   - struct bio *bio = 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   -
  248 + blk_rq_unmap_user(rq->bio);
259 249 blk_put_request(rq);
260 250 return 0;
261 251 }
... ... @@ -335,7 +325,6 @@
335 325 has_write_perm = file->f_mode & FMODE_WRITE;
336 326  
337 327 if (blk_fill_sghdr_rq(q, rq, hdr, has_write_perm)) {
338   - blk_rq_unmap_user(bio, hdr->dxfer_len);
339 328 blk_put_request(rq);
340 329 return -EFAULT;
341 330 }