[PATCH] block: use blk_rq_unmap_user's new interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This converts block/scsi_ioctl.c use blk_rq_unmap_user's new
interface. Now blk_unmap_sghdr_rq is too simple and it might be better
to remove it.

The patch is over Jens's bsg branch.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>

---
 block/scsi_ioctl.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 28e545d..e74f807 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -243,17 +243,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);
 	blk_put_request(rq);
 	return 0;
 }
@@ -333,7 +323,7 @@ static int sg_io(struct file *file, requ
 		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_rq_unmap_user(rq);
 		blk_put_request(rq);
 		return -EFAULT;
 	}
-- 
1.4.1.1


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux