summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvd/nvd.c
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2013-03-26 21:00:18 +0000
committerjimharris <jimharris@FreeBSD.org>2013-03-26 21:00:18 +0000
commit3c0b8367a2ce30c62befa431e1720df65cfc1f49 (patch)
treead79338c72d5a2294eab91a297a57e1b956519e0 /sys/dev/nvd/nvd.c
parentd0a775e7949e871c4beabbef339069ca9560c538 (diff)
downloadFreeBSD-src-3c0b8367a2ce30c62befa431e1720df65cfc1f49.zip
FreeBSD-src-3c0b8367a2ce30c62befa431e1720df65cfc1f49.tar.gz
Create struct nvme_status.
NVMe error log entries include status, so breaking this out into its own data structure allows it to be included in both the nvme_completion data structure as well as error log entry data structures. While here, expose nvme_completion_is_error(), and change all of the places that were explicitly looking at sc/sct bits to use this macro instead. Sponsored by: Intel Reviewed by: carl
Diffstat (limited to 'sys/dev/nvd/nvd.c')
-rw-r--r--sys/dev/nvd/nvd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c
index 5072889..0eb1922 100644
--- a/sys/dev/nvd/nvd.c
+++ b/sys/dev/nvd/nvd.c
@@ -153,7 +153,7 @@ nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag,
}
static void
-nvd_done(void *arg, const struct nvme_completion *status)
+nvd_done(void *arg, const struct nvme_completion *cpl)
{
struct bio *bp;
struct nvd_disk *ndisk;
@@ -168,7 +168,7 @@ nvd_done(void *arg, const struct nvme_completion *status)
* TODO: add more extensive translation of NVMe status codes
* to different bio error codes (i.e. EIO, EINVAL, etc.)
*/
- if (status->sf_sc || status->sf_sct) {
+ if (nvme_completion_is_error(cpl)) {
bp->bio_error = EIO;
bp->bio_flags |= BIO_ERROR;
bp->bio_resid = bp->bio_bcount;
OpenPOWER on IntegriCloud