Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme.c
Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | if (cons->id != INVALID_CONSUMER_ID && | ||||
(ctrlr_cookie = ctrlr->cons_cookie[i]) != NULL) { | (ctrlr_cookie = ctrlr->cons_cookie[i]) != NULL) { | ||||
ctrlr->cons_cookie[i] = NULL; | ctrlr->cons_cookie[i] = NULL; | ||||
if (cons->fail_fn != NULL) | if (cons->fail_fn != NULL) | ||||
cons->fail_fn(ctrlr_cookie); | cons->fail_fn(ctrlr_cookie); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void | |||||
imp: No. Like I said before, we do not want to parse the NVME log pages in the clients. This change… | |||||
nvme_notify_ns(struct nvme_controller *ctrlr, int nsid) | |||||
{ | |||||
struct nvme_consumer *cons; | |||||
struct nvme_namespace *ns; | |||||
void *ctrlr_cookie; | |||||
uint32_t i; | |||||
KASSERT(nsid <= NVME_MAX_NAMESPACES, | |||||
("%s: Namespace notification to nsid %d exceeds range\n", | |||||
device_get_nameunit(ctrlr->dev), nsid)); | |||||
if (!ctrlr->is_initialized) | |||||
return; | |||||
ns = &ctrlr->ns[nsid - 1]; | |||||
for (i = 0; i < NVME_MAX_CONSUMERS; i++) { | |||||
cons = &nvme_consumer[i]; | |||||
if (cons->id != INVALID_CONSUMER_ID && cons->ns_fn != NULL && | |||||
(ctrlr_cookie = ctrlr->cons_cookie[i]) != NULL) | |||||
ns->cons_cookie[i] = (*cons->ns_fn)(ns, ctrlr_cookie); | |||||
} | |||||
} | |||||
struct nvme_consumer * | struct nvme_consumer * | ||||
nvme_register_consumer(nvme_cons_ns_fn_t ns_fn, nvme_cons_ctrlr_fn_t ctrlr_fn, | nvme_register_consumer(nvme_cons_ns_fn_t ns_fn, nvme_cons_ctrlr_fn_t ctrlr_fn, | ||||
nvme_cons_async_fn_t async_fn, | nvme_cons_async_fn_t async_fn, | ||||
nvme_cons_fail_fn_t fail_fn) | nvme_cons_fail_fn_t fail_fn) | ||||
{ | { | ||||
int i; | int i; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |
No. Like I said before, we do not want to parse the NVME log pages in the clients. This change is wrong.