geom_dump.c (104195) | geom_dump.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_dump.c 104195 2002-09-30 08:54:46Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_dump.c 104452 2002-10-04 10:38:36Z phk $ |
36 */ 37 38 39#include <sys/param.h> 40#include <sys/sbuf.h> 41#ifndef _KERNEL 42#include <stdio.h> 43#include <unistd.h> --- 50 unchanged lines hidden (view full) --- 94g_confdot_class(struct sbuf *sb, struct g_class *mp) 95{ 96 struct g_geom *gp; 97 98 LIST_FOREACH(gp, &mp->geom, geom) 99 g_confdot_geom(sb, gp); 100} 101 | 36 */ 37 38 39#include <sys/param.h> 40#include <sys/sbuf.h> 41#ifndef _KERNEL 42#include <stdio.h> 43#include <unistd.h> --- 50 unchanged lines hidden (view full) --- 94g_confdot_class(struct sbuf *sb, struct g_class *mp) 95{ 96 struct g_geom *gp; 97 98 LIST_FOREACH(gp, &mp->geom, geom) 99 g_confdot_geom(sb, gp); 100} 101 |
102struct sbuf * 103g_confdot(void) | 102void 103g_confdot(void *p) |
104{ 105 struct g_class *mp; 106 struct sbuf *sb; 107 | 104{ 105 struct g_class *mp; 106 struct sbuf *sb; 107 |
108 sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); 109 sbuf_clear(sb); | 108 sb = p; 109 g_topology_assert(); |
110 sbuf_printf(sb, "digraph geom {\n"); 111 LIST_FOREACH(mp, &g_classes, class) 112 g_confdot_class(sb, mp); 113 sbuf_printf(sb, "};\n"); 114 sbuf_finish(sb); | 110 sbuf_printf(sb, "digraph geom {\n"); 111 LIST_FOREACH(mp, &g_classes, class) 112 g_confdot_class(sb, mp); 113 sbuf_printf(sb, "};\n"); 114 sbuf_finish(sb); |
115 return (sb); | 115 wakeup(p); |
116} 117 118 119static void 120g_conf_consumer(struct sbuf *sb, struct g_consumer *cp) 121{ 122 123 sbuf_printf(sb, "\t<consumer id=\"%p\">\n", cp); --- 67 unchanged lines hidden (view full) --- 191 LIST_FOREACH(gp2, &mp->geom, geom) { 192 if (gp != NULL && gp != gp2) 193 continue; 194 g_conf_geom(sb, gp2, pp, cp); 195 } 196 sbuf_printf(sb, " </class>\n"); 197} 198 | 116} 117 118 119static void 120g_conf_consumer(struct sbuf *sb, struct g_consumer *cp) 121{ 122 123 sbuf_printf(sb, "\t<consumer id=\"%p\">\n", cp); --- 67 unchanged lines hidden (view full) --- 191 LIST_FOREACH(gp2, &mp->geom, geom) { 192 if (gp != NULL && gp != gp2) 193 continue; 194 g_conf_geom(sb, gp2, pp, cp); 195 } 196 sbuf_printf(sb, " </class>\n"); 197} 198 |
199struct sbuf * 200g_conf_specific(struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp) | 199void 200g_conf_specific(struct sbuf *sb, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp) |
201{ 202 struct g_class *mp2; | 201{ 202 struct g_class *mp2; |
203 struct sbuf *sb; | |
204 | 203 |
205 sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); 206 sbuf_clear(sb); | 204 g_topology_assert(); |
207 sbuf_printf(sb, "<mesh>\n"); 208#ifndef _KERNEL 209 sbuf_printf(sb, " <FreeBSD>%cFreeBSD%c</FreeBSD>\n", '$', '$'); 210#endif 211 LIST_FOREACH(mp2, &g_classes, class) { 212 if (mp != NULL && mp != mp2) 213 continue; 214 g_conf_class(sb, mp2, gp, pp, cp); 215 } 216 sbuf_printf(sb, "</mesh>\n"); 217 sbuf_finish(sb); | 205 sbuf_printf(sb, "<mesh>\n"); 206#ifndef _KERNEL 207 sbuf_printf(sb, " <FreeBSD>%cFreeBSD%c</FreeBSD>\n", '$', '$'); 208#endif 209 LIST_FOREACH(mp2, &g_classes, class) { 210 if (mp != NULL && mp != mp2) 211 continue; 212 g_conf_class(sb, mp2, gp, pp, cp); 213 } 214 sbuf_printf(sb, "</mesh>\n"); 215 sbuf_finish(sb); |
218 return (sb); | |
219} 220 | 216} 217 |
221struct sbuf * 222g_conf() | 218void 219g_confxml(void *p) |
223{ 224 | 220{ 221 |
225 return (g_conf_specific(NULL, NULL, NULL, NULL)); | 222 g_conf_specific(p, NULL, NULL, NULL, NULL); 223 wakeup(p); |
226} 227 228 229void 230g_trace(int level, char *fmt, ...) 231{ 232 va_list ap; 233 --- 38 unchanged lines hidden --- | 224} 225 226 227void 228g_trace(int level, char *fmt, ...) 229{ 230 va_list ap; 231 --- 38 unchanged lines hidden --- |