struct dm_bio_prison_cell **cell_sort_array;
 
        mempool_t mapping_pool;
+
+       struct bio flush_bio;
 };
 
 static void metadata_operation_failed(struct pool *pool, const char *op, int r);
        dm_block_t low_water_blocks;
        struct pool_features requested_pf; /* Features requested during table load */
        struct pool_features adjusted_pf;  /* Features used after adjusting for constituent devices */
-       struct bio flush_bio;
 };
 
 /*
        if (pool->next_mapping)
                mempool_free(pool->next_mapping, &pool->mapping_pool);
        mempool_exit(&pool->mapping_pool);
+       bio_uninit(&pool->flush_bio);
        dm_deferred_set_destroy(pool->shared_read_ds);
        dm_deferred_set_destroy(pool->all_io_ds);
        kfree(pool);
        pool->low_water_triggered = false;
        pool->suspended = true;
        pool->out_of_data_space = false;
+       bio_init(&pool->flush_bio, NULL, 0);
 
        pool->shared_read_ds = dm_deferred_set_create();
        if (!pool->shared_read_ds) {
        __pool_dec(pt->pool);
        dm_put_device(ti, pt->metadata_dev);
        dm_put_device(ti, pt->data_dev);
-       bio_uninit(&pt->flush_bio);
        kfree(pt);
 
        mutex_unlock(&dm_thin_pool_table.mutex);
  */
 static int metadata_pre_commit_callback(void *context)
 {
-       struct pool_c *pt = context;
-       struct bio *flush_bio = &pt->flush_bio;
+       struct pool *pool = context;
+       struct bio *flush_bio = &pool->flush_bio;
 
        bio_reset(flush_bio);
-       bio_set_dev(flush_bio, pt->data_dev->bdev);
+       bio_set_dev(flush_bio, pool->data_dev);
        flush_bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
 
        return submit_bio_wait(flush_bio);
        pt->data_dev = data_dev;
        pt->low_water_blocks = low_water_blocks;
        pt->adjusted_pf = pt->requested_pf = pf;
-       bio_init(&pt->flush_bio, NULL, 0);
        ti->num_flush_bios = 1;
 
        /*
        if (r)
                goto out_flags_changed;
 
+       dm_pool_register_pre_commit_callback(pool->pmd,
+                                            metadata_pre_commit_callback, pool);
+
        pt->callbacks.congested_fn = pool_is_congested;
        dm_table_add_target_callbacks(ti->table, &pt->callbacks);
 
        if (r)
                return r;
 
-       dm_pool_register_pre_commit_callback(pool->pmd,
-                                            metadata_pre_commit_callback, pt);
-
        r = maybe_resize_data_dev(ti, &need_commit1);
        if (r)
                return r;