Lines Matching refs:vol

49 static void	dump_config(CONFIG_PAGE_RAID_VOL_0 *vol);
230 CONFIG_PAGE_IOC_2_RAID_VOL *vol; in clear_config() local
253 vol = ioc2->RaidVolume; in clear_config()
254 for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { in clear_config()
255 if (mpt_lock_volume(vol->VolumeBus, vol->VolumeID) < 0) { in clear_config()
257 mpt_volume_name(vol->VolumeBus, vol->VolumeID)); in clear_config()
276 vol = ioc2->RaidVolume; in clear_config()
277 for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { in clear_config()
279 vol->VolumeBus, vol->VolumeID, 0, in clear_config()
285 mpt_volume_name(vol->VolumeBus, vol->VolumeID)); in clear_config()
478 CONFIG_PAGE_IOC_2_RAID_VOL *vol; in find_next_volume() local
494 vol = state->ioc2->RaidVolume; in find_next_volume()
495 for (i = 0; i < state->ioc2->NumActiveVolumes; vol++, i++) in find_next_volume()
496 if (vol->VolumeID == state->target_id) in find_next_volume()
508 CONFIG_PAGE_RAID_VOL_0 *vol; in build_volume() local
530 vol = calloc(1, page_size); in build_volume()
531 if (vol == NULL) in build_volume()
535 vol->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_VOLUME; in build_volume()
536 vol->Header.PageNumber = 0; in build_volume()
537 vol->Header.PageLength = page_size / 4; in build_volume()
540 vol->VolumeID = find_next_volume(state); in build_volume()
541 vol->VolumeBus = 0; in build_volume()
542 vol->VolumeIOC = 0; /* XXX */ in build_volume()
543 vol->VolumeStatus.Flags = MPI_RAIDVOL0_STATUS_FLAG_ENABLED; in build_volume()
544 vol->VolumeStatus.State = MPI_RAIDVOL0_STATUS_STATE_OPTIMAL; in build_volume()
545 vol->VolumeSettings.Settings = MPI_RAIDVOL0_SETTING_USE_DEFAULTS; in build_volume()
546 vol->VolumeSettings.HotSparePool = MPI_RAID_HOT_SPARE_POOL_0; in build_volume()
547 vol->NumPhysDisks = info->drive_count; in build_volume()
564 vol->VolumeType = MPI_RAID_VOL_TYPE_IS; in build_volume()
565 vol->StripeSize = stripe_size / 512; in build_volume()
569 vol->VolumeType = MPI_RAID_VOL_TYPE_IM; in build_volume()
573 vol->VolumeType = MPI_RAID_VOL_TYPE_IME; in build_volume()
574 vol->StripeSize = stripe_size / 512; in build_volume()
594 vol->MaxLBA = MaxLBA; in build_volume()
595 vol->MaxLBAHigh = MaxLBA >> 32; in build_volume()
598 for (i = 0, dinfo = info->drives, rdisk = vol->PhysDisk; in build_volume()
603 dinfo->info->PhysDiskID, vol->VolumeBus, in build_volume()
604 vol->VolumeID); in build_volume()
617 return (vol); in build_volume()
623 CONFIG_PAGE_RAID_VOL_0 *vol; in create_volume() local
745 vol = build_volume(fd, info, raid_type, stripe_size, &state, verbose); in create_volume()
746 if (vol == NULL) { in create_volume()
754 dump_config(vol); in create_volume()
760 error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_VOLUME, vol->VolumeBus, in create_volume()
761 vol->VolumeID, 0, quick ? MPI_RAID_ACTION_ADATA_DO_NOT_SYNC : 0, in create_volume()
762 vol, vol->Header.PageLength * 4, NULL, NULL, 0, NULL, NULL, 1); in create_volume()
774 error = mpt_rescan_bus(vol->VolumeBus, vol->VolumeID); in create_volume()
777 free(vol); in create_volume()
840 CONFIG_PAGE_IOC_2_RAID_VOL *vol; in find_volume_spare_pool() local
878 vol = ioc2->RaidVolume; in find_volume_spare_pool()
879 for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { in find_volume_spare_pool()
880 info = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL); in find_volume_spare_pool()
1192 dump_config(CONFIG_PAGE_RAID_VOL_0 *vol) in dump_config() argument
1199 vol->Header.PageType, vol->Header.PageNumber, in dump_config()
1200 vol->Header.PageLength, vol->Header.PageLength * 4, in dump_config()
1201 vol->Header.PageVersion); in dump_config()
1202 printf(" Address: %d:%d IOC %d\n", vol->VolumeBus, vol->VolumeID, in dump_config()
1203 vol->VolumeIOC); in dump_config()
1204 printf(" Type: %d (%s)\n", vol->VolumeType, in dump_config()
1205 mpt_raid_level(vol->VolumeType)); in dump_config()
1207 mpt_volstate(vol->VolumeStatus.State), vol->VolumeStatus.Flags); in dump_config()
1209 vol->VolumeSettings.Settings, vol->VolumeSettings.HotSparePool); in dump_config()
1210 printf(" MaxLBA: %ju\n", (uintmax_t)vol->MaxLBAHigh << 32 | in dump_config()
1211 vol->MaxLBA); in dump_config()
1212 printf(" Stripe Size: %ld\n", (long)vol->StripeSize * 512); in dump_config()
1213 printf(" %d Disks:\n", vol->NumPhysDisks); in dump_config()
1215 for (i = 0; i < vol->NumPhysDisks; i++) in dump_config()
1217 vol->PhysDisk[i].PhysDiskNum, vol->PhysDisk[i].PhysDiskMap); in dump_config()
1223 CONFIG_PAGE_RAID_VOL_0 *vol; in debug_config() local
1245 vol = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); in debug_config()
1246 if (vol == NULL) { in debug_config()
1252 dump_config(vol); in debug_config()
1253 free(vol); in debug_config()