Home | History | Annotate | Download | only in raidframe

Lines Matching defs:clabel

496 			    cset->ac->clabel->autoconfigure == 1) {
677 cset->ac->clabel->autoconfigure == 1) {
1400 rf_set_component_label(RF_Raid_t *raidPtr, RF_ComponentLabel_t *clabel)
1411 printf("raid%d: Version: %d\n", raidid, clabel->version);
1412 printf("raid%d: Serial Number: %d\n", raidid, clabel->serial_number);
1413 printf("raid%d: Mod counter: %d\n", raidid, clabel->mod_counter);
1414 printf("raid%d: Column: %d\n", raidid, clabel->column);
1415 printf("raid%d: Num Columns: %d\n", raidid, clabel->num_columns);
1416 printf("raid%d: Clean: %d\n", raidid, clabel->clean);
1417 printf("raid%d: Status: %d\n", raidid, clabel->status);
1419 clabel->row = 0;
1420 int column = clabel->column;
1431 clabel, sizeof(*clabel));
1438 rf_init_component_label(RF_Raid_t *raidPtr, RF_ComponentLabel_t *clabel)
1447 raidPtr->serial_number = clabel->serial_number;
1585 RF_ComponentLabel_t *clabel;
1811 clabel = raidget_component_label(raidPtr, column);
1812 clabel->last_unit = *(int *)data;
2396 RF_ComponentLabel_t *clabel;
2398 clabel = raidget_component_label(raidPtr, col);
2399 clabel->clean = RF_RAID_CLEAN;
2408 RF_ComponentLabel_t *clabel;
2410 clabel = raidget_component_label(raidPtr, col);
2411 clabel->clean = RF_RAID_DIRTY;
2455 * For reads it is expected that out_label == clabel, but writes expect
2462 rf_swap_label(RF_ComponentLabel_t *clabel, RF_ComponentLabel_t *out_label)
2466 KASSERT(clabel->version == bswap32(RF_COMPONENT_LABEL_VERSION));
2469 out_label->version = clabel->version;
2471 in = &clabel->serial_number;
2472 in_last = &clabel->future_use2[42];
2481 RF_ComponentLabel_t *clabel)
2485 error = raidread_component_area(dev, b_vp, clabel,
2491 clabel->version == bswap32(RF_COMPONENT_LABEL_VERSION)) {
2492 rf_swap_label(clabel, clabel);
2538 RF_ComponentLabel_t *clabel)
2540 RF_ComponentLabel_t *clabel_write = clabel;
2544 if (clabel->version == bswap32(RF_COMPONENT_LABEL_VERSION)) {
2546 rf_swap_label(clabel, clabel_write);
2635 RF_ComponentLabel_t *clabel;
2646 clabel = raidget_component_label(raidPtr, c);
2647 if (clabel->status == rf_ds_spared) {
2677 clabel = raidget_component_label(raidPtr, sparecol);
2680 raid_init_component_label(raidPtr, clabel);
2682 clabel->row = 0;
2683 clabel->column = scol;
2686 /* clabel.status = rf_ds_optimal; */
2697 RF_ComponentLabel_t *clabel;
2713 clabel = raidget_component_label(raidPtr, c);
2715 clabel->status = rf_ds_optimal;
2719 clabel->last_unit = raidPtr->raidid;
2753 clabel = raidget_component_label(raidPtr, sparecol);
2756 raid_init_component_label(raidPtr, clabel);
2758 clabel->column = scol;
2759 clabel->status = rf_ds_optimal;
2761 clabel->last_unit = raidPtr->raidid;
2915 RF_ComponentLabel_t *clabel;
2918 clabel = malloc(sizeof(RF_ComponentLabel_t), M_RAIDFRAME, M_WAITOK);
2920 if (!raidread_component_label(secsize, dev, vp, clabel)) {
2922 if (rf_reasonable_label(clabel, numsecs) &&
2923 (rf_component_label_partitionsize(clabel) <= size)) {
2927 rf_print_component_label(clabel);
2935 ac->clabel = clabel;
2943 free(clabel, M_RAIDFRAME);
3176 rf_reasonable_label(RF_ComponentLabel_t *clabel, uint64_t numsecs)
3179 if ((clabel->version==RF_COMPONENT_LABEL_VERSION_1 ||
3180 clabel->version==RF_COMPONENT_LABEL_VERSION ||
3181 clabel->version == bswap32(RF_COMPONENT_LABEL_VERSION)) &&
3182 (clabel->clean == RF_RAID_CLEAN ||
3183 clabel->clean == RF_RAID_DIRTY) &&
3184 clabel->row >=0 &&
3185 clabel->column >= 0 &&
3186 clabel->num_rows > 0 &&
3187 clabel->num_columns > 0 &&
3188 clabel->row < clabel->num_rows &&
3189 clabel->column < clabel->num_columns &&
3190 clabel->blockSize > 0 &&
3196 rf_component_label_numblocks(clabel) > 0) {
3202 rf_fix_old_label_size(clabel, numsecs);
3219 rf_fix_old_label_size(RF_ComponentLabel_t *clabel, uint64_t numsecs)
3223 if (clabel->numBlocksHi) {
3227 clabel->numBlocksHi = 0;
3230 if (clabel->partitionSizeHi) {
3234 clabel->partitionSizeHi = 0;
3242 rf_print_component_label(RF_ComponentLabel_t *clabel)
3250 numBlocks = rf_component_label_numblocks(clabel);
3253 clabel->row, clabel->column,
3254 clabel->num_rows, clabel->num_columns);
3256 clabel->version, clabel->serial_number,
3257 clabel->mod_counter);
3259 clabel->clean ? "Yes" : "No", clabel->status);
3261 clabel->sectPerSU, clabel->SUsPerPU, clabel->SUsPerRU);
3263 (char) clabel->parityConfig, clabel->blockSize, numBlocks);
3264 printf(" Autoconfig: %s\n", clabel->autoconfigure ? "Yes" : "No");
3265 printf(" Root partition: %s\n", rp[clabel->root_partition & 3]);
3266 printf(" Last configured as: raid%d\n", clabel->last_unit);
3268 printf(" Config order: %d\n", clabel->config_order);
3362 clabel1 = cset->ac->clabel;
3363 clabel2 = ac->clabel;
3395 RF_ComponentLabel_t *clabel;
3408 num_cols = cset->ac->clabel->num_columns;
3409 parity_type = cset->ac->clabel->parityConfig;
3420 mod_counter = ac->clabel->mod_counter;
3423 if (ac->clabel->mod_counter > mod_counter) {
3424 mod_counter = ac->clabel->mod_counter;
3437 if ((ac->clabel->column == c) &&
3438 (ac->clabel->mod_counter == mod_counter)) {
3479 clabel = cset->ac->clabel;
3481 if (((clabel->parityConfig == '0') && (num_missing > 0)) ||
3482 ((clabel->parityConfig == '4') && (num_missing > 1)) ||
3483 ((clabel->parityConfig == '5') && (num_missing > 1))) {
3497 RF_ComponentLabel_t *clabel;
3500 clabel = ac->clabel;
3503 config->numCol = clabel->num_columns;
3505 config->sectPerSU = clabel->sectPerSU;
3506 config->SUsPerPU = clabel->SUsPerPU;
3507 config->SUsPerRU = clabel->SUsPerRU;
3508 config->parityConfig = clabel->parityConfig;
3511 config->maxOutstandingDiskReqs = clabel->maxOutstanding;
3517 strcpy(config->devnames[0][ac->clabel->column],
3530 RF_ComponentLabel_t *clabel;
3538 clabel = raidget_component_label(raidPtr, column);
3539 clabel->autoconfigure = new_value;
3547 clabel = raidget_component_label(raidPtr, sparecol);
3548 clabel->autoconfigure = new_value;
3558 RF_ComponentLabel_t *clabel;
3565 clabel = raidget_component_label(raidPtr, column);
3566 clabel->root_partition = new_value;
3574 clabel = raidget_component_label(raidPtr, sparecol);
3575 clabel->root_partition = new_value;
3611 free(ac->clabel, M_RAIDFRAME);
3623 raid_init_component_label(RF_Raid_t *raidPtr, RF_ComponentLabel_t *clabel)
3626 if (clabel->version != bswap32(RF_COMPONENT_LABEL_VERSION))
3627 clabel->version = RF_COMPONENT_LABEL_VERSION;
3628 clabel->serial_number = raidPtr->serial_number;
3629 clabel->mod_counter = raidPtr->mod_counter;
3631 clabel->num_rows = 1;
3632 clabel->num_columns = raidPtr->numCol;
3633 clabel->clean = RF_RAID_DIRTY; /* not clean */
3634 clabel->status = rf_ds_optimal; /* "It's good!" */
3636 clabel->sectPerSU = raidPtr->Layout.sectorsPerStripeUnit;
3637 clabel->SUsPerPU = raidPtr->Layout.SUsPerPU;
3638 clabel->SUsPerRU = raidPtr->Layout.SUsPerRU;
3640 clabel->blockSize = raidPtr->bytesPerSector;
3641 rf_component_label_set_numblocks(clabel, raidPtr->sectorsPerDisk);
3644 clabel->parityConfig = raidPtr->Layout.map->parityConfig;
3645 clabel->maxOutstanding = raidPtr->maxOutstanding;
3646 clabel->autoconfigure = raidPtr->autoconfigure;
3647 clabel->root_partition = raidPtr->root_partition;
3648 clabel->last_unit = raidPtr->raidid;
3649 clabel->config_order = raidPtr->config_order;
3652 rf_paritymap_init_label(raidPtr->parity_map, clabel);
3677 raidID = cset->ac->clabel->last_unit;
3703 switch (cset->ac->clabel->root_partition) {
3711 cset->rootable = cset->ac->clabel->root_partition;
4012 RF_ComponentLabel_t *clabel = (RF_ComponentLabel_t *)data;
4014 int column = clabel->column;
4019 memcpy(clabel, raid_clabel, sizeof *clabel);
4021 if (clabel->version == bswap32(RF_COMPONENT_LABEL_VERSION))
4022 clabel->version = RF_COMPONENT_LABEL_VERSION;