Lines Matching refs:copy

48 	struct dasd_copy_relation *copy;
602 dev_warn(&device->cdev->dev, "Unable to query copy relation status\n");
611 dev_warn(&device->cdev->dev, "Error during copy relation status query\n");
646 * check the consistency of a specified copy relation by checking
649 * - is the given device part of a copy pair setup
658 struct dasd_copy_relation *copy)
671 dev_warn(&device->cdev->dev, "Device not part of a copy relation\n");
684 "Primary device %s does not match copy pair status primary device %04x\n",
698 "Secondary device %s does not match copy pair status secondary device %04x\n",
707 * the current device has to be part of the copy relation of all
708 * entries to prevent misrouted IO to another copy pair
711 if (entry == &copy->entry[j])
714 tmp_dev = copy->entry[j].device;
734 /* delete device from copy relation entry */
737 struct dasd_copy_relation *copy;
740 if (!device->copy)
743 copy = device->copy;
745 if (copy->entry[i].device == device)
746 copy->entry[i].device = NULL;
749 device->copy = NULL;
753 * read all required information for a copy relation setup and setup the device
761 struct dasd_copy_relation *copy;
774 copy = devmap->copy;
775 /* no copy pair setup for this device */
776 if (!copy)
791 dev_warn(&device->cdev->dev, "Copy pair setup requested for device not in copy relation\n");
797 if (copy->entry[i].configured &&
799 copy->entry[i].busid, DASD_BUS_ID_SIZE) == 0) {
800 entry = &copy->entry[i];
809 /* check if the copy relation is valid */
810 if (dasd_devmap_check_copy_relation(device, entry, data, copy)) {
817 copy->entry[i].device = device;
818 device->copy = copy;
858 /* Removve copy relation */
2037 * print copy relation in the form
2045 struct dasd_copy_relation *copy;
2054 if (!devmap->copy)
2057 copy = devmap->copy;
2060 if (copy->entry[i].configured && copy->entry[i].primary) {
2061 strscpy(prim_busid, copy->entry[i].busid,
2071 if (copy->entry[i].configured && !copy->entry[i].primary)
2073 copy->entry[i].busid);
2082 struct dasd_copy_relation *copy,
2090 if (copy->entry[i].configured &&
2091 strncmp(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE) == 0)
2094 if (!copy->entry[i].configured)
2100 copy->entry[i].configured = true;
2101 strscpy(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE);
2103 copy->active = &copy->entry[i];
2104 copy->entry[i].primary = true;
2106 if (!devmap->copy)
2107 devmap->copy = copy;
2112 static void dasd_devmap_del_copy_relation(struct dasd_copy_relation *copy,
2120 if (copy->entry[i].configured &&
2121 strncmp(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE) == 0)
2124 if (i == DASD_CP_ENTRIES || !copy->entry[i].configured) {
2129 copy->entry[i].configured = false;
2130 memset(copy->entry[i].busid, 0, DASD_BUS_ID_SIZE);
2131 if (copy->active == &copy->entry[i]) {
2132 copy->active = NULL;
2133 copy->entry[i].primary = false;
2140 struct dasd_copy_relation *copy;
2149 if (!devmap->copy)
2152 copy = devmap->copy;
2155 if (!copy->entry[i].configured)
2158 if (copy->entry[i].device == copy->active->device)
2161 if (copy->entry[i].device)
2166 if (strlen(copy->entry[i].busid) == 0)
2168 if (copy->entry[i].device) {
2169 dasd_put_device(copy->entry[i].device);
2170 copy->entry[i].device->copy = NULL;
2171 copy->entry[i].device = NULL;
2173 devmap = dasd_find_busid_locked(copy->entry[i].busid);
2174 devmap->copy = NULL;
2175 memset(copy->entry[i].busid, 0, DASD_BUS_ID_SIZE);
2177 kfree(copy);
2185 * parse BUSIDs from a copy pair
2230 struct dasd_copy_relation *copy;
2259 /* setting copy relation is only allowed for offline secondary */
2263 if (prim_devmap->copy) {
2264 copy = prim_devmap->copy;
2265 } else if (sec_devmap->copy) {
2266 copy = sec_devmap->copy;
2268 copy = kzalloc(sizeof(*copy), GFP_KERNEL);
2269 if (!copy)
2273 rc = dasd_devmap_set_copy_relation(prim_devmap, copy, prim_busid, true);
2278 rc = dasd_devmap_set_copy_relation(sec_devmap, copy, sec_busid, false);
2286 if (prim_devmap->device && !prim_devmap->device->copy) {
2297 dasd_devmap_del_copy_relation(copy, prim_busid);
2298 dasd_devmap_del_copy_relation(copy, sec_busid);
2311 struct dasd_copy_relation *copy;
2319 if (!device->copy) {
2323 copy = device->copy;
2325 if (copy->active->device == device) {
2330 if (copy->entry[i].device == device) {