FreeBSD/sys/geom/vinum/geom_vinum.c
/* Handle userland request of detaching object. */
Handle userland request of detaching object.
Handle userland request of detaching object .
static void
gv_detach(struct gv_softc *sc, struct gctl_req *req)
{
	struct gv_plex *p;
	struct gv_sd *s;
	int *flags, type;
	char *object;
	object = gctl_get_param(req, "object", NULL);
	if (object == NULL) {
		gctl_error(req, "no argument given");
		return;
	}
	flags = gctl_get_paraml(req, "flags", sizeof(*flags));
	type = gv_object_type(sc, object);
	switch (type) {
	case GV_TYPE_PLEX:
		p = gv_find_plex(sc, object);
		gv_post_event(sc, GV_EVENT_DETACH_PLEX, p, NULL, *flags, 0);
		break;
	case GV_TYPE_SD:
		s = gv_find_sd(sc, object);
		gv_post_event(sc, GV_EVENT_DETACH_SD, s, NULL, *flags, 0);
		break;
	default:
		gctl_error(req, "invalid object type");
		break;
	}
}
static void gv_detach ( struct gv_softc * sc , struct gctl_req * req ) { struct gv_plex * p ; struct gv_sd * s ; int * flags , type ; char * object ; object = gctl_get_param ( req , " " , NULL ) ; if ( object == NULL ) { gctl_error ( req , " " ) ; return ; } flags = gctl_get_paraml ( req , " " , sizeof ( * flags ) ) ; type = gv_object_type ( sc , object ) ; switch ( type ) { case GV_TYPE_PLEX : p = gv_find_plex ( sc , object ) ; gv_post_event ( sc , GV_EVENT_DETACH_PLEX , p , NULL , * flags , 0 ) ; break ; case GV_TYPE_SD : s = gv_find_sd ( sc , object ) ; gv_post_event ( sc , GV_EVENT_DETACH_SD , s , NULL , * flags , 0 ) ; break ; default : gctl_error ( req , " " ) ; break ; } }
Handle userland request of detaching object.
Handle userland request of detaching object .