[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>
This commit is contained in:
Jens Axboe
2006-12-19 11:12:46 +01:00
parent 48785bb9fa
commit 8e5cfc45e7
4 changed files with 19 additions and 17 deletions

View File

@@ -2139,8 +2139,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
cdi->last_sense = s->sense_key;
}
rq->bio = bio;
if (blk_rq_unmap_user(rq))
if (blk_rq_unmap_user(bio))
ret = -EFAULT;
if (ret)