aboutsummaryrefslogtreecommitdiffstats
path: root/sys/cam/nvme/nvme_da.c
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2018-01-09 00:17:15 +0000
committerScott Long <scottl@FreeBSD.org>2018-01-09 00:17:15 +0000
commitbff0b56cdfd0a49275a7872da706cb2cf529eff8 (patch)
treef89f804358b846ce20abc4503497bff7c7da0c4d /sys/cam/nvme/nvme_da.c
parent04e814aecd6a4d831c78c11826d5e8df06b914d5 (diff)
downloadsrc-bff0b56cdfd0a49275a7872da706cb2cf529eff8.tar.gz
src-bff0b56cdfd0a49275a7872da706cb2cf529eff8.zip
Don't hold the periph locks during dump.
Obtained from: Netflix
Notes
Notes: svn path=/head/; revision=327711
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r--sys/cam/nvme/nvme_da.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 5c3c89b4b32f..4ed62cb58612 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -388,15 +388,12 @@ ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
dp = arg;
periph = dp->d_drv1;
softc = (struct nda_softc *)periph->softc;
- cam_periph_lock(periph);
secsize = softc->disk->d_sectorsize;
lba = offset / secsize;
count = length / secsize;
- if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
- cam_periph_unlock(periph);
+ if ((periph->flags & CAM_PERIPH_INVALID) != 0)
return (ENXIO);
- }
/* xpt_get_ccb returns a zero'd allocation for the ccb, mimic that here */
memset(&nvmeio, 0, sizeof(nvmeio));
@@ -408,7 +405,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
0, SF_NO_RECOVERY | SF_NO_RETRY, NULL);
if (error != 0)
printf("Aborting dump due to I/O error %d.\n", error);
- cam_periph_unlock(periph);
return (error);
}
@@ -422,7 +418,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
0, SF_NO_RECOVERY | SF_NO_RETRY, NULL);
if (error != 0)
xpt_print(periph->path, "flush cmd failed\n");
- cam_periph_unlock(periph);
return (error);
}