From owner-svn-src-all@FreeBSD.ORG Sun Sep 6 19:06:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E085F106566C; Sun, 6 Sep 2009 19:06:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFBF48FC08; Sun, 6 Sep 2009 19:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n86J6ot2092076; Sun, 6 Sep 2009 19:06:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n86J6oKC092073; Sun, 6 Sep 2009 19:06:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909061906.n86J6oKC092073@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Sep 2009 19:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196903 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 06 Sep 2009 19:06:51 -0000 Author: mav Date: Sun Sep 6 19:06:50 2009 New Revision: 196903 URL: http://svn.freebsd.org/changeset/base/196903 Log: MFp4: Remove duplicate qfrozen_cnt variable from struct cam_ed. ccbq.queue.qfrozen_cnt should be used instead. Modified: head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Sep 6 19:05:03 2009 (r196902) +++ head/sys/cam/cam_xpt.c Sun Sep 6 19:06:50 2009 (r196903) @@ -2472,7 +2472,7 @@ xpt_action_default(union ccb *start_ccb) path = start_ccb->ccb_h.path; cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); - if (path->device->qfrozen_cnt == 0) + if (path->device->ccbq.queue.qfrozen_cnt == 0) runq = xpt_schedule_dev_sendq(path->bus, path->device); else runq = 0; @@ -2931,7 +2931,7 @@ xpt_action_default(union ccb *start_ccb) xpt_release_devq(crs->ccb_h.path, /*count*/1, /*run_queue*/TRUE); } - start_ccb->crs.qfrozen_cnt = dev->qfrozen_cnt; + start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt; start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -3227,7 +3227,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) * If the device has been "frozen", don't attempt * to run it. */ - if (device->qfrozen_cnt > 0) { + if (device->ccbq.queue.qfrozen_cnt > 0) { continue; } @@ -3250,7 +3250,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) * the device queue until we have a slot * available. */ - device->qfrozen_cnt++; + device->ccbq.queue.qfrozen_cnt++; STAILQ_INSERT_TAIL(&xsoftc.highpowerq, &work_ccb->ccb_h, xpt_links.stqe); @@ -3282,7 +3282,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) * The client wants to freeze the queue * after this CCB is sent. */ - device->qfrozen_cnt++; + device->ccbq.queue.qfrozen_cnt++; } /* In Target mode, the peripheral driver knows best... */ @@ -4031,7 +4031,7 @@ xpt_freeze_devq(struct cam_path *path, u mtx_assert(path->bus->sim->mtx, MA_OWNED); - path->device->qfrozen_cnt += count; + path->device->ccbq.queue.qfrozen_cnt += count; /* * Mark the last CCB in the queue as needing @@ -4049,7 +4049,7 @@ xpt_freeze_devq(struct cam_path *path, u ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_tailq); if (ccbh && ccbh->status == CAM_REQ_INPROG) ccbh->status = CAM_REQUEUE_REQ; - return (path->device->qfrozen_cnt); + return (path->device->ccbq.queue.qfrozen_cnt); } u_int32_t @@ -4093,11 +4093,12 @@ xpt_release_devq_device(struct cam_ed *d int rundevq; rundevq = 0; - if (dev->qfrozen_cnt > 0) { + if (dev->ccbq.queue.qfrozen_cnt > 0) { - count = (count > dev->qfrozen_cnt) ? dev->qfrozen_cnt : count; - dev->qfrozen_cnt -= count; - if (dev->qfrozen_cnt == 0) { + count = (count > dev->ccbq.queue.qfrozen_cnt) ? + dev->ccbq.queue.qfrozen_cnt : count; + dev->ccbq.queue.qfrozen_cnt -= count; + if (dev->ccbq.queue.qfrozen_cnt == 0) { /* * No longer need to wait for a successful @@ -4402,7 +4403,6 @@ xpt_alloc_device(struct cam_eb *bus, str SLIST_INIT(&device->periphs); device->generation = 0; device->owner = NULL; - device->qfrozen_cnt = 0; device->flags = CAM_DEV_UNCONFIGURED; device->tag_delay_count = 0; device->tag_saved_openings = 0; @@ -4971,7 +4971,7 @@ camisr_runqueue(void *V_queue) xpt_start_tags(ccb_h->path); if ((dev->ccbq.queue.entries > 0) - && (dev->qfrozen_cnt == 0) + && (dev->ccbq.queue.qfrozen_cnt == 0) && (device_is_send_queued(dev) == 0)) { runq = xpt_schedule_dev_sendq(ccb_h->path->bus, dev); Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Sun Sep 6 19:05:03 2009 (r196902) +++ head/sys/cam/cam_xpt_internal.h Sun Sep 6 19:06:50 2009 (r196903) @@ -106,7 +106,6 @@ struct cam_ed { u_int8_t queue_flags; /* Queue flags from the control page */ u_int8_t serial_num_len; u_int8_t *serial_num; - u_int32_t qfrozen_cnt; u_int32_t flags; #define CAM_DEV_UNCONFIGURED 0x01 #define CAM_DEV_REL_TIMEOUT_PENDING 0x02