Lines Matching defs:vio

25 	/* The underlying vio */
26 struct vio vio;
36 * as_vio() - Convert a generic vdo_completion to a vio.
39 * Return: The completion as a vio.
41 static inline struct vio *as_vio(struct vdo_completion *completion)
44 return container_of(completion, struct vio, completion);
48 * get_vio_bio_zone_thread_id() - Get the thread id of the bio zone in which a vio should submit
50 * @vio: The vio.
52 * Return: The id of the bio zone thread the vio should use.
54 static inline thread_id_t __must_check get_vio_bio_zone_thread_id(struct vio *vio)
56 return vio->completion.vdo->thread_config.bio_threads[vio->bio_zone];
62 * assert_vio_in_bio_zone() - Check that a vio is running on the correct thread for its bio zone.
63 * @vio: The vio to check.
65 static inline void assert_vio_in_bio_zone(struct vio *vio)
67 thread_id_t expected = get_vio_bio_zone_thread_id(vio);
71 "vio I/O for physical block %llu on thread %u, should be on bio zone thread %u",
72 (unsigned long long) pbn_from_vio_bio(vio->bio), thread_id,
80 unsigned int block_count, char *data, struct vio *vio);
84 char *data, struct vio **vio_ptr);
89 struct vio **vio_ptr)
95 void free_vio_components(struct vio *vio);
96 void free_vio(struct vio *vio);
99 * initialize_vio() - Initialize a vio.
100 * @vio: The vio to initialize.
101 * @bio: The bio this vio should use for its I/O.
102 * @block_count: The size of this vio in vdo blocks.
103 * @vio_type: The vio type.
104 * @priority: The relative priority of the vio.
105 * @vdo: The vdo for this vio.
107 static inline void initialize_vio(struct vio *vio, struct bio *bio,
114 vio->bio = bio;
115 vio->block_count = block_count;
116 vio->type = vio_type;
117 vio->priority = priority;
118 vdo_initialize_completion(&vio->completion, vdo, VIO_COMPLETION);
121 void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callback,
124 int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback,
127 void update_vio_error_stats(struct vio *vio, const char *format, ...)
131 * is_data_vio() - Check whether a vio is servicing an external data request.
132 * @vio: The vio to check.
134 static inline bool is_data_vio(struct vio *vio)
136 return (vio->type == VIO_TYPE_DATA);
140 * get_metadata_priority() - Convert a vio's priority to a work item priority.
141 * @vio: The vio.
143 * Return: The priority with which to submit the vio's bio.
145 static inline enum vdo_completion_priority get_metadata_priority(struct vio *vio)
147 return ((vio->priority == VIO_PRIORITY_HIGH) ?
153 * continue_vio() - Enqueue a vio to run its next callback.
154 * @vio: The vio to continue.
158 static inline void continue_vio(struct vio *vio, int result)
161 vdo_set_completion_result(&vio->completion, result);
163 vdo_enqueue_completion(&vio->completion, VDO_WORK_Q_DEFAULT_PRIORITY);
170 * continue_vio_after_io() - Continue a vio now that its I/O has returned.
172 static inline void continue_vio_after_io(struct vio *vio, vdo_action_fn callback,
175 vdo_count_completed_bios(vio->bio);
176 vdo_set_completion_callback(&vio->completion, callback, thread);
177 continue_vio(vio, blk_status_to_errno(vio->bio->bi_status));
180 void vio_record_metadata_io_error(struct vio *vio);
184 static inline struct pooled_vio *vio_as_pooled_vio(struct vio *vio)
186 return container_of(vio, struct pooled_vio, vio);
197 void return_vio_to_pool(struct vio_pool *pool, struct pooled_vio *vio);