Deleted Added
full compact
kernel.c (268684) kernel.c (268688)
1/*-
2 * Copyright (c) 2003, 2004 Silicon Graphics International Corp.
3 * Copyright (c) 1997-2007 Kenneth D. Merry
4 * Copyright (c) 2012 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Edward Tomasz Napierala
8 * under sponsorship from the FreeBSD Foundation.

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

27 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGES.
34 *
1/*-
2 * Copyright (c) 2003, 2004 Silicon Graphics International Corp.
3 * Copyright (c) 1997-2007 Kenneth D. Merry
4 * Copyright (c) 2012 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Edward Tomasz Napierala
8 * under sponsorship from the FreeBSD Foundation.

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

27 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGES.
34 *
35 * $FreeBSD: stable/10/usr.sbin/ctld/kernel.c 268684 2014-07-15 17:07:07Z mav $
35 * $FreeBSD: stable/10/usr.sbin/ctld/kernel.c 268688 2014-07-15 17:10:48Z mav $
36 */
37
38#include <sys/ioctl.h>
39#include <sys/types.h>
40#include <sys/stat.h>
41#include <sys/param.h>
42#include <sys/linker.h>
43#include <sys/queue.h>

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

115 char *cfiscsi_target;
116 int cfiscsi_lun;
117 STAILQ_HEAD(,cctl_lun_nv) attr_list;
118 STAILQ_ENTRY(cctl_lun) links;
119};
120
121struct cctl_port {
122 uint32_t port_id;
36 */
37
38#include <sys/ioctl.h>
39#include <sys/types.h>
40#include <sys/stat.h>
41#include <sys/param.h>
42#include <sys/linker.h>
43#include <sys/queue.h>

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

115 char *cfiscsi_target;
116 int cfiscsi_lun;
117 STAILQ_HEAD(,cctl_lun_nv) attr_list;
118 STAILQ_ENTRY(cctl_lun) links;
119};
120
121struct cctl_port {
122 uint32_t port_id;
123 int cfiscsi_status;
123 char *cfiscsi_target;
124 uint16_t cfiscsi_portal_group_tag;
125 STAILQ_HEAD(,cctl_lun_nv) attr_list;
126 STAILQ_ENTRY(cctl_port) links;
127};
128
129struct cctl_devlist_data {
130 int num_luns;

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

327
328 sbuf_delete(devlist->cur_sb[devlist->level]);
329 devlist->cur_sb[devlist->level] = NULL;
330 devlist->level--;
331
332 if (strcmp(name, "cfiscsi_target") == 0) {
333 cur_port->cfiscsi_target = str;
334 str = NULL;
124 char *cfiscsi_target;
125 uint16_t cfiscsi_portal_group_tag;
126 STAILQ_HEAD(,cctl_lun_nv) attr_list;
127 STAILQ_ENTRY(cctl_port) links;
128};
129
130struct cctl_devlist_data {
131 int num_luns;

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

328
329 sbuf_delete(devlist->cur_sb[devlist->level]);
330 devlist->cur_sb[devlist->level] = NULL;
331 devlist->level--;
332
333 if (strcmp(name, "cfiscsi_target") == 0) {
334 cur_port->cfiscsi_target = str;
335 str = NULL;
336 } else if (strcmp(name, "cfiscsi_status") == 0) {
337 cur_port->cfiscsi_status = strtoul(str, NULL, 0);
335 } else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) {
336 cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0);
337 } else if (strcmp(name, "targ_port") == 0) {
338 devlist->cur_port = NULL;
339 } else if (strcmp(name, "ctlportlist") == 0) {
340
341 } else {
342 struct cctl_lun_nv *nv;

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

489
490 STAILQ_FOREACH(port, &devlist.port_list, links) {
491
492 if (port->cfiscsi_target == NULL) {
493 log_debugx("CTL port %ju wasn't managed by ctld; "
494 "ignoring", (uintmax_t)port->port_id);
495 continue;
496 }
338 } else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) {
339 cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0);
340 } else if (strcmp(name, "targ_port") == 0) {
341 devlist->cur_port = NULL;
342 } else if (strcmp(name, "ctlportlist") == 0) {
343
344 } else {
345 struct cctl_lun_nv *nv;

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

492
493 STAILQ_FOREACH(port, &devlist.port_list, links) {
494
495 if (port->cfiscsi_target == NULL) {
496 log_debugx("CTL port %ju wasn't managed by ctld; "
497 "ignoring", (uintmax_t)port->port_id);
498 continue;
499 }
500 if (port->cfiscsi_status != 1) {
501 log_debugx("CTL port %ju is not active (%d); ignoring",
502 (uintmax_t)port->port_id, port->cfiscsi_status);
503 continue;
504 }
497
498 targ = target_find(conf, port->cfiscsi_target);
499 if (targ == NULL) {
500#if 0
501 log_debugx("found new kernel target %s for CTL port %ld",
502 port->cfiscsi_target, port->port_id);
503#endif
504 targ = target_new(conf, port->cfiscsi_target);

--- 555 unchanged lines hidden ---
505
506 targ = target_find(conf, port->cfiscsi_target);
507 if (targ == NULL) {
508#if 0
509 log_debugx("found new kernel target %s for CTL port %ld",
510 port->cfiscsi_target, port->port_id);
511#endif
512 targ = target_new(conf, port->cfiscsi_target);

--- 555 unchanged lines hidden ---