Lines Matching defs:vio

6 #include "vio.h"
43 struct vio *vio = bio->bi_private;
44 struct vdo *vdo = vio->completion.vdo;
80 unsigned int block_count, char *data, struct vio *vio)
100 initialize_vio(vio, bio, block_count, vio_type, priority, vdo);
101 vio->completion.parent = parent;
102 vio->data = data;
107 * create_multi_block_metadata_vio() - Create a vio.
108 * @vdo: The vdo on which the vio will operate.
109 * @vio_type: The type of vio to create.
110 * @priority: The relative priority to assign to the vio.
111 * @parent: The parent of the vio.
112 * @block_count: The size of the vio in blocks.
114 * @vio_ptr: A pointer to hold the new vio.
121 struct vio **vio_ptr)
123 struct vio *vio;
126 BUILD_BUG_ON(sizeof(struct vio) > 256);
132 result = vdo_allocate(1, struct vio, __func__, &vio);
134 vdo_log_error("metadata vio allocation failure %d", result);
139 data, vio);
141 vdo_free(vio);
145 *vio_ptr = vio;
150 * free_vio_components() - Free the components of a vio embedded in a larger structure.
151 * @vio: The vio to destroy
153 void free_vio_components(struct vio *vio)
155 if (vio == NULL)
158 BUG_ON(is_data_vio(vio));
159 vdo_free_bio(vdo_forget(vio->bio));
163 * free_vio() - Destroy a vio.
164 * @vio: The vio to destroy.
166 void free_vio(struct vio *vio)
168 free_vio_components(vio);
169 vdo_free(vio);
173 void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callback,
176 struct vdo *vdo = vio->completion.vdo;
180 vio->bio_zone = ((pbn / config->thread_counts.bio_rotation_interval) %
183 bio->bi_private = vio;
192 * vio associated with the bio.
194 int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback,
198 struct bio *bio = vio->bio;
201 vdo_set_bio_properties(bio, vio, callback, bi_opf, pbn);
206 bio->bi_max_vecs = vio->block_count + 1;
207 len = VDO_BLOCK_SIZE * vio->block_count;
242 * update_vio_error_stats() - Update per-vio error stats and log the error.
243 * @vio: The vio which got an error.
246 void update_vio_error_stats(struct vio *vio, const char *format, ...)
252 struct vdo *vdo = vio->completion.vdo;
254 switch (vio->completion.result) {
272 vdo_vlog_strerror(priority, vio->completion.result, VDO_LOGGING_MODULE_NAME,
277 void vio_record_metadata_io_error(struct vio *vio)
280 physical_block_number_t pbn = pbn_from_vio_bio(vio->bio);
282 if (bio_op(vio->bio) == REQ_OP_READ) {
284 } else if ((vio->bio->bi_opf & REQ_PREFLUSH) == REQ_PREFLUSH) {
285 description = (((vio->bio->bi_opf & REQ_FUA) == REQ_FUA) ?
288 } else if ((vio->bio->bi_opf & REQ_FUA) == REQ_FUA) {
294 update_vio_error_stats(vio,
295 "Completing %s vio of type %u for physical block %llu with error",
296 description, vio->type, (unsigned long long) pbn);
300 * make_vio_pool() - Create a new vio pool.
340 &pooled->vio);
355 * free_vio_pool() - Destroy a vio pool.
376 free_vio_components(&pooled->vio);
388 * is_vio_pool_busy() - Check whether an vio pool has outstanding entries.
398 * acquire_vio_from_pool() - Acquire a vio and buffer from the pool (asynchronous).
399 * @pool: The vio pool.
400 * @waiter: Object that is requesting a vio.
421 * return_vio_to_pool() - Return a vio to the pool
422 * @pool: The vio pool.
423 * @vio: The pooled vio to return.
425 void return_vio_to_pool(struct vio_pool *pool, struct pooled_vio *vio)
428 "vio pool entry returned on same thread as it was acquired");
430 vio->vio.completion.error_handler = NULL;
431 vio->vio.completion.parent = NULL;
433 vdo_waitq_notify_next_waiter(&pool->waiting, NULL, vio);
437 list_move_tail(&vio->pool_entry, &pool->available);
478 static void count_all_bios_completed(struct vio *vio, struct bio *bio)
480 struct atomic_statistics *stats = &vio->completion.vdo->stats;
482 if (is_data_vio(vio)) {
488 if (vio->type == VIO_TYPE_RECOVERY_JOURNAL)
490 else if (vio->type == VIO_TYPE_BLOCK_MAP)
496 struct vio *vio = (struct vio *) bio->bi_private;
498 atomic64_inc(&vio->completion.vdo->stats.bios_completed);
499 count_all_bios_completed(vio, bio);