diff options
author | Warner Losh <imp@FreeBSD.org> | 2018-02-07 18:33:46 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2018-02-07 18:33:46 +0000 |
commit | 9d602e4e3d4b1b49274f7a29ccb365f7fe1a0d08 (patch) | |
tree | 09db2cdda344fe564c6ea02ed9e2408093d4f31e /sys/cam/nvme/nvme_da.c | |
parent | 5073a083280f08e9e2b86b064f43c30b7e504611 (diff) | |
download | src-9d602e4e3d4b1b49274f7a29ccb365f7fe1a0d08.tar.gz src-9d602e4e3d4b1b49274f7a29ccb365f7fe1a0d08.zip |
Fix cut and pasted comments to reflect differences in code from the
original source.
Sponsored by: Netflix
Notes
Notes:
svn path=/head/; revision=328983
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r-- | sys/cam/nvme/nvme_da.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 40ef7c70765f..5f06aa8041fc 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1094,19 +1094,25 @@ ndaflush(void) CAM_PERIPH_FOREACH(periph, &ndadriver) { softc = (struct nda_softc *)periph->softc; + if (SCHEDULER_STOPPED()) { - /* If we paniced with the lock held, do not recurse. */ + /* + * If we paniced with the lock held or the periph is not + * open, do not recurse. Otherwise, call ndadump since + * that avoids the sleeping cam_periph_getccb does if no + * CCBs are available. + */ if (!cam_periph_owned(periph) && (softc->flags & NDA_FLAG_OPEN)) { ndadump(softc->disk, NULL, 0, 0, 0); } continue; } - cam_periph_lock(periph); + /* - * We only sync the cache if the drive is still open, and - * if the drive is capable of it.. + * We only sync the cache if the drive is still open */ + cam_periph_lock(periph); if ((softc->flags & NDA_FLAG_OPEN) == 0) { cam_periph_unlock(periph); continue; |