Deleted Added
full compact
ctl_frontend_iscsi.c (275445) ctl_frontend_iscsi.c (275493)
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 275445 2014-12-03 08:22:13Z trasz $
29 * $FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 275493 2014-12-05 07:23:25Z 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 275445 2014-12-03 08:22:13Z trasz $");
37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 275493 2014-12-05 07:23:25Z 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>

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

2049 port->target_devid->len = len;
2050 desc = (struct scsi_vpd_id_descriptor *)port->target_devid->data;
2051 desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
2052 desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET |
2053 SVPD_ID_TYPE_SCSI_NAME;
2054 desc->length = idlen;
2055 strlcpy(desc->identifier, target, idlen);
2056
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>

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

2049 port->target_devid->len = len;
2050 desc = (struct scsi_vpd_id_descriptor *)port->target_devid->data;
2051 desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
2052 desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET |
2053 SVPD_ID_TYPE_SCSI_NAME;
2054 desc->length = idlen;
2055 strlcpy(desc->identifier, target, idlen);
2056
2057 retval = ctl_port_register(port, /*master_SC*/ 1);
2057 retval = ctl_port_register(port);
2058 if (retval != 0) {
2059 ctl_free_opts(&port->options);
2060 cfiscsi_target_release(ct);
2061 free(port->port_devid, M_CFISCSI);
2062 free(port->target_devid, M_CFISCSI);
2063 req->status = CTL_LUN_ERROR;
2064 snprintf(req->error_str, sizeof(req->error_str),
2065 "ctl_frontend_register() failed with error %d", retval);

--- 874 unchanged lines hidden ---
2058 if (retval != 0) {
2059 ctl_free_opts(&port->options);
2060 cfiscsi_target_release(ct);
2061 free(port->port_devid, M_CFISCSI);
2062 free(port->target_devid, M_CFISCSI);
2063 req->status = CTL_LUN_ERROR;
2064 snprintf(req->error_str, sizeof(req->error_str),
2065 "ctl_frontend_register() failed with error %d", retval);

--- 874 unchanged lines hidden ---