geom_disk.c (f9b2a21c9eb4d2715be82dc9049eae29fdb40d17) | geom_disk.c (7ae1a87bfe8881d7a605f2b4a181b890d696484c) |
---|---|
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 --- 446 unchanged lines hidden (view full) --- 455 if (dp->d_getattr != NULL) { 456 buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK); 457 bp = g_alloc_bio(); 458 bp->bio_disk = dp; 459 bp->bio_attribute = "GEOM::ident"; 460 bp->bio_length = DISK_IDENT_SIZE; 461 bp->bio_data = buf; 462 res = dp->d_getattr(bp); | 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 --- 446 unchanged lines hidden (view full) --- 455 if (dp->d_getattr != NULL) { 456 buf = g_malloc(DISK_IDENT_SIZE, M_WAITOK); 457 bp = g_alloc_bio(); 458 bp->bio_disk = dp; 459 bp->bio_attribute = "GEOM::ident"; 460 bp->bio_length = DISK_IDENT_SIZE; 461 bp->bio_data = buf; 462 res = dp->d_getattr(bp); |
463 sbuf_printf(sb, "%s<ident>%s</ident>\n", indent, | 463 sbuf_printf(sb, "%s<ident>", indent); 464 g_conf_printf_escaped(sb, "%s", |
464 res == 0 ? buf: dp->d_ident); | 465 res == 0 ? buf: dp->d_ident); |
466 sbuf_printf(sb, "</ident>\n"); |
|
465 bp->bio_attribute = "GEOM::lunid"; 466 bp->bio_length = DISK_IDENT_SIZE; 467 bp->bio_data = buf; | 467 bp->bio_attribute = "GEOM::lunid"; 468 bp->bio_length = DISK_IDENT_SIZE; 469 bp->bio_data = buf; |
468 if (dp->d_getattr(bp) == 0) 469 sbuf_printf(sb, "%s<lunid>%s</lunid>\n", 470 indent, buf); | 470 if (dp->d_getattr(bp) == 0) { 471 sbuf_printf(sb, "%s<lunid>", indent); 472 g_conf_printf_escaped(sb, "%s", buf); 473 sbuf_printf(sb, "</lunid>\n"); 474 } |
471 bp->bio_attribute = "GEOM::lunname"; 472 bp->bio_length = DISK_IDENT_SIZE; 473 bp->bio_data = buf; | 475 bp->bio_attribute = "GEOM::lunname"; 476 bp->bio_length = DISK_IDENT_SIZE; 477 bp->bio_data = buf; |
474 if (dp->d_getattr(bp) == 0) 475 sbuf_printf(sb, "%s<lunname>%s</lunname>\n", 476 indent, buf); | 478 if (dp->d_getattr(bp) == 0) { 479 sbuf_printf(sb, "%s<lunname>", indent); 480 g_conf_printf_escaped(sb, "%s", buf); 481 sbuf_printf(sb, "</lunname>\n"); 482 } |
477 g_destroy_bio(bp); 478 g_free(buf); | 483 g_destroy_bio(bp); 484 g_free(buf); |
479 } else 480 sbuf_printf(sb, "%s<ident>%s</ident>\n", indent, 481 dp->d_ident); 482 sbuf_printf(sb, "%s<descr>%s</descr>\n", indent, dp->d_descr); | 485 } else { 486 sbuf_printf(sb, "%s<ident>", indent); 487 g_conf_printf_escaped(sb, "%s", dp->d_ident); 488 sbuf_printf(sb, "</ident>\n"); 489 } 490 sbuf_printf(sb, "%s<descr>", indent); 491 g_conf_printf_escaped(sb, "%s", dp->d_descr); 492 sbuf_printf(sb, "</descr>\n"); |
483 } 484} 485 486static void 487g_disk_resize(void *ptr, int flag) 488{ 489 struct disk *dp; 490 struct g_geom *gp; --- 306 unchanged lines hidden --- | 493 } 494} 495 496static void 497g_disk_resize(void *ptr, int flag) 498{ 499 struct disk *dp; 500 struct g_geom *gp; --- 306 unchanged lines hidden --- |