Lines Matching refs:iter
202 nvme_log_discover_fini(nvme_log_iter_t *iter) in nvme_log_discover_fini() argument
204 free(iter); in nvme_log_discover_fini()
208 nvme_log_discover_one(nvme_log_iter_t *iter, const nvme_log_page_info_t *info) in nvme_log_discover_one() argument
211 nvme_log_disc_t *disc = &iter->nli_nld; in nvme_log_discover_one()
215 data.vcd_vers = &iter->nli_ctrl->nc_vers; in nvme_log_discover_one()
216 data.vcd_id = &iter->nli_ctrl->nc_info; in nvme_log_discover_one()
223 if ((iter->nli_scope & scope) == 0) { in nvme_log_discover_one()
263 nvme_log_discover_step(nvme_log_iter_t *iter, const nvme_log_disc_t **outp) in nvme_log_discover_step() argument
266 nvme_ctrl_t *ctrl = iter->nli_ctrl; in nvme_log_discover_step()
268 if (iter->nli_std_done && iter->nli_vs_done) { in nvme_log_discover_step()
279 if (!iter->nli_std_done) { in nvme_log_discover_step()
280 while (iter->nli_cur_idx < nvme_std_log_npages) { in nvme_log_discover_step()
282 &nvme_std_log_pages[iter->nli_cur_idx]; in nvme_log_discover_step()
283 iter->nli_cur_idx++; in nvme_log_discover_step()
284 if (nvme_log_discover_one(iter, info)) { in nvme_log_discover_step()
285 *outp = &iter->nli_nld; in nvme_log_discover_step()
289 iter->nli_std_done = true; in nvme_log_discover_step()
290 iter->nli_cur_idx = 0; in nvme_log_discover_step()
294 iter->nli_vs_done = true; in nvme_log_discover_step()
298 while (iter->nli_cur_idx < ctrl->nc_vsd->nvd_nlogs) { in nvme_log_discover_step()
300 ctrl->nc_vsd->nvd_logs[iter->nli_cur_idx]; in nvme_log_discover_step()
301 iter->nli_cur_idx++; in nvme_log_discover_step()
302 if (nvme_log_discover_one(iter, info)) { in nvme_log_discover_step()
303 *outp = &iter->nli_nld; in nvme_log_discover_step()
308 iter->nli_vs_done = true; in nvme_log_discover_step()
309 iter->nli_cur_idx = 0; in nvme_log_discover_step()
317 nvme_log_iter_t *iter; in nvme_log_discover_init() local
329 iter = calloc(1, sizeof (nvme_log_iter_t)); in nvme_log_discover_init()
330 if (iter == NULL) { in nvme_log_discover_init()
337 iter->nli_ctrl = ctrl; in nvme_log_discover_init()
338 iter->nli_scope = scopes; in nvme_log_discover_init()
340 *iterp = iter; in nvme_log_discover_init()
352 nvme_log_iter_t *iter; in nvme_log_discover() local
362 if (!nvme_log_discover_init(ctrl, scopes, flags, &iter)) { in nvme_log_discover()
366 while ((ret = nvme_log_discover_step(iter, &disc)) == NVME_ITER_VALID) { in nvme_log_discover()
371 nvme_log_discover_fini(iter); in nvme_log_discover()