Lines Matching full:copy
52 struct dasd_copy_relation *copy; member
605 dev_warn(&device->cdev->dev, "Unable to query copy relation status\n"); in dasd_devmap_get_pprc_status()
614 dev_warn(&device->cdev->dev, "Error during copy relation status query\n"); in dasd_devmap_get_pprc_status()
649 * check the consistency of a specified copy relation by checking
652 * - is the given device part of a copy pair setup
661 struct dasd_copy_relation *copy) in dasd_devmap_check_copy_relation() argument
674 dev_warn(&device->cdev->dev, "Device not part of a copy relation\n"); in dasd_devmap_check_copy_relation()
681 dev_warn(&device->cdev->dev, "Copy pair secondary is setup as primary\n"); in dasd_devmap_check_copy_relation()
687 "Primary device %s does not match copy pair status primary device %04x\n", in dasd_devmap_check_copy_relation()
695 dev_warn(&device->cdev->dev, "Copy pair primary is setup as secondary\n"); in dasd_devmap_check_copy_relation()
701 "Secondary device %s does not match copy pair status secondary device %04x\n", in dasd_devmap_check_copy_relation()
710 * the current device has to be part of the copy relation of all in dasd_devmap_check_copy_relation()
711 * entries to prevent misrouted IO to another copy pair in dasd_devmap_check_copy_relation()
714 if (entry == ©->entry[j]) in dasd_devmap_check_copy_relation()
717 tmp_dev = copy->entry[j].device; in dasd_devmap_check_copy_relation()
727 "Copy pair relation does not contain device: %s\n", in dasd_devmap_check_copy_relation()
737 /* delete device from copy relation entry */
740 struct dasd_copy_relation *copy; in dasd_devmap_delete_copy_relation_device() local
743 if (!device->copy) in dasd_devmap_delete_copy_relation_device()
746 copy = device->copy; in dasd_devmap_delete_copy_relation_device()
748 if (copy->entry[i].device == device) in dasd_devmap_delete_copy_relation_device()
749 copy->entry[i].device = NULL; in dasd_devmap_delete_copy_relation_device()
752 device->copy = NULL; in dasd_devmap_delete_copy_relation_device()
756 * read all required information for a copy relation setup and setup the device
764 struct dasd_copy_relation *copy; in dasd_devmap_set_device_copy_relation() local
777 copy = devmap->copy; in dasd_devmap_set_device_copy_relation()
778 /* no copy pair setup for this device */ in dasd_devmap_set_device_copy_relation()
779 if (!copy) in dasd_devmap_set_device_copy_relation()
788 dev_err(&cdev->dev, "Copy relation not enabled on storage server\n"); in dasd_devmap_set_device_copy_relation()
794 dev_warn(&device->cdev->dev, "Copy pair setup requested for device not in copy relation\n"); in dasd_devmap_set_device_copy_relation()
800 if (copy->entry[i].configured && in dasd_devmap_set_device_copy_relation()
802 copy->entry[i].busid, DASD_BUS_ID_SIZE) == 0) { in dasd_devmap_set_device_copy_relation()
803 entry = ©->entry[i]; in dasd_devmap_set_device_copy_relation()
808 dev_warn(&device->cdev->dev, "Copy relation entry not found\n"); in dasd_devmap_set_device_copy_relation()
812 /* check if the copy relation is valid */ in dasd_devmap_set_device_copy_relation()
813 if (dasd_devmap_check_copy_relation(device, entry, data, copy)) { in dasd_devmap_set_device_copy_relation()
814 dev_warn(&device->cdev->dev, "Copy relation faulty\n"); in dasd_devmap_set_device_copy_relation()
820 copy->entry[i].device = device; in dasd_devmap_set_device_copy_relation()
821 device->copy = copy; in dasd_devmap_set_device_copy_relation()
861 /* Removve copy relation */ in dasd_delete_device()
1928 * print copy relation in the form
1936 struct dasd_copy_relation *copy; in dasd_copy_pair_show() local
1945 if (!devmap->copy) in dasd_copy_pair_show()
1948 copy = devmap->copy; in dasd_copy_pair_show()
1951 if (copy->entry[i].configured && copy->entry[i].primary) { in dasd_copy_pair_show()
1952 strscpy(prim_busid, copy->entry[i].busid, in dasd_copy_pair_show()
1962 if (copy->entry[i].configured && !copy->entry[i].primary) in dasd_copy_pair_show()
1964 copy->entry[i].busid); in dasd_copy_pair_show()
1973 struct dasd_copy_relation *copy, in dasd_devmap_set_copy_relation() argument
1981 if (copy->entry[i].configured && in dasd_devmap_set_copy_relation()
1982 strncmp(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE) == 0) in dasd_devmap_set_copy_relation()
1985 if (!copy->entry[i].configured) in dasd_devmap_set_copy_relation()
1991 copy->entry[i].configured = true; in dasd_devmap_set_copy_relation()
1992 strscpy(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE); in dasd_devmap_set_copy_relation()
1994 copy->active = ©->entry[i]; in dasd_devmap_set_copy_relation()
1995 copy->entry[i].primary = true; in dasd_devmap_set_copy_relation()
1997 if (!devmap->copy) in dasd_devmap_set_copy_relation()
1998 devmap->copy = copy; in dasd_devmap_set_copy_relation()
2003 static void dasd_devmap_del_copy_relation(struct dasd_copy_relation *copy, in dasd_devmap_del_copy_relation() argument
2011 if (copy->entry[i].configured && in dasd_devmap_del_copy_relation()
2012 strncmp(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE) == 0) in dasd_devmap_del_copy_relation()
2015 if (i == DASD_CP_ENTRIES || !copy->entry[i].configured) { in dasd_devmap_del_copy_relation()
2020 copy->entry[i].configured = false; in dasd_devmap_del_copy_relation()
2021 memset(copy->entry[i].busid, 0, DASD_BUS_ID_SIZE); in dasd_devmap_del_copy_relation()
2022 if (copy->active == ©->entry[i]) { in dasd_devmap_del_copy_relation()
2023 copy->active = NULL; in dasd_devmap_del_copy_relation()
2024 copy->entry[i].primary = false; in dasd_devmap_del_copy_relation()
2031 struct dasd_copy_relation *copy; in dasd_devmap_clear_copy_relation() local
2040 if (!devmap->copy) in dasd_devmap_clear_copy_relation()
2043 copy = devmap->copy; in dasd_devmap_clear_copy_relation()
2046 if (!copy->entry[i].configured) in dasd_devmap_clear_copy_relation()
2049 if (copy->entry[i].device == copy->active->device) in dasd_devmap_clear_copy_relation()
2052 if (copy->entry[i].device) in dasd_devmap_clear_copy_relation()
2057 if (strlen(copy->entry[i].busid) == 0) in dasd_devmap_clear_copy_relation()
2059 if (copy->entry[i].device) { in dasd_devmap_clear_copy_relation()
2060 dasd_put_device(copy->entry[i].device); in dasd_devmap_clear_copy_relation()
2061 copy->entry[i].device->copy = NULL; in dasd_devmap_clear_copy_relation()
2062 copy->entry[i].device = NULL; in dasd_devmap_clear_copy_relation()
2064 devmap = dasd_find_busid_locked(copy->entry[i].busid); in dasd_devmap_clear_copy_relation()
2065 devmap->copy = NULL; in dasd_devmap_clear_copy_relation()
2066 memset(copy->entry[i].busid, 0, DASD_BUS_ID_SIZE); in dasd_devmap_clear_copy_relation()
2068 kfree(copy); in dasd_devmap_clear_copy_relation()
2076 * parse BUSIDs from a copy pair
2121 struct dasd_copy_relation *copy; in dasd_copy_pair_store() local
2150 /* setting copy relation is only allowed for offline secondary */ in dasd_copy_pair_store()
2154 if (prim_devmap->copy) { in dasd_copy_pair_store()
2155 copy = prim_devmap->copy; in dasd_copy_pair_store()
2156 } else if (sec_devmap->copy) { in dasd_copy_pair_store()
2157 copy = sec_devmap->copy; in dasd_copy_pair_store()
2159 copy = kzalloc(sizeof(*copy), GFP_KERNEL); in dasd_copy_pair_store()
2160 if (!copy) in dasd_copy_pair_store()
2164 rc = dasd_devmap_set_copy_relation(prim_devmap, copy, prim_busid, true); in dasd_copy_pair_store()
2169 rc = dasd_devmap_set_copy_relation(sec_devmap, copy, sec_busid, false); in dasd_copy_pair_store()
2177 if (prim_devmap->device && !prim_devmap->device->copy) { in dasd_copy_pair_store()
2188 dasd_devmap_del_copy_relation(copy, prim_busid); in dasd_copy_pair_store()
2189 dasd_devmap_del_copy_relation(copy, sec_busid); in dasd_copy_pair_store()
2202 struct dasd_copy_relation *copy; in dasd_copy_role_show() local
2210 if (!device->copy) { in dasd_copy_role_show()
2214 copy = device->copy; in dasd_copy_role_show()
2216 if (copy->active->device == device) { in dasd_copy_role_show()
2221 if (copy->entry[i].device == device) { in dasd_copy_role_show()
2226 /* not in the list, no COPY role */ in dasd_copy_role_show()