Lines Matching refs:pd
579 struct g_raid_md_promise_perdisk *pd; in g_raid_md_promise_purge_disks() local
586 pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; in g_raid_md_promise_purge_disks()
589 for (i = 0; i < pd->pd_subdisks; ) { in g_raid_md_promise_purge_disks()
591 pd->pd_meta[i]->volume_id); in g_raid_md_promise_purge_disks()
596 free(pd->pd_meta[i], M_MD_PROMISE); in g_raid_md_promise_purge_disks()
597 for (j = i; j < pd->pd_subdisks - 1; j++) in g_raid_md_promise_purge_disks()
598 pd->pd_meta[j] = pd->pd_meta[j + 1]; in g_raid_md_promise_purge_disks()
599 pd->pd_meta[pd->pd_subdisks - 1] = NULL; in g_raid_md_promise_purge_disks()
600 pd->pd_subdisks--; in g_raid_md_promise_purge_disks()
601 pd->pd_updated = 1; in g_raid_md_promise_purge_disks()
605 if (pd->pd_subdisks == 0) { in g_raid_md_promise_purge_disks()
669 struct g_raid_md_promise_perdisk *pd; in g_raid_md_promise_start_disk() local
676 pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; in g_raid_md_promise_start_disk()
683 md_disk_pos = promise_meta_find_disk(meta, pd->pd_meta[sdn]->disk.id); in g_raid_md_promise_start_disk()
695 pd->pd_meta[sdn]->disk.flags & PROMISE_F_DOWN) { in g_raid_md_promise_start_disk()
701 free(pd->pd_meta[sdn], M_MD_PROMISE); in g_raid_md_promise_start_disk()
702 for (i = sdn; i < pd->pd_subdisks - 1; i++) in g_raid_md_promise_start_disk()
703 pd->pd_meta[i] = pd->pd_meta[i + 1]; in g_raid_md_promise_start_disk()
704 pd->pd_meta[pd->pd_subdisks - 1] = NULL; in g_raid_md_promise_start_disk()
705 pd->pd_subdisks--; in g_raid_md_promise_start_disk()
714 promise_meta_unused_range(pd->pd_meta, pd->pd_subdisks, in g_raid_md_promise_start_disk()
749 if (pd->pd_subdisks == 0) { in g_raid_md_promise_start_disk()
783 sd->sd_offset = (((off_t)pd->pd_meta[sdn]->disk_offset_high in g_raid_md_promise_start_disk()
784 << 32) + pd->pd_meta[sdn]->disk_offset) * 512; in g_raid_md_promise_start_disk()
785 sd->sd_size = (((off_t)pd->pd_meta[sdn]->disk_sectors_high in g_raid_md_promise_start_disk()
786 << 32) + pd->pd_meta[sdn]->disk_sectors) * 512; in g_raid_md_promise_start_disk()
801 if (pd->pd_meta[sdn]->generation != meta->generation) in g_raid_md_promise_start_disk()
805 (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) + in g_raid_md_promise_start_disk()
806 pd->pd_meta[sdn]->disk_rebuild) * 512; in g_raid_md_promise_start_disk()
812 } else if (pd->pd_meta[sdn]->generation != meta->generation || in g_raid_md_promise_start_disk()
835 struct g_raid_md_promise_perdisk *pd; in g_raid_md_promise_refill() local
875 pd = disk->d_md_data; in g_raid_md_promise_refill()
876 if (pd->pd_subdisks < PROMISE_MAX_SUBDISKS) { in g_raid_md_promise_refill()
899 struct g_raid_md_promise_perdisk *pd; in g_raid_md_promise_start() local
946 pd = disk->d_md_data; in g_raid_md_promise_start()
947 for (i = 0; i < pd->pd_subdisks; i++) { in g_raid_md_promise_start()
948 if (pd->pd_meta[i]->volume_id == meta->volume_id) in g_raid_md_promise_start()
987 struct g_raid_md_promise_perdisk *pd; in g_raid_md_promise_new_disk() local
995 pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; in g_raid_md_promise_new_disk()
997 if (pd->pd_subdisks == 0) { in g_raid_md_promise_new_disk()
1003 for (i = 0; i < pd->pd_subdisks; i++) { in g_raid_md_promise_new_disk()
1004 pdmeta = pd->pd_meta[i]; in g_raid_md_promise_new_disk()
1042 for (i = 0; i < pd->pd_subdisks; i++) { in g_raid_md_promise_new_disk()
1043 pdmeta = pd->pd_meta[i]; in g_raid_md_promise_new_disk()
1103 struct g_raid_md_promise_perdisk *pd; in g_raid_md_taste_promise() local
1192 pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); in g_raid_md_taste_promise()
1193 pd->pd_subdisks = subdisks; in g_raid_md_taste_promise()
1195 pd->pd_meta[i] = metaarr[i]; in g_raid_md_taste_promise()
1197 disk->d_md_data = (void *)pd; in g_raid_md_taste_promise()
1264 struct g_raid_md_promise_perdisk *pd; in g_raid_md_ctl_promise() local
1343 pd = disk->d_md_data; in g_raid_md_ctl_promise()
1344 if (pd->pd_subdisks >= PROMISE_MAX_SUBDISKS) { in g_raid_md_ctl_promise()
1347 diskname, pd->pd_subdisks); in g_raid_md_ctl_promise()
1353 promise_meta_unused_range(pd->pd_meta, in g_raid_md_ctl_promise()
1354 pd->pd_subdisks, in g_raid_md_ctl_promise()
1372 pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); in g_raid_md_ctl_promise()
1374 disk->d_md_data = (void *)pd; in g_raid_md_ctl_promise()
1673 pd = malloc(sizeof(*pd), M_MD_PROMISE, M_WAITOK | M_ZERO); in g_raid_md_ctl_promise()
1677 disk->d_md_data = (void *)pd; in g_raid_md_ctl_promise()
1700 struct g_raid_md_promise_perdisk *pd; in g_raid_md_write_promise() local
1853 pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; in g_raid_md_write_promise()
1854 for (j = 0; j < pd->pd_subdisks; j++) { in g_raid_md_write_promise()
1855 if (pd->pd_meta[j]->volume_id == meta->volume_id) in g_raid_md_write_promise()
1858 if (j == pd->pd_subdisks) in g_raid_md_write_promise()
1859 pd->pd_subdisks++; in g_raid_md_write_promise()
1860 if (pd->pd_meta[j] != NULL) in g_raid_md_write_promise()
1861 free(pd->pd_meta[j], M_MD_PROMISE); in g_raid_md_write_promise()
1862 pd->pd_meta[j] = promise_meta_copy(meta); in g_raid_md_write_promise()
1863 pd->pd_meta[j]->disk = meta->disks[pos]; in g_raid_md_write_promise()
1864 pd->pd_meta[j]->disk.number = pos; in g_raid_md_write_promise()
1865 pd->pd_meta[j]->disk_offset_high = in g_raid_md_write_promise()
1867 pd->pd_meta[j]->disk_offset = sd->sd_offset / 512; in g_raid_md_write_promise()
1868 pd->pd_meta[j]->disk_sectors_high = in g_raid_md_write_promise()
1870 pd->pd_meta[j]->disk_sectors = sd->sd_size / 512; in g_raid_md_write_promise()
1872 pd->pd_meta[j]->disk_rebuild_high = in g_raid_md_write_promise()
1874 pd->pd_meta[j]->disk_rebuild = in g_raid_md_write_promise()
1877 pd->pd_meta[j]->disk_rebuild_high = 0; in g_raid_md_write_promise()
1878 pd->pd_meta[j]->disk_rebuild = 0; in g_raid_md_write_promise()
1880 pd->pd_meta[j]->disk_rebuild_high = UINT32_MAX; in g_raid_md_write_promise()
1881 pd->pd_meta[j]->disk_rebuild = UINT32_MAX; in g_raid_md_write_promise()
1883 pd->pd_updated = 1; in g_raid_md_write_promise()
1888 pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; in g_raid_md_write_promise()
1891 if (!pd->pd_updated) in g_raid_md_write_promise()
1895 for (i = 0; i < pd->pd_subdisks; i++) in g_raid_md_write_promise()
1896 g_raid_md_promise_print(pd->pd_meta[i]); in g_raid_md_write_promise()
1898 pd->pd_meta, pd->pd_subdisks); in g_raid_md_write_promise()
1899 pd->pd_updated = 0; in g_raid_md_write_promise()
1910 struct g_raid_md_promise_perdisk *pd; in g_raid_md_fail_disk_promise() local
1915 pd = (struct g_raid_md_promise_perdisk *)tdisk->d_md_data; in g_raid_md_fail_disk_promise()
1925 if (pd->pd_subdisks > 0 && tdisk->d_consumer != NULL) in g_raid_md_fail_disk_promise()
1928 for (i = 0; i < pd->pd_subdisks; i++) { in g_raid_md_fail_disk_promise()
1929 pd->pd_meta[i]->disk.flags |= in g_raid_md_fail_disk_promise()
1931 pos = pd->pd_meta[i]->disk.number; in g_raid_md_fail_disk_promise()
1933 pd->pd_meta[i]->disks[pos].flags |= in g_raid_md_fail_disk_promise()
1936 g_raid_md_promise_print(pd->pd_meta[i]); in g_raid_md_fail_disk_promise()
1940 pd->pd_meta, pd->pd_subdisks); in g_raid_md_fail_disk_promise()
1962 struct g_raid_md_promise_perdisk *pd; in g_raid_md_free_disk_promise() local
1965 pd = (struct g_raid_md_promise_perdisk *)disk->d_md_data; in g_raid_md_free_disk_promise()
1966 for (i = 0; i < pd->pd_subdisks; i++) { in g_raid_md_free_disk_promise()
1967 if (pd->pd_meta[i] != NULL) { in g_raid_md_free_disk_promise()
1968 free(pd->pd_meta[i], M_MD_PROMISE); in g_raid_md_free_disk_promise()
1969 pd->pd_meta[i] = NULL; in g_raid_md_free_disk_promise()
1972 free(pd, M_MD_PROMISE); in g_raid_md_free_disk_promise()