diff --git a/modules/cas_cache/context.h b/modules/cas_cache/context.h index b502330..164ea14 100644 --- a/modules/cas_cache/context.h +++ b/modules/cas_cache/context.h @@ -38,7 +38,7 @@ struct blk_data { /** * @brief CAS IO with which data is associated */ - struct ocf_io *io; + ocf_io_t io; /** * @brief Timestamp of start processing request diff --git a/modules/cas_cache/volume/vol_block_dev_bottom.c b/modules/cas_cache/volume/vol_block_dev_bottom.c index 2bb6374..6b6b3cc 100644 --- a/modules/cas_cache/volume/vol_block_dev_bottom.c +++ b/modules/cas_cache/volume/vol_block_dev_bottom.c @@ -149,9 +149,9 @@ static void block_dev_forward_io(ocf_volume_t volume, ocf_forward_token_t token, int dir, uint64_t addr, uint64_t bytes, uint64_t offset) { - struct ocf_io *io = ocf_forward_get_io(token); struct bd_object *bdobj = bd_object(volume); - struct blk_data *data = ocf_io_get_data(io); + struct blk_data *data = ocf_forward_get_data(token); + uint64_t flags = ocf_forward_get_flags(token); int bio_dir = (dir == OCF_READ) ? READ : WRITE; struct bio_vec_iter iter; struct blk_plug plug; @@ -182,7 +182,7 @@ static void block_dev_forward_io(ocf_volume_t volume, CAS_BIO_BISECTOR(bio) = addr / SECTOR_SIZE; bio->bi_next = NULL; bio->bi_private = (void *)token; - CAS_BIO_OP_FLAGS(bio) |= filter_req_flags(bio_dir, io->flags); + CAS_BIO_OP_FLAGS(bio) |= filter_req_flags(bio_dir, flags); bio->bi_end_io = CAS_REFER_BLOCK_CALLBACK(cas_bd_forward_end); /* Add pages */ @@ -248,10 +248,8 @@ static void block_dev_forward_io(ocf_volume_t volume, static void block_dev_forward_flush(ocf_volume_t volume, ocf_forward_token_t token) { - struct ocf_io *io = ocf_forward_get_io(token); struct bd_object *bdobj = bd_object(volume); struct request_queue *q = bdev_get_queue(bdobj->btm_bd); - int bio_dir = (io->dir == OCF_READ) ? READ : WRITE; struct bio *bio; if (!q) { @@ -277,7 +275,7 @@ static void block_dev_forward_flush(ocf_volume_t volume, bio->bi_private = (void *)token; bio->bi_end_io = CAS_REFER_BLOCK_CALLBACK(cas_bd_forward_end); - cas_submit_bio(CAS_SET_FLUSH(bio_dir), bio); + cas_submit_bio(CAS_SET_FLUSH(0), bio); } diff --git a/modules/cas_cache/volume/vol_block_dev_top.c b/modules/cas_cache/volume/vol_block_dev_top.c index 9a7c79e..be79dc0 100644 --- a/modules/cas_cache/volume/vol_block_dev_top.c +++ b/modules/cas_cache/volume/vol_block_dev_top.c @@ -189,10 +189,11 @@ static void blkdev_complete_data_master(struct blk_data *master, int error) cas_free_blk_data(master); } -static void blkdev_complete_data(struct ocf_io *io, int error) +static void blkdev_complete_data(ocf_io_t io, void *priv1, void *priv2, + int error) { - struct bio *bio = io->priv1; - struct blk_data *master = io->priv2; + struct bio *bio = priv1; + struct blk_data *master = priv2; struct blk_data *data = ocf_io_get_data(io); ocf_io_put(io); @@ -217,7 +218,7 @@ static int blkdev_handle_data_single(struct bd_object *bvol, struct bio *bio, ocf_cache_t cache = ocf_volume_get_cache(bvol->front_volume); struct cache_priv *cache_priv = ocf_cache_get_priv(cache); ocf_queue_t queue = cache_priv->io_queues[smp_processor_id()]; - struct ocf_io *io; + ocf_io_t io; struct blk_data *data; uint64_t flags = CAS_BIO_OP_FLAGS(bio); int ret; @@ -317,9 +318,10 @@ err: CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(error)); } -static void blkdev_complete_discard(struct ocf_io *io, int error) +static void blkdev_complete_discard(ocf_io_t io, void *priv1, void *priv2, + int error) { - struct bio *bio = io->priv1; + struct bio *bio = priv1; int result = map_cas_err_to_generic(error); CAS_BIO_ENDIO(bio, CAS_BIO_BISIZE(bio), CAS_ERRNO_TO_BLK_STS(result)); @@ -331,7 +333,7 @@ static void blkdev_handle_discard(struct bd_object *bvol, struct bio *bio) ocf_cache_t cache = ocf_volume_get_cache(bvol->front_volume); struct cache_priv *cache_priv = ocf_cache_get_priv(cache); ocf_queue_t queue = cache_priv->io_queues[smp_processor_id()]; - struct ocf_io *io; + ocf_io_t io; io = ocf_volume_new_io(bvol->front_volume, queue, CAS_BIO_BISECTOR(bio) << SECTOR_SHIFT, @@ -356,10 +358,11 @@ static void blkdev_handle_bio_noflush(struct bd_object *bvol, struct bio *bio) blkdev_handle_data(bvol, bio); } -static void blkdev_complete_flush(struct ocf_io *io, int error) +static void blkdev_complete_flush(ocf_io_t io, void *priv1, void *priv2, + int error) { - struct bio *bio = io->priv1; - struct bd_object *bvol = io->priv2; + struct bio *bio = priv1; + struct bd_object *bvol = priv2; int result = map_cas_err_to_generic(error); ocf_io_put(io); @@ -378,7 +381,7 @@ static void blkdev_handle_flush(struct bd_object *bvol, struct bio *bio) ocf_cache_t cache = ocf_volume_get_cache(bvol->front_volume); struct cache_priv *cache_priv = ocf_cache_get_priv(cache); ocf_queue_t queue = cache_priv->io_queues[smp_processor_id()]; - struct ocf_io *io; + ocf_io_t io; io = ocf_volume_new_io(bvol->front_volume, queue, 0, 0, OCF_WRITE, 0, CAS_SET_FLUSH(0));