Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2009 12:56:38 -0700 (MST)
From:      Scott Long <scottl@samsco.org>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        scottl@freebsd.org, current@freebsd.org
Subject:   Re: sysctl question
Message-ID:  <20090128125607.W16294@pooker.samsco.org>
In-Reply-To: <20090128193318.GA42071@freebsd.org>
References:  <20090128193318.GA42071@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
If Giant isn't needed here, then great!

Scott


On Wed, 28 Jan 2009, 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?
>
> 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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090128125607.W16294>