aboutsummaryrefslogtreecommitdiffstats
path: root/sys/cam/nvme/nvme_da.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-10-15 23:53:55 +0000
committerWarner Losh <imp@FreeBSD.org>2017-10-15 23:53:55 +0000
commitfa271a5d09d6dc12cd0e3838cd92a90daaf5819c (patch)
treea7bf29f687d875b7b5d705f102283c7a225688f5 /sys/cam/nvme/nvme_da.c
parent57ef3db3a9e4160b29077577e933239a1f0c3903 (diff)
downloadsrc-fa271a5d09d6dc12cd0e3838cd92a90daaf5819c.tar.gz
src-fa271a5d09d6dc12cd0e3838cd92a90daaf5819c.zip
Closer examination shows that nvme and CAM both normally zero-fill
allocations (for req and ccb, which ultimately contain the nvme_cmd). As such, we can micro-optimize these routines. Add a comment to this effect, and bzero the ccb used to make the requests for the nda dump rotuine so it more closely matches a ccb allocated with xpt_get_ccb(). Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=324644
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r--sys/cam/nvme/nvme_da.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 807cf3e0ea15..f0f438b4fb79 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -398,6 +398,8 @@ ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
return (ENXIO);
}
+ /* xpt_get_ccb returns a zero'd allocation for the ccb, mimic that here */
+ memset(&nvmeio, 0, sizeof(nvmeio));
if (length > 0) {
xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP;