From owner-freebsd-current@FreeBSD.ORG Mon Feb 9 17:56:29 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3A4810656F8; Mon, 9 Feb 2009 17:56:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 935F68FC14; Mon, 9 Feb 2009 17:56:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 24ADC46B1A; Mon, 9 Feb 2009 12:56:29 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n19HuN2r005367; Mon, 9 Feb 2009 12:56:23 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Mon, 9 Feb 2009 11:30:07 -0500 User-Agent: KMail/1.9.7 References: <20090128193318.GA42071@freebsd.org> In-Reply-To: <20090128193318.GA42071@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902091130.08006.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 09 Feb 2009 12:56:23 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8968/Mon Feb 9 10:06:24 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Roman Divacky , scottl@freebsd.org Subject: Re: sysctl question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:56:31 -0000 On Wednesday 28 January 2009 2:33:18 pm Roman Divacky wrote: > hi > > we dont need Giant to be held for sysctl_ctx_init/SYSCTL_ADD_*, right? > > if that's true, is this ok for commit? You should be able to commit this now. > Index: cam/scsi/scsi_da.c > =================================================================== > --- cam/scsi/scsi_da.c (revision 187838) > +++ cam/scsi/scsi_da.c (working copy) > @@ -1086,7 +1086,6 @@ > snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); > snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); > > - mtx_lock(&Giant); > sysctl_ctx_init(&softc->sysctl_ctx); > softc->flags |= DA_FLAG_SCTX_INIT; > softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, > @@ -1094,7 +1093,6 @@ > CTLFLAG_RD, 0, tmpstr); > if (softc->sysctl_tree == NULL) { > printf("dasysctlinit: unable to allocate sysctl tree\n"); > - mtx_unlock(&Giant); > cam_periph_release(periph); > return; > } > @@ -1108,7 +1106,6 @@ > &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", > "Minimum CDB size"); > > - mtx_unlock(&Giant); > cam_periph_release(periph); > } > > Index: cam/scsi/scsi_cd.c > =================================================================== > --- cam/scsi/scsi_cd.c (revision 187838) > +++ cam/scsi/scsi_cd.c (working copy) > @@ -555,8 +555,6 @@ > snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number); > snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); > > - mtx_lock(&Giant); > - > sysctl_ctx_init(&softc->sysctl_ctx); > softc->flags |= CD_FLAG_SCTX_INIT; > softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, > @@ -565,7 +563,6 @@ > > if (softc->sysctl_tree == NULL) { > printf("cdsysctlinit: unable to allocate sysctl tree\n"); > - mtx_unlock(&Giant); > cam_periph_release(periph); > return; > } > @@ -579,7 +576,6 @@ > &softc->minimum_command_size, 0, cdcmdsizesysctl, "I", > "Minimum CDB size"); > > - mtx_unlock(&Giant); > cam_periph_release(periph); > } > > > thnx! > > roman > -- John Baldwin