Lines Matching defs:raid_ch
71 struct raid_bdev_io_channel *raid_ch;
141 raid_bdev_channel_get_base_channel(struct raid_bdev_io_channel *raid_ch, uint8_t idx)
143 return raid_ch->base_channel[idx];
147 raid_bdev_channel_get_module_ctx(struct raid_bdev_io_channel *raid_ch)
149 assert(raid_ch->module_channel != NULL);
151 return spdk_io_channel_get_ctx(raid_ch->module_channel);
155 raid_bdev_channel_get_base_info(struct raid_bdev_io_channel *raid_ch, struct spdk_bdev *base_bdev)
157 struct spdk_io_channel *ch = spdk_io_channel_from_ctx(raid_ch);
180 raid_bdev_ch_process_cleanup(struct raid_bdev_io_channel *raid_ch)
182 raid_ch->process.offset = RAID_OFFSET_BLOCKS_INVALID;
184 if (raid_ch->process.target_ch != NULL) {
185 spdk_put_io_channel(raid_ch->process.target_ch);
186 raid_ch->process.target_ch = NULL;
189 if (raid_ch->process.ch_processed != NULL) {
190 free(raid_ch->process.ch_processed->base_channel);
191 free(raid_ch->process.ch_processed);
192 raid_ch->process.ch_processed = NULL;
197 raid_bdev_ch_process_setup(struct raid_bdev_io_channel *raid_ch, struct raid_bdev_process *process)
203 raid_ch->process.offset = process->window_offset;
210 raid_ch->process.target_ch = spdk_bdev_get_io_channel(process->target->desc);
211 if (raid_ch->process.target_ch == NULL) {
219 raid_ch->process.ch_processed = raid_ch_processed;
231 raid_ch_processed->base_channel[slot] = raid_ch->base_channel[slot];
233 raid_ch_processed->base_channel[slot] = raid_ch->process.target_ch;
237 raid_ch_processed->module_channel = raid_ch->module_channel;
242 raid_bdev_ch_process_cleanup(raid_ch);
261 struct raid_bdev_io_channel *raid_ch = ctx_buf;
265 SPDK_DEBUGLOG(bdev_raid, "raid_bdev_create_cb, %p\n", raid_ch);
270 raid_ch->base_channel = calloc(raid_bdev->num_base_bdevs, sizeof(struct spdk_io_channel *));
271 if (!raid_ch->base_channel) {
288 raid_ch->base_channel[i] = spdk_bdev_get_io_channel(
290 if (!raid_ch->base_channel[i]) {
297 raid_ch->module_channel = raid_bdev->module->get_io_channel(raid_bdev);
298 if (!raid_ch->module_channel) {
305 ret = raid_bdev_ch_process_setup(raid_ch, raid_bdev->process);
311 raid_ch->process.offset = RAID_OFFSET_BLOCKS_INVALID;
317 if (raid_ch->base_channel[i] != NULL) {
318 spdk_put_io_channel(raid_ch->base_channel[i]);
321 free(raid_ch->base_channel);
323 raid_bdev_ch_process_cleanup(raid_ch);
342 struct raid_bdev_io_channel *raid_ch = ctx_buf;
347 assert(raid_ch != NULL);
348 assert(raid_ch->base_channel);
350 if (raid_ch->module_channel) {
351 spdk_put_io_channel(raid_ch->module_channel);
356 if (raid_ch->base_channel[i] != NULL) {
357 spdk_put_io_channel(raid_ch->base_channel[i]);
360 free(raid_ch->base_channel);
361 raid_ch->base_channel = NULL;
363 raid_bdev_ch_process_cleanup(raid_ch);
637 raid_io->raid_ch = raid_io->raid_ch->process.ch_processed;
778 base_ch = raid_io->raid_ch->base_channel[i];
842 struct raid_bdev_io_channel *raid_ch = raid_io->raid_ch;
844 if (raid_ch->process.offset != RAID_OFFSET_BLOCKS_INVALID) {
848 if (offset_end > raid_ch->process.offset) {
849 if (offset_begin < raid_ch->process.offset) {
860 raid_ch->process.offset, offset_begin, offset_end);
861 raid_bdev_io_split(raid_io, raid_ch->process.offset - offset_begin);
865 raid_io->raid_ch = raid_ch->process.ch_processed;
901 raid_bdev_io_init(struct raid_bdev_io *raid_io, struct raid_bdev_io_channel *raid_ch,
906 struct spdk_io_channel *ch = spdk_io_channel_from_ctx(raid_ch);
919 raid_io->raid_ch = raid_ch;
1971 struct raid_bdev_io_channel *raid_ch = spdk_io_channel_get_ctx(ch);
1974 SPDK_DEBUGLOG(bdev_raid, "slot: %u raid_ch: %p\n", idx, raid_ch);
1976 if (raid_ch->base_channel[idx] != NULL) {
1977 spdk_put_io_channel(raid_ch->base_channel[idx]);
1978 raid_ch->base_channel[idx] = NULL;
1981 if (raid_ch->process.ch_processed != NULL) {
1982 raid_ch->process.ch_processed->base_channel[idx] = NULL;
2555 if (process->raid_ch != NULL) {
2556 spdk_put_io_channel(spdk_io_channel_from_ctx(process->raid_ch));
2594 struct raid_bdev_io_channel *raid_ch = spdk_io_channel_get_ctx(ch);
2599 raid_ch->base_channel[slot] = raid_ch->process.target_ch;
2600 raid_ch->process.target_ch = NULL;
2603 raid_bdev_ch_process_cleanup(raid_ch);
2716 struct raid_bdev_io_channel *raid_ch = spdk_io_channel_get_ctx(ch);
2718 raid_ch->process.offset = process->window_offset + process->window_size;
2764 process_req->target_ch = process->raid_ch->process.target_ch;
2769 ret = raid_bdev->module->submit_process_request(process_req, process->raid_ch);
2926 process->raid_ch = spdk_io_channel_get_ctx(ch);
2956 struct raid_bdev_io_channel *raid_ch = spdk_io_channel_get_ctx(ch);
2958 raid_bdev_ch_process_cleanup(raid_ch);
3010 struct raid_bdev_io_channel *raid_ch = spdk_io_channel_get_ctx(ch);
3013 rc = raid_bdev_ch_process_setup(raid_ch, process);