Lines Matching +full:cam +full:- +full:if
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_backend.c#3 $
51 #include <cam/scsi/scsi_all.h>
52 #include <cam/scsi/scsi_da.h>
53 #include <cam/ctl/ctl_io.h>
54 #include <cam/ctl/ctl.h>
55 #include <cam/ctl/ctl_frontend.h>
56 #include <cam/ctl/ctl_backend.h>
57 #include <cam/ctl/ctl_ioctl.h>
58 #include <cam/ctl/ctl_ha.h>
59 #include <cam/ctl/ctl_private.h>
60 #include <cam/ctl/ctl_debug.h>
70 mtx_lock(&softc->ctl_lock);
71 STAILQ_FOREACH(be_tmp, &softc->be_list, links) {
72 if (strcmp(be_tmp->name, be->name) == 0) {
73 mtx_unlock(&softc->ctl_lock);
74 return (-1);
77 mtx_unlock(&softc->ctl_lock);
79 be->config_move_done = ctl_config_move_done;
83 if (be->init != NULL) {
84 if ((error = be->init()) != 0) {
86 be->name, error);
91 mtx_lock(&softc->ctl_lock);
92 STAILQ_INSERT_TAIL(&softc->be_list, be, links);
93 softc->num_backends++;
94 mtx_unlock(&softc->ctl_lock);
105 if (be->shutdown != NULL) {
106 if ((error = be->shutdown()) != 0) {
108 be->name, error);
113 mtx_lock(&softc->ctl_lock);
114 STAILQ_REMOVE(&softc->be_list, be, ctl_backend_driver, links);
115 softc->num_backends--;
116 mtx_unlock(&softc->ctl_lock);
126 mtx_lock(&softc->ctl_lock);
127 STAILQ_FOREACH(be_tmp, &softc->be_list, links) {
128 if (strcmp(be_tmp->name, backend_name) == 0) {
129 mtx_unlock(&softc->ctl_lock);
133 mtx_unlock(&softc->ctl_lock);