From owner-svn-src-stable-10@FreeBSD.ORG Thu Dec 18 08:28:46 2014 Return-Path: Delivered-To: svn-src-stable-10@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 44F0244B; Thu, 18 Dec 2014 08:28:46 +0000 (UTC) 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 3061917D3; Thu, 18 Dec 2014 08:28:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBI8SkV5020622; Thu, 18 Dec 2014 08:28:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBI8SjqG020618; Thu, 18 Dec 2014 08:28:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412180828.sBI8SjqG020618@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Dec 2014 08:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275885 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2014 08:28:46 -0000 Author: mav Date: Thu Dec 18 08:28:44 2014 New Revision: 275885 URL: https://svnweb.freebsd.org/changeset/base/275885 Log: MFC r275405: Convert persis_offset from global variable to softc field. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:27:46 2014 (r275884) +++ stable/10/sys/cam/ctl/ctl.c Thu Dec 18 08:28:44 2014 (r275885) @@ -356,7 +356,6 @@ static struct ctl_logical_block_provisio * XXX KDM move these into the softc. */ static int rcv_sync_msg; -static int persis_offset; static uint8_t ctl_pause_rtr; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); @@ -1076,7 +1075,7 @@ ctl_init(void) softc->port_offset = 0; } else softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; - persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; + softc->persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -7878,10 +7877,10 @@ retry: static void ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { + int off = lun->ctl_softc->persis_offset; - if (residx >= persis_offset && - residx < persis_offset + CTL_MAX_INITIATORS) - lun->pending_ua[residx - persis_offset] |= ua; + if (residx >= off && residx < off + CTL_MAX_INITIATORS) + lun->pending_ua[residx - off] |= ua; } /* @@ -8420,8 +8419,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[ - i + persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8568,7 +8567,7 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + persis_offset] == 0) + lun->pr_keys[i + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8685,8 +8684,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i+ - persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= @@ -8719,7 +8718,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i+persis_offset] != 0) + if (lun->pr_keys[i + softc->persis_offset] != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:27:46 2014 (r275884) +++ stable/10/sys/cam/ctl/ctl_private.h Thu Dec 18 08:28:44 2014 (r275885) @@ -450,6 +450,7 @@ struct ctl_softc { int ha_state; int is_single; int port_offset; + int persis_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree;