Pass block_device to pblk_io_prepare
This commit is contained in:
parent
6ead93e4d0
commit
365cd0a13a
|
@ -98,7 +98,7 @@ cbd_free_pagev(struct page** pagev, size_t len)
|
|||
**************************************/
|
||||
|
||||
static struct bio*
|
||||
pblk_io_prepare(struct cbd_params* params, unsigned int op,
|
||||
pblk_io_prepare(struct block_device* bdev, unsigned int op,
|
||||
u64 pblk, u32 count, struct page** pagev)
|
||||
{
|
||||
struct bio* bio;
|
||||
|
@ -109,7 +109,7 @@ pblk_io_prepare(struct cbd_params* params, unsigned int op,
|
|||
printk(KERN_ERR "%s: out of memory\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
bio_set_dev(bio, (struct block_device*)params->priv);
|
||||
bio_set_dev(bio, bdev);
|
||||
bio->bi_opf = op;
|
||||
|
||||
bio->bi_iter.bi_sector = (pblk << (PBLK_SHIFT - SECTOR_SHIFT));
|
||||
|
@ -129,7 +129,7 @@ pblk_read_wait(struct cbd_params* params,
|
|||
int ret;
|
||||
struct bio* bio;
|
||||
|
||||
bio = pblk_io_prepare(params, REQ_OP_READ, pblk, count, pagev);
|
||||
bio = pblk_io_prepare(params->priv, REQ_OP_READ, pblk, count, pagev);
|
||||
if (!bio) {
|
||||
printk(KERN_ERR "%s: out of memory\n", __func__);
|
||||
return -ENOMEM;
|
||||
|
@ -151,7 +151,7 @@ pblk_read(struct cbd_params* params,
|
|||
int ret;
|
||||
struct bio* bio;
|
||||
|
||||
bio = pblk_io_prepare(params, REQ_OP_READ, pblk, count, pagev);
|
||||
bio = pblk_io_prepare(params->priv, REQ_OP_READ, pblk, count, pagev);
|
||||
if (!bio) {
|
||||
printk(KERN_ERR "%s: out of memory\n", __func__);
|
||||
return -ENOMEM;
|
||||
|
@ -175,7 +175,7 @@ pblk_write(struct cbd_params* params,
|
|||
{
|
||||
struct bio* bio;
|
||||
|
||||
bio = pblk_io_prepare(params, REQ_OP_WRITE, pblk, count, pagev);
|
||||
bio = pblk_io_prepare(params->priv, REQ_OP_WRITE, pblk, count, pagev);
|
||||
if (!bio) {
|
||||
printk(KERN_ERR "%s: out of memory\n", __func__);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue