git: 1907e1c07c36 - main - ada: Move comment
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 May 2022 22:54:40 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1907e1c07c3616bc49309f017d24106d2773b24a commit 1907e1c07c3616bc49309f017d24106d2773b24a Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2022-05-04 22:53:03 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-05-04 22:54:38 +0000 ada: Move comment Move the comment about releasing ccb before periph to adaprobedone() where it belongs. Sponsored by: Netflix --- sys/cam/ata/ata_da.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index b76058c8f19d..aed08a8566ae 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -2691,6 +2691,12 @@ adaprobedone(struct cam_periph *periph, union ccb *ccb) softc = (struct ada_softc *)periph->softc; + /* + * Since our peripheral may be invalidated by an error we must release + * our CCB before releasing the reference on the peripheral. The + * peripheral will only go away once the last reference is removed, and + * we need it around for the CCB release operation. + */ if (ccb != NULL) xpt_release_ccb(ccb); @@ -2987,15 +2993,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb) } } - /* - * Since our peripheral may be invalidated by an error - * above or an external event, we must release our CCB - * before releasing the reference on the peripheral. - * The peripheral will only go away once the last reference - * is removed, and we need it around for the CCB release - * operation. - */ - xpt_release_ccb(done_ccb); softc->state = ADA_STATE_WCACHE; xpt_schedule(periph, priority);