From owner-p4-projects@FreeBSD.ORG Thu May 18 03:18:48 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D88F616A404; Thu, 18 May 2006 03:18:47 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E99416A402 for ; Thu, 18 May 2006 03:18:47 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4385A43D45 for ; Thu, 18 May 2006 03:18:47 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4I3IOqr002560 for ; Thu, 18 May 2006 03:18:24 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4I3IO32002557 for perforce@freebsd.org; Thu, 18 May 2006 03:18:24 GMT (envelope-from scottl@freebsd.org) Date: Thu, 18 May 2006 03:18:24 GMT Message-Id: <200605180318.k4I3IO32002557@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 97386 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2006 03:18:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=97386 Change 97386 by scottl@scottl-x64 on 2006/05/18 03:17:55 Move the bus list and generation count into the xsoftc. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#30 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#30 (text+ko) ==== @@ -244,6 +244,9 @@ int num_highpower; STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq; + /* Registered busses */ + TAILQ_HEAD(,cam_eb) xpt_busses; + u_int bus_generation; }; static const char quantum[] = "QUANTUM"; @@ -687,9 +690,6 @@ #define SIM_DEAD(sim) ((sim) == &cam_dead_sim) -/* Registered busses */ -static TAILQ_HEAD(,cam_eb) xpt_busses; -static u_int bus_generation; /* Storage for debugging datastructures */ #ifdef CAMDEBUG @@ -1368,7 +1368,7 @@ struct cam_devq *devq; cam_status status; - TAILQ_INIT(&xpt_busses); + TAILQ_INIT(&xsoftc.xpt_busses); TAILQ_INIT(&cam_bioq); STAILQ_INIT(&xsoftc.highpowerq); xsoftc.num_highpower = CAM_MAX_HIGHPOWER; @@ -2150,7 +2150,7 @@ cdm->pos.cookie.bus = bus; cdm->pos.generations[CAM_BUS_GENERATION]= - bus_generation; + xsoftc.bus_generation; cdm->status = CAM_DEV_MATCH_MORE; return(0); } @@ -2282,7 +2282,7 @@ cdm->pos.cookie.bus = device->target->bus; cdm->pos.generations[CAM_BUS_GENERATION]= - bus_generation; + xsoftc.bus_generation; cdm->pos.cookie.target = device->target; cdm->pos.generations[CAM_TARGET_GENERATION] = device->target->bus->generation; @@ -2392,7 +2392,7 @@ cdm->pos.cookie.bus = periph->path->bus; cdm->pos.generations[CAM_BUS_GENERATION]= - bus_generation; + xsoftc.bus_generation; cdm->pos.cookie.target = periph->path->target; cdm->pos.generations[CAM_TARGET_GENERATION] = periph->path->bus->generation; @@ -2437,7 +2437,7 @@ */ if ((cdm->pos.position_type & CAM_DEV_POS_BUS) && (cdm->pos.generations[CAM_BUS_GENERATION] != 0) - && (cdm->pos.generations[CAM_BUS_GENERATION] != bus_generation)) { + && (cdm->pos.generations[CAM_BUS_GENERATION] != xsoftc.bus_generation)) { cdm->status = CAM_DEV_MATCH_LIST_CHANGED; return(0); } @@ -2636,7 +2636,7 @@ retval = 1; - for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xpt_busses)); + for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses)); bus != NULL; bus = next_bus) { next_bus = TAILQ_NEXT(bus, links); @@ -4393,15 +4393,15 @@ new_bus->refcount = 1; /* Held until a bus_deregister event */ new_bus->generation = 0; s = splcam(); - old_bus = TAILQ_FIRST(&xpt_busses); + old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); while (old_bus != NULL && old_bus->path_id < new_bus->path_id) old_bus = TAILQ_NEXT(old_bus, links); if (old_bus != NULL) TAILQ_INSERT_BEFORE(old_bus, new_bus, links); else - TAILQ_INSERT_TAIL(&xpt_busses, new_bus, links); - bus_generation++; + TAILQ_INSERT_TAIL(&xsoftc.xpt_busses, new_bus, links); + xsoftc.bus_generation++; splx(s); /* Notify interested parties */ @@ -4496,7 +4496,7 @@ const char *strval; pathid = 0; - bus = TAILQ_FIRST(&xpt_busses); + bus = TAILQ_FIRST(&xsoftc.xpt_busses); retry: /* Find an unoccupied pathid */ while (bus != NULL @@ -4998,8 +4998,8 @@ s = splcam(); if ((--bus->refcount == 0) && (TAILQ_FIRST(&bus->et_entries) == NULL)) { - TAILQ_REMOVE(&xpt_busses, bus, links); - bus_generation++; + TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); + xsoftc.bus_generation++; splx(s); free(bus, M_CAMXPT); } else @@ -5229,7 +5229,7 @@ { struct cam_eb *bus; - for (bus = TAILQ_FIRST(&xpt_busses); + for (bus = TAILQ_FIRST(&xsoftc.xpt_busses); bus != NULL; bus = TAILQ_NEXT(bus, links)) { if (bus->path_id == path_id) {