geom_ctl.c (63728c47e848c8068ddab1526fad9c5384696354) | geom_ctl.c (afa2a5aab75ae5fdef6ab23dcd205c12d21c3a27) |
---|---|
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 --- 384 unchanged lines hidden (view full) --- 393{ 394 struct g_class *mp; 395 struct g_provider *pp; 396 397 g_topology_assert(); 398 mp = gctl_get_class(req); 399 if (mp == NULL) 400 return; | 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 --- 384 unchanged lines hidden (view full) --- 393{ 394 struct g_class *mp; 395 struct g_provider *pp; 396 397 g_topology_assert(); 398 mp = gctl_get_class(req); 399 if (mp == NULL) 400 return; |
401 printf("Found class: %p\n", mp); | |
402 if (mp->create_geom == NULL) { 403 gctl_error(req, "Class has no create_geom method"); 404 return; 405 } 406 pp = gctl_get_provider(req); | 401 if (mp->create_geom == NULL) { 402 gctl_error(req, "Class has no create_geom method"); 403 return; 404 } 405 pp = gctl_get_provider(req); |
407 printf("Found provider: %p\n", pp); | |
408 mp->create_geom(req, mp, pp); 409 g_topology_assert(); 410} 411 412static void 413gctl_destroy_geom(struct gctl_req *req) 414{ 415 struct g_class *mp; 416 struct g_geom *gp; 417 418 g_topology_assert(); 419 mp = gctl_get_class(req); 420 if (mp == NULL) 421 return; | 406 mp->create_geom(req, mp, pp); 407 g_topology_assert(); 408} 409 410static void 411gctl_destroy_geom(struct gctl_req *req) 412{ 413 struct g_class *mp; 414 struct g_geom *gp; 415 416 g_topology_assert(); 417 mp = gctl_get_class(req); 418 if (mp == NULL) 419 return; |
422 printf("Found class: %p\n", mp); | |
423 if (mp->destroy_geom == NULL) { 424 gctl_error(req, "Class has no destroy_geom method"); 425 return; 426 } 427 gp = gctl_get_geom(req, mp); 428 if (gp == NULL) { 429 gctl_error(req, "Geom not specified"); 430 return; 431 } 432 if (gp->class != mp) { 433 gctl_error(req, "Geom not of specificed class"); 434 return; 435 } | 420 if (mp->destroy_geom == NULL) { 421 gctl_error(req, "Class has no destroy_geom method"); 422 return; 423 } 424 gp = gctl_get_geom(req, mp); 425 if (gp == NULL) { 426 gctl_error(req, "Geom not specified"); 427 return; 428 } 429 if (gp->class != mp) { 430 gctl_error(req, "Geom not of specificed class"); 431 return; 432 } |
436 printf("Found geom: %p\n", gp); | |
437 mp->destroy_geom(req, mp, gp); 438 g_topology_assert(); 439} 440 441/* 442 * Handle ioctl from libgeom::geom_ctl.c 443 */ 444static int --- 23 unchanged lines hidden (view full) --- 468 return (gctl_error(req, "invalid request")); 469 req->reqt = &gcrt[i]; 470 471 /* Get things on board */ 472 error = gctl_copyin(req); 473 if (error) 474 return (error); 475 | 433 mp->destroy_geom(req, mp, gp); 434 g_topology_assert(); 435} 436 437/* 438 * Handle ioctl from libgeom::geom_ctl.c 439 */ 440static int --- 23 unchanged lines hidden (view full) --- 464 return (gctl_error(req, "invalid request")); 465 req->reqt = &gcrt[i]; 466 467 /* Get things on board */ 468 error = gctl_copyin(req); 469 if (error) 470 return (error); 471 |
476 gctl_dump(req); | 472 if (g_debugflags & G_F_CTLDUMP) 473 gctl_dump(req); |
477#if 0 478 g_stall_events(); 479#endif 480 g_topology_lock(); 481 switch (req->request) { 482 case GCTL_CREATE_GEOM: 483 gctl_create_geom(req); 484 break; --- 39 unchanged lines hidden --- | 474#if 0 475 g_stall_events(); 476#endif 477 g_topology_lock(); 478 switch (req->request) { 479 case GCTL_CREATE_GEOM: 480 gctl_create_geom(req); 481 break; --- 39 unchanged lines hidden --- |