Deleted Added
full compact
ctl_frontend_iscsi.c (268141) ctl_frontend_iscsi.c (268143)
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 268141 2014-07-02 10:20:08Z mav $
29 * $FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 268143 2014-07-02 10:35:06Z mav $
30 */
31
32/*
33 * CTL frontend for the iSCSI protocol.
34 */
35
36#include <sys/cdefs.h>
30 */
31
32/*
33 * CTL frontend for the iSCSI protocol.
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 268141 2014-07-02 10:20:08Z mav $");
37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 268143 2014-07-02 10:35:06Z mav $");
38
39#include <sys/param.h>
40#include <sys/capability.h>
41#include <sys/condvar.h>
42#include <sys/file.h>
43#include <sys/kernel.h>
44#include <sys/kthread.h>
45#include <sys/lock.h>

--- 2260 unchanged lines hidden (view full) ---

2306 return (0);
2307}
2308
2309static int
2310cfiscsi_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
2311{
2312 struct cfiscsi_softc *softc;
2313 struct cfiscsi_target *ct;
38
39#include <sys/param.h>
40#include <sys/capability.h>
41#include <sys/condvar.h>
42#include <sys/file.h>
43#include <sys/kernel.h>
44#include <sys/kthread.h>
45#include <sys/lock.h>

--- 2260 unchanged lines hidden (view full) ---

2306 return (0);
2307}
2308
2309static int
2310cfiscsi_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
2311{
2312 struct cfiscsi_softc *softc;
2313 struct cfiscsi_target *ct;
2314 struct ctl_be_lun_option *opt;
2315 const char *target = NULL, *target_alias = NULL;
2316 const char *lun = NULL;
2317 unsigned long tmp;
2318
2319 softc = (struct cfiscsi_softc *)arg;
2320
2314 const char *target = NULL, *target_alias = NULL;
2315 const char *lun = NULL;
2316 unsigned long tmp;
2317
2318 softc = (struct cfiscsi_softc *)arg;
2319
2321 STAILQ_FOREACH(opt,
2322 &control_softc->ctl_luns[lun_id]->be_lun->options, links) {
2323 if (strcmp(opt->name, "cfiscsi_target") == 0)
2324 target = opt->value;
2325 else if (strcmp(opt->name, "cfiscsi_target_alias") == 0)
2326 target_alias = opt->value;
2327 else if (strcmp(opt->name, "cfiscsi_lun") == 0)
2328 lun = opt->value;
2329 }
2320 target = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
2321 "cfiscsi_target");
2322 target_alias = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
2323 "cfiscsi_target_alias");
2324 lun = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
2325 "cfiscsi_lun");
2330
2331 if (target == NULL && lun == NULL)
2332 return (0);
2333
2334 if (target == NULL || lun == NULL) {
2335 CFISCSI_WARN("lun added with cfiscsi_target, but without "
2336 "cfiscsi_lun, or the other way around; ignoring");
2337 return (0);

--- 538 unchanged lines hidden ---
2326
2327 if (target == NULL && lun == NULL)
2328 return (0);
2329
2330 if (target == NULL || lun == NULL) {
2331 CFISCSI_WARN("lun added with cfiscsi_target, but without "
2332 "cfiscsi_lun, or the other way around; ignoring");
2333 return (0);

--- 538 unchanged lines hidden ---