geom_kern.c (104359) | geom_kern.c (104452) |
---|---|
1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * | 1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * |
35 * $FreeBSD: head/sys/geom/geom_kern.c 104359 2002-10-02 07:51:02Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_kern.c 104452 2002-10-04 10:38:36Z phk $ |
36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> 42#include <sys/bio.h> 43#include <sys/sysctl.h> --- 113 unchanged lines hidden (view full) --- 157 mtx_lock(&Giant); 158 kproc_start(&g_event_kp); 159 kproc_start(&g_up_kp); 160 kproc_start(&g_down_kp); 161 mtx_unlock(&Giant); 162} 163 164static int | 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> 42#include <sys/bio.h> 43#include <sys/sysctl.h> --- 113 unchanged lines hidden (view full) --- 157 mtx_lock(&Giant); 158 kproc_start(&g_event_kp); 159 kproc_start(&g_up_kp); 160 kproc_start(&g_down_kp); 161 mtx_unlock(&Giant); 162} 163 164static int |
165sysctl_kern_geom_dotconf(SYSCTL_HANDLER_ARGS) | 165sysctl_kern_geom_confdot(SYSCTL_HANDLER_ARGS) |
166{ | 166{ |
167 int i, error; | 167 int error; |
168 struct sbuf *sb; 169 | 168 struct sbuf *sb; 169 |
170 i = 0; 171 sb = g_confdot(); 172 error = sysctl_handle_opaque(oidp, sbuf_data(sb), sbuf_len(sb), req); | 170 sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); 171 sbuf_clear(sb); 172 g_call_me(g_confdot, sb); 173 do { 174 tsleep(sb, PZERO, "g_dot", hz); 175 } while(!sbuf_done(sb)); 176 error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb)); |
173 sbuf_delete(sb); | 177 sbuf_delete(sb); |
174 return (error); | 178 return error; |
175} | 179} |
176 | 180 |
177static int | 181static int |
178sysctl_kern_geom_xmlconf(SYSCTL_HANDLER_ARGS) | 182sysctl_kern_geom_confxml(SYSCTL_HANDLER_ARGS) |
179{ | 183{ |
180 int i, error; | 184 int error; |
181 struct sbuf *sb; 182 | 185 struct sbuf *sb; 186 |
183 i = 0; 184 sb = g_conf(); 185 error = sysctl_handle_opaque(oidp, sbuf_data(sb), sbuf_len(sb), req); | 187 sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); 188 sbuf_clear(sb); 189 g_call_me(g_confxml, sb); 190 do { 191 tsleep(sb, PZERO, "g_xml", hz); 192 } while(!sbuf_done(sb)); 193 error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb)); |
186 sbuf_delete(sb); | 194 sbuf_delete(sb); |
187 return (error); | 195 return error; |
188} 189 190SYSCTL_NODE(_kern, OID_AUTO, geom, CTLFLAG_RW, 0, "GEOMetry management"); 191 | 196} 197 198SYSCTL_NODE(_kern, OID_AUTO, geom, CTLFLAG_RW, 0, "GEOMetry management"); 199 |
192SYSCTL_PROC(_kern_geom, OID_AUTO, xmlconf, CTLTYPE_STRING|CTLFLAG_RD, 193 0, 0, sysctl_kern_geom_xmlconf, "A", | 200SYSCTL_PROC(_kern_geom, OID_AUTO, confxml, CTLTYPE_STRING|CTLFLAG_RD, 201 0, 0, sysctl_kern_geom_confxml, "A", |
194 "Dump the GEOM config"); 195 | 202 "Dump the GEOM config"); 203 |
196SYSCTL_PROC(_kern_geom, OID_AUTO, dotconf, CTLTYPE_STRING|CTLFLAG_RD, 197 0, 0, sysctl_kern_geom_dotconf, "A", | 204SYSCTL_PROC(_kern_geom, OID_AUTO, confdot, CTLTYPE_STRING|CTLFLAG_RD, 205 0, 0, sysctl_kern_geom_confdot, "A", |
198 "Dump the GEOM config"); 199 200SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLTYPE_INT|CTLFLAG_RW, 201 &g_debugflags, 0, ""); 202 203SYSCTL_INT(_debug_sizeof, OID_AUTO, g_class, CTLTYPE_INT|CTLFLAG_RD, 204 0, sizeof(struct g_class), ""); 205SYSCTL_INT(_debug_sizeof, OID_AUTO, g_geom, CTLTYPE_INT|CTLFLAG_RD, 206 0, sizeof(struct g_geom), ""); 207SYSCTL_INT(_debug_sizeof, OID_AUTO, g_provider, CTLTYPE_INT|CTLFLAG_RD, 208 0, sizeof(struct g_provider), ""); 209SYSCTL_INT(_debug_sizeof, OID_AUTO, g_consumer, CTLTYPE_INT|CTLFLAG_RD, 210 0, sizeof(struct g_consumer), ""); 211SYSCTL_INT(_debug_sizeof, OID_AUTO, g_bioq, CTLTYPE_INT|CTLFLAG_RD, 212 0, sizeof(struct g_bioq), ""); 213SYSCTL_INT(_debug_sizeof, OID_AUTO, g_event, CTLTYPE_INT|CTLFLAG_RD, 214 0, sizeof(struct g_event), ""); | 206 "Dump the GEOM config"); 207 208SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLTYPE_INT|CTLFLAG_RW, 209 &g_debugflags, 0, ""); 210 211SYSCTL_INT(_debug_sizeof, OID_AUTO, g_class, CTLTYPE_INT|CTLFLAG_RD, 212 0, sizeof(struct g_class), ""); 213SYSCTL_INT(_debug_sizeof, OID_AUTO, g_geom, CTLTYPE_INT|CTLFLAG_RD, 214 0, sizeof(struct g_geom), ""); 215SYSCTL_INT(_debug_sizeof, OID_AUTO, g_provider, CTLTYPE_INT|CTLFLAG_RD, 216 0, sizeof(struct g_provider), ""); 217SYSCTL_INT(_debug_sizeof, OID_AUTO, g_consumer, CTLTYPE_INT|CTLFLAG_RD, 218 0, sizeof(struct g_consumer), ""); 219SYSCTL_INT(_debug_sizeof, OID_AUTO, g_bioq, CTLTYPE_INT|CTLFLAG_RD, 220 0, sizeof(struct g_bioq), ""); 221SYSCTL_INT(_debug_sizeof, OID_AUTO, g_event, CTLTYPE_INT|CTLFLAG_RD, 222 0, sizeof(struct g_event), ""); |