Lines Matching refs:lv
198 struct g_llvm_lv *lv;
208 lv = pp->private;
247 if (lv->lv_sgcount == 1) {
252 sg = lv->lv_firstsg;
262 LIST_FOREACH(sg, &lv->lv_segs, sg_next) {
289 offset, length, lv->lv_name,
319 struct g_llvm_lv *lv;
329 LIST_FOREACH(lv, &vg->vg_lvs, lv_next) {
332 LIST_FOREACH(sg, &lv->lv_segs, sg_next) {
335 lv->lv_sgactive--;
342 lv->lv_gprov->name);
343 g_wither_provider(lv->lv_gprov, ENXIO);
344 lv->lv_gprov = NULL;
371 g_llvm_activate_lv(struct g_llvm_vg *vg, struct g_llvm_lv *lv)
378 KASSERT(lv->lv_sgactive == lv->lv_sgcount, ("segment missing"));
381 pp = g_new_providerf(gp, "linux_lvm/%s-%s", vg->vg_name, lv->lv_name);
382 pp->mediasize = vg->vg_extentsize * (off_t)lv->lv_extentcount;
385 lv->lv_gprov = pp;
386 pp->private = lv;
400 struct g_llvm_lv *lv;
459 LIST_FOREACH(lv, &vg->vg_lvs, lv_next) {
461 LIST_FOREACH(sg, &lv->lv_segs, sg_next) {
470 lv->lv_sgactive++;
474 lv->lv_name, sg->sg_start, sg->sg_end,
481 if (lv->lv_gprov == NULL && lv->lv_sgactive == lv->lv_sgcount) {
482 error = g_llvm_activate_lv(vg, lv);
500 struct g_llvm_lv *lv;
508 while ((lv = LIST_FIRST(&vg->vg_lvs)) != NULL) {
509 while ((sg = LIST_FIRST(&lv->lv_segs)) != NULL) {
513 LIST_REMOVE(lv, lv_next);
514 free(lv, M_GLLVM);
1047 struct g_llvm_lv *lv;
1055 lv = malloc(sizeof(*lv), M_GLLVM, M_NOWAIT|M_ZERO);
1056 if (lv == NULL)
1059 lv->lv_vg = vg;
1060 LIST_INIT(&lv->lv_segs);
1064 len = llvm_grab_name(lv->lv_name, tok);
1071 llvm_textconf_decode_sg(buf, tok, lv);
1084 GRAB_STR("id", v, tok, lv->lv_uuid, sizeof(lv->lv_uuid));
1085 GRAB_INT("segment_count", v, tok, lv->lv_sgcount);
1091 if (lv->lv_sgcount == 0 || lv->lv_sgcount != lv->lv_numsegs)
1096 lv->lv_firstsg = LIST_FIRST(&lv->lv_segs);
1097 LIST_INSERT_HEAD(&vg->vg_lvs, lv, lv_next);
1098 G_LLVM_DEBUG(3, "lv: name=%s uuid=%s", lv->lv_name, lv->lv_uuid);
1102 while ((sg = LIST_FIRST(&lv->lv_segs)) != NULL) {
1106 free(lv, M_GLLVM);
1111 llvm_textconf_decode_sg(char **buf, char *tok, struct g_llvm_lv *lv)
1178 lv->lv_numsegs++;
1179 lv->lv_extentcount += sg->sg_count;
1180 LIST_INSERT_HEAD(&lv->lv_segs, sg, sg_next);