From owner-p4-projects@FreeBSD.ORG Thu Mar 29 23:09:48 2007 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 CDCE216A405; Thu, 29 Mar 2007 23:09:47 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 941BC16A400 for ; Thu, 29 Mar 2007 23:09:47 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 84EE513C4BF for ; Thu, 29 Mar 2007 23:09:47 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l2TN9lT6065636 for ; Thu, 29 Mar 2007 23:09:47 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l2TN9lnx065633 for perforce@freebsd.org; Thu, 29 Mar 2007 23:09:47 GMT (envelope-from scottl@freebsd.org) Date: Thu, 29 Mar 2007 23:09:47 GMT Message-Id: <200703292309.l2TN9lnx065633@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 116891 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, 29 Mar 2007 23:09:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=116891 Change 116891 by scottl@scottl-x64 on 2007/03/29 23:09:05 Elimiate the xptpriv field from the ccb_hdr. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_ccb.h#13 edit .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#52 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_ccb.h#13 (text+ko) ==== @@ -272,7 +272,6 @@ u_int32_t flags; /* ccb_flags */ ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; - void *xptpriv; /* Holds a task object if needed */ u_int32_t timeout; /* Timeout value */ /* ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#52 (text+ko) ==== @@ -71,6 +71,12 @@ /* Datastructures internal to the xpt layer */ MALLOC_DEFINE(M_CAMXPT, "CAM XPT", "CAM XPT buffers"); +/* Object for defering XPT actions to a taskqueue */ +struct xpt_task { + struct task task; + void *data; +}; + /* * Definition of an async handler callback block. These are used to add * SIMs and peripherals to the async callback lists. @@ -2992,13 +2998,15 @@ xpt_action_sasync_cb(void *context, int pending) { union ccb *start_ccb; + struct xpt_task *task; struct ccb_setasync *csa; struct async_node *cur_entry; struct async_list *async_head; u_int32_t added; int s; - start_ccb = (union ccb *)context; + task = (struct xpt_task *)context; + start_ccb = (union ccb *)task->data; csa = &start_ccb->csa; added = csa->event_enable; async_head = &csa->ccb_h.path->device->asyncs; @@ -3063,9 +3071,9 @@ splx(s); out: - free(start_ccb->ccb_h.xptpriv, M_CAMXPT); xpt_free_path(start_ccb->ccb_h.path); xpt_free_ccb(start_ccb); + free(task, M_CAMXPT); } void @@ -3471,7 +3479,7 @@ case XPT_SASYNC_CB: { union ccb *task_ccb; - struct task *task; + struct xpt_task *task; /* * Need to decouple this operation via a taqskqueue so that @@ -3494,7 +3502,7 @@ break; } - task = malloc(sizeof(struct task), M_CAMXPT, M_NOWAIT); + task = malloc(sizeof(struct xpt_task), M_CAMXPT, M_NOWAIT); if (task == NULL) { start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_free_path(task_ccb->ccb_h.path); @@ -3502,9 +3510,9 @@ break; } - TASK_INIT(task, 0, xpt_action_sasync_cb, task_ccb); - task_ccb->ccb_h.xptpriv = task; - taskqueue_enqueue(taskqueue_thread, task); + TASK_INIT(&task->task, 0, xpt_action_sasync_cb, task); + task->data = task_ccb; + taskqueue_enqueue(taskqueue_thread, &task->task); start_ccb->ccb_h.status = CAM_REQ_CMP; break; @@ -7159,7 +7167,7 @@ static void xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb) { - struct task *task; + struct task *xpt_task; if (done_ccb != NULL) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, @@ -7182,10 +7190,10 @@ } } - task = malloc(sizeof(struct task), M_CAMXPT, M_NOWAIT); + task = malloc(sizeof(struct xpt_task), M_CAMXPT, M_NOWAIT); if (task != NULL) { - TASK_INIT(task, 0, xpt_finishconfig_task, task); - taskqueue_enqueue(taskqueue_thread, task); + TASK_INIT(&task->task, 0, xpt_finishconfig_task, task); + taskqueue_enqueue(taskqueue_thread, &task->task); } if (done_ccb != NULL)