Lines Matching refs:mp

121 static void meta_sp_printunit(mp_unit_t *mp);
126 static int meta_sp_setgeom(mdname_t *np, mdname_t *compnp, mp_unit_t *mp,
194 static void meta_sp_fillextarray(mp_unit_t *mp, sp_ext_node_t *extlist);
276 meta_sp_printunit(mp_unit_t *mp)
280 if (mp == NULL)
284 (void) fprintf(stderr, "\tmp->c.un_type: %d\n", mp->c.un_type);
285 (void) fprintf(stderr, "\tmp->c.un_size: %u\n", mp->c.un_size);
286 (void) fprintf(stderr, "\tmp->c.un_self_id: %lu\n", MD_SID(mp));
289 (void) fprintf(stderr, "\tmp->un_status: %u\n", mp->un_status);
290 (void) fprintf(stderr, "\tmp->un_numexts: %u\n", mp->un_numexts);
291 (void) fprintf(stderr, "\tmp->un_length: %llu\n", mp->un_length);
292 (void) fprintf(stderr, "\tmp->un_dev(32): 0x%llx\n", mp->un_dev);
293 (void) fprintf(stderr, "\tmp->un_dev(64): 0x%llx\n", mp->un_dev);
294 (void) fprintf(stderr, "\tmp->un_key: %d\n", mp->un_key);
298 for (i = 0; i < mp->un_numexts; i++) {
300 mp->un_ext[i].un_voff, mp->un_ext[i].un_poff,
301 mp->un_ext[i].un_len);
415 * mp - the unit structure to set the geometry for
424 mp_unit_t *mp,
433 if (meta_setup_geom((md_unit_t *)mp, np, geomp, geomp->write_reinstruct,
668 md_mirror_t *mp;
672 mp = meta_get_mirror(sp, compnp, ep);
673 if (mp == NULL)
678 smp = &mp->submirrors[smi];
3433 * INPUT: mp - the unit structure to fill
3447 mp_unit_t *mp,
3455 assert(mp != NULL);
3461 mp->un_ext[ext->ext_seq].un_poff =
3463 mp->un_ext[ext->ext_seq].un_len =
3468 for (i = 0; i < mp->un_numexts; i++) {
3469 assert(mp->un_ext[i].un_poff != 0);
3470 assert(mp->un_ext[i].un_len != 0);
3471 mp->un_ext[i].un_voff = curvoff;
3472 curvoff += mp->un_ext[i].un_len;
3501 mp_unit_t *mp;
3504 ms_size = (sizeof (*mp) - sizeof (mp->un_ext[0])) +
3505 (numexts * sizeof (mp->un_ext[0]));
3507 mp = Zalloc(ms_size);
3510 mp->c.un_type = MD_METASP;
3511 mp->c.un_size = ms_size;
3512 MD_SID(mp) = meta_getminor(np->dev);
3513 mp->c.un_total_blocks = len;
3514 mp->c.un_actual_tb = len;
3517 (void) meta_sp_setgeom(np, compnp, mp, ep);
3521 MD_CAPAB(mp) = MD_CANT_PARENT;
3523 MD_CAPAB(mp) = MD_CAN_PARENT;
3526 mp->un_dev = compnp->dev;
3527 mp->un_key = compnp->key;
3530 mp->un_start_blk = (sp_ext_offset_t)compnp->start_blk;
3531 mp->un_status = status;
3532 mp->un_numexts = numexts;
3533 mp->un_length = len;
3536 meta_sp_fillextarray(mp, extlist);
3538 return (mp);
3640 mp_unit_t *mp;
3662 if ((mp = (mp_unit_t *)meta_get_mdunit(sp, np, ep)) == NULL)
3665 assert(mp->c.un_type == MD_METASP);
3672 msp->common.type = mp->c.un_type;
3673 msp->common.state = mp->c.un_status;
3674 msp->common.capabilities = mp->c.un_capabilities;
3675 msp->common.parent = mp->c.un_parent;
3676 msp->common.size = mp->c.un_total_blocks;
3677 msp->common.user_flags = mp->c.un_user_flags;
3678 msp->common.revision = mp->c.un_revision;
3681 if ((msp->compnamep = metakeyname(&sp, mp->un_key, fast, ep)) == NULL)
3689 msp->compnamep->key = mp->un_key;
3690 msp->compnamep->start_blk = mp->un_start_blk;
3693 msp->status = mp->un_status;
3696 msp->ext.ext_val = Zalloc(mp->un_numexts * sizeof (*msp->ext.ext_val));
3697 msp->ext.ext_len = mp->un_numexts;
3700 for (i = 0; i < mp->un_numexts; i++) {
3701 struct mp_ext *mde = &mp->un_ext[i];
3710 Free(mp);
3716 Free(mp);
4253 mp_unit_t *mp = NULL;
4393 mp = meta_sp_createunit(msp->common.namep, msp->compnamep,
4396 create_flag = meta_check_devicesize(mp->c.un_total_blocks);
4407 mp->c.un_revision |= MD_64BIT_META_DEV;
4410 mp->c.un_revision &= ~MD_64BIT_META_DEV;
4416 meta_sp_printunit(mp);
4459 set_params.mnum = MD_SID(mp);
4460 set_params.size = mp->c.un_size;
4461 set_params.mdp = (uintptr_t)mp;
4495 if (meta_sp_setstatus(sp, &(MD_SID(mp)), 1, MD_SP_OK, ep) < 0) {
4501 Free(mp);
4871 mp_unit_t *mp, *new_un;
4893 if ((mp = (mp_unit_t *)meta_get_mdunit(sp, np, ep)) == NULL)
4897 if (MD_HAS_PARENT(mp->c.un_parent)) {
4898 Free(mp);
4905 meta_sp_printunit(mp);
4917 if ((compnp = metakeyname(&sp, mp->un_key, 0, ep)) == NULL) {
4918 Free(mp);
4923 compnp->key = mp->un_key;
4933 Free(mp);
4936 Free(mp);
4950 Free(mp);
4961 Free(mp);
4974 assert(mp->un_numexts >= 1);
4976 mp->un_ext[mp->un_numexts - 1].un_poff,
4981 Free(mp);
4986 if ((new_un = meta_sp_updateunit(np, mp, extlist,
4988 Free(mp);
4991 Free(mp);
5918 mp_unit_t *mp;
6077 if ((mp = meta_sp_createunit(
6087 meta_sp_printunit(mp);
6091 un_array[i++] = mp;