geom_disk.c (257131) | geom_disk.c (258683) |
---|---|
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 --- 20 unchanged lines hidden (view full) --- 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 36#include <sys/cdefs.h> | 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 --- 20 unchanged lines hidden (view full) --- 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 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/geom/geom_disk.c 257131 2013-10-25 19:19:12Z jhb $"); | 37__FBSDID("$FreeBSD: head/sys/geom/geom_disk.c 258683 2013-11-27 14:25:06Z mav $"); |
38 39#include "opt_geom.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/sysctl.h> 45#include <sys/bio.h> --- 409 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); | 38 39#include "opt_geom.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/kernel.h> 44#include <sys/sysctl.h> 45#include <sys/bio.h> --- 409 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 --- |