Lines Matching full:vio

25 	/* The underlying vio */
26 struct vio vio; member
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) in as_vio()
44 return container_of(completion, struct vio, completion); in as_vio()
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) in get_vio_bio_zone_thread_id() argument
56 return vio->completion.vdo->thread_config.bio_threads[vio->bio_zone]; in get_vio_bio_zone_thread_id()
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) in assert_vio_in_bio_zone() argument
67 thread_id_t expected = get_vio_bio_zone_thread_id(vio); in assert_vio_in_bio_zone()
71 "vio I/O for physical block %llu on thread %u, should be on bio zone thread %u", in assert_vio_in_bio_zone()
72 (unsigned long long) pbn_from_vio_bio(vio->bio), thread_id, in assert_vio_in_bio_zone()
80 unsigned int block_count, char *data, struct vio *vio);
84 char *data, struct vio **vio_ptr);
89 struct vio **vio_ptr) in create_metadata_vio()
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, in initialize_vio() argument
114 vio->bio = bio; in initialize_vio()
115 vio->block_count = block_count; in initialize_vio()
116 vio->type = vio_type; in initialize_vio()
117 vio->priority = priority; in initialize_vio()
118 vdo_initialize_completion(&vio->completion, vdo, VIO_COMPLETION); in initialize_vio()
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) in is_data_vio() argument
136 return (vio->type == VIO_TYPE_DATA); in is_data_vio()
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) in get_metadata_priority() argument
147 return ((vio->priority == VIO_PRIORITY_HIGH) ? in get_metadata_priority()
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) in continue_vio() argument
161 vdo_set_completion_result(&vio->completion, result); in continue_vio()
163 vdo_enqueue_completion(&vio->completion, VDO_WORK_Q_DEFAULT_PRIORITY); in continue_vio()
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, in continue_vio_after_io() argument
175 vdo_count_completed_bios(vio->bio); in continue_vio_after_io()
176 vdo_set_completion_callback(&vio->completion, callback, thread); in continue_vio_after_io()
177 continue_vio(vio, blk_status_to_errno(vio->bio->bi_status)); in continue_vio_after_io()
180 void vio_record_metadata_io_error(struct vio *vio);
184 static inline struct pooled_vio *vio_as_pooled_vio(struct vio *vio) in vio_as_pooled_vio() argument
186 return container_of(vio, struct pooled_vio, vio); in vio_as_pooled_vio()
197 void return_vio_to_pool(struct vio_pool *pool, struct pooled_vio *vio);