Lines Matching refs:req
37 static void nvme_disk_callback(nvme_request_t *req, struct lock *lk);
230 nvme_request_t *req; in nvme_strategy_core() local
242 req = NULL; in nvme_strategy_core()
256 req = nvme_get_request(subq, NVME_IOCMD_READ, in nvme_strategy_core()
258 if (req == NULL) in nvme_strategy_core()
261 req->cmd.read.head.nsid = nsc->nsid; in nvme_strategy_core()
262 req->cmd.read.start_lba = secno; in nvme_strategy_core()
263 req->cmd.read.count_lba = nlba - 1; /* 0's based */ in nvme_strategy_core()
264 req->cmd.read.ioflags = 0; /* NVME_IOFLG_LR, NVME_IOFLG_FUA */ in nvme_strategy_core()
265 req->cmd.read.dsm = 0; /* NVME_DSM_INCOMPRESSIBLE */ in nvme_strategy_core()
275 req = nvme_get_request(subq, NVME_IOCMD_WRITE, in nvme_strategy_core()
277 if (req == NULL) in nvme_strategy_core()
279 req->cmd.write.head.nsid = nsc->nsid; in nvme_strategy_core()
280 req->cmd.write.start_lba = secno; in nvme_strategy_core()
281 req->cmd.write.count_lba = nlba - 1; /* 0's based */ in nvme_strategy_core()
294 req = nvme_get_request(subq, NVME_IOCMD_WRITEZ, NULL, 0); in nvme_strategy_core()
295 if (req == NULL) in nvme_strategy_core()
297 req->cmd.writez.head.nsid = nsc->nsid; in nvme_strategy_core()
298 req->cmd.writez.start_lba = secno; in nvme_strategy_core()
299 req->cmd.writez.count_lba = nlba - 1; /* 0's based */ in nvme_strategy_core()
300 req->cmd.read.ioflags = 0; /* NVME_IOFLG_LR, NVME_IOFLG_FUA */ in nvme_strategy_core()
301 req->cmd.read.dsm = 0; /* NVME_DSM_INCOMPRESSIBLE */ in nvme_strategy_core()
307 req = nvme_get_request(subq, NVME_IOCMD_FLUSH, NULL, 0); in nvme_strategy_core()
308 if (req == NULL) in nvme_strategy_core()
310 req->cmd.flush.head.nsid = nsc->nsid; in nvme_strategy_core()
319 if (req) { in nvme_strategy_core()
332 req->callback = nvme_disk_callback; in nvme_strategy_core()
333 req->nsc = nsc; in nvme_strategy_core()
334 req->bio = bio; in nvme_strategy_core()
337 nvme_submit_request(req); /* needs subq lock */ in nvme_strategy_core()
340 comq = req->comq; in nvme_strategy_core()
344 if (req->state == NVME_REQ_SUBMITTED) { in nvme_strategy_core()
349 req->callback = nvme_disk_callback; in nvme_strategy_core()
355 nvme_disk_callback(req, &comq->lk); in nvme_strategy_core()
394 nvme_disk_callback(nvme_request_t *req, struct lock *lk) in nvme_disk_callback() argument
396 nvme_softns_t *nsc = req->nsc; in nvme_disk_callback()
402 code = NVME_COMQ_STATUS_CODE_GET(req->res.tail.status); in nvme_disk_callback()
403 type = NVME_COMQ_STATUS_TYPE_GET(req->res.tail.status); in nvme_disk_callback()
404 bio = req->bio; in nvme_disk_callback()
409 nvme_put_request(req); /* does not need subq lock */ in nvme_disk_callback()
453 nvme_request_t *req; in nvme_dump() local
470 req = nvme_get_dump_request(subq, NVME_IOCMD_WRITE, in nvme_dump()
472 req->cmd.write.head.nsid = nsc->nsid; in nvme_dump()
473 req->cmd.write.start_lba = secno; in nvme_dump()
474 req->cmd.write.count_lba = nlba - 1; /* 0's based */ in nvme_dump()
481 req = nvme_get_dump_request(subq, NVME_IOCMD_FLUSH, NULL, 0); in nvme_dump()
482 req->cmd.flush.head.nsid = nsc->nsid; in nvme_dump()
489 req->callback = NULL; in nvme_dump()
490 req->nsc = nsc; in nvme_dump()
503 nvme_submit_request(req); /* needs subq lock */ in nvme_dump()
507 comq = req->comq; in nvme_dump()
508 nvme_poll_request(req); in nvme_dump()
509 nvme_put_dump_request(req); /* does not need subq lock */ in nvme_dump()