From owner-svn-src-all@FreeBSD.ORG Sat Jun 20 07:33:07 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFE6A552; Sat, 20 Jun 2015 07:33:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E307A2; Sat, 20 Jun 2015 07:33:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5K7X7kA069026; Sat, 20 Jun 2015 07:33:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5K7X7Mh069023; Sat, 20 Jun 2015 07:33:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201506200733.t5K7X7Mh069023@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 20 Jun 2015 07:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284627 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 07:33:07 -0000 Author: mav Date: Sat Jun 20 07:33:06 2015 New Revision: 284627 URL: https://svnweb.freebsd.org/changeset/base/284627 Log: Remove some dead and duplicate LUN enabling code. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Jun 20 05:40:35 2015 (r284626) +++ head/sys/cam/ctl/ctl.c Sat Jun 20 07:33:06 2015 (r284627) @@ -4535,7 +4535,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft struct ctl_be_lun *const be_lun, struct ctl_id target_id) { struct ctl_lun *nlun, *lun; - struct ctl_port *port; struct scsi_vpd_id_descriptor *desc; struct scsi_vpd_id_t10 *t10id; const char *eui, *naa, *scsiname, *vendor, *value; @@ -4765,24 +4764,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft mtx_unlock(&ctl_softc->ctl_lock); lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK); - - /* - * Run through each registered FETD and bring it online if it isn't - * already. Enable the target ID if it hasn't been enabled, and - * enable this particular LUN. - */ - STAILQ_FOREACH(port, &ctl_softc->port_list, links) { - int retval; - - retval = port->lun_enable(port->targ_lun_arg, target_id,lun_number); - if (retval != 0) { - printf("ctl_alloc_lun: FETD %s port %d returned error " - "%d for lun_enable on target %ju lun %d\n", - port->port_name, port->targ_port, retval, - (uintmax_t)target_id.id, lun_number); - } else - port->status |= CTL_PORT_STATUS_LUN_ONLINE; - } return (0); } @@ -4819,58 +4800,6 @@ ctl_free_lun(struct ctl_lun *lun) softc->num_luns--; /* - * XXX KDM this scheme only works for a single target/multiple LUN - * setup. It needs to be revamped for a multiple target scheme. - * - * XXX KDM this results in port->lun_disable() getting called twice, - * once when ctl_disable_lun() is called, and a second time here. - * We really need to re-think the LUN disable semantics. There - * should probably be several steps/levels to LUN removal: - * - disable - * - invalidate - * - free - * - * Right now we only have a disable method when communicating to - * the front end ports, at least for individual LUNs. - */ -#if 0 - STAILQ_FOREACH(port, &softc->port_list, links) { - int retval; - - retval = port->lun_disable(port->targ_lun_arg, lun->target, - lun->lun); - if (retval != 0) { - printf("ctl_free_lun: FETD %s port %d returned error " - "%d for lun_disable on target %ju lun %jd\n", - port->port_name, port->targ_port, retval, - (uintmax_t)lun->target.id, (intmax_t)lun->lun); - } - - if (STAILQ_FIRST(&softc->lun_list) == NULL) { - port->status &= ~CTL_PORT_STATUS_LUN_ONLINE; - - retval = port->targ_disable(port->targ_lun_arg,lun->target); - if (retval != 0) { - printf("ctl_free_lun: FETD %s port %d " - "returned error %d for targ_disable on " - "target %ju\n", port->port_name, - port->targ_port, retval, - (uintmax_t)lun->target.id); - } else - port->status &= ~CTL_PORT_STATUS_TARG_ONLINE; - - if ((port->status & CTL_PORT_STATUS_TARG_ONLINE) != 0) - continue; - -#if 0 - port->port_offline(port->onoff_arg); - port->status &= ~CTL_PORT_STATUS_ONLINE; -#endif - } - } -#endif - - /* * Tell the backend to free resources, if this LUN has a backend. */ atomic_subtract_int(&lun->be_lun->be->num_luns, 1); @@ -4964,12 +4893,6 @@ ctl_enable_lun(struct ctl_be_lun *be_lun __func__, port->port_name, port->targ_port, retval, (uintmax_t)lun->target.id, (intmax_t)lun->lun); } -#if 0 - else { - /* NOTE: TODO: why does lun enable affect port status? */ - port->status |= CTL_PORT_STATUS_LUN_ONLINE; - } -#endif } mtx_unlock(&softc->ctl_lock); Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Sat Jun 20 05:40:35 2015 (r284626) +++ head/sys/cam/ctl/ctl_frontend.h Sat Jun 20 07:33:06 2015 (r284627) @@ -41,9 +41,7 @@ typedef enum { CTL_PORT_STATUS_NONE = 0x00, - CTL_PORT_STATUS_ONLINE = 0x01, - CTL_PORT_STATUS_TARG_ONLINE = 0x02, - CTL_PORT_STATUS_LUN_ONLINE = 0x04 + CTL_PORT_STATUS_ONLINE = 0x01 } ctl_port_status; typedef int (*fe_init_t)(void);