Lines Matching refs:copy
52 struct dasd_copy_relation *copy;
606 dev_warn(&device->cdev->dev, "Unable to query copy relation status\n");
615 dev_warn(&device->cdev->dev, "Error during copy relation status query\n");
650 * check the consistency of a specified copy relation by checking
653 * - is the given device part of a copy pair setup
662 struct dasd_copy_relation *copy)
675 dev_warn(&device->cdev->dev, "Device not part of a copy relation\n");
688 "Primary device %s does not match copy pair status primary device %04x\n",
702 "Secondary device %s does not match copy pair status secondary device %04x\n",
711 * the current device has to be part of the copy relation of all
712 * entries to prevent misrouted IO to another copy pair
715 if (entry == ©->entry[j])
718 tmp_dev = copy->entry[j].device;
738 /* delete device from copy relation entry */
741 struct dasd_copy_relation *copy;
744 if (!device->copy)
747 copy = device->copy;
749 if (copy->entry[i].device == device)
750 copy->entry[i].device = NULL;
753 device->copy = NULL;
757 * read all required information for a copy relation setup and setup the device
765 struct dasd_copy_relation *copy;
778 copy = devmap->copy;
779 /* no copy pair setup for this device */
780 if (!copy)
795 dev_warn(&device->cdev->dev, "Copy pair setup requested for device not in copy relation\n");
801 if (copy->entry[i].configured &&
803 copy->entry[i].busid, DASD_BUS_ID_SIZE) == 0) {
804 entry = ©->entry[i];
813 /* check if the copy relation is valid */
814 if (dasd_devmap_check_copy_relation(device, entry, data, copy)) {
821 copy->entry[i].device = device;
822 device->copy = copy;
862 /* Removve copy relation */
2047 * print copy relation in the form
2055 struct dasd_copy_relation *copy;
2064 if (!devmap->copy)
2067 copy = devmap->copy;
2070 if (copy->entry[i].configured && copy->entry[i].primary) {
2071 strscpy(prim_busid, copy->entry[i].busid,
2081 if (copy->entry[i].configured && !copy->entry[i].primary)
2083 copy->entry[i].busid);
2092 struct dasd_copy_relation *copy,
2100 if (copy->entry[i].configured &&
2101 strncmp(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE) == 0)
2104 if (!copy->entry[i].configured)
2110 copy->entry[i].configured = true;
2111 strscpy(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE);
2113 copy->active = ©->entry[i];
2114 copy->entry[i].primary = true;
2116 if (!devmap->copy)
2117 devmap->copy = copy;
2122 static void dasd_devmap_del_copy_relation(struct dasd_copy_relation *copy,
2130 if (copy->entry[i].configured &&
2131 strncmp(copy->entry[i].busid, busid, DASD_BUS_ID_SIZE) == 0)
2134 if (i == DASD_CP_ENTRIES || !copy->entry[i].configured) {
2139 copy->entry[i].configured = false;
2140 memset(copy->entry[i].busid, 0, DASD_BUS_ID_SIZE);
2141 if (copy->active == ©->entry[i]) {
2142 copy->active = NULL;
2143 copy->entry[i].primary = false;
2150 struct dasd_copy_relation *copy;
2159 if (!devmap->copy)
2162 copy = devmap->copy;
2165 if (!copy->entry[i].configured)
2168 if (copy->entry[i].device == copy->active->device)
2171 if (copy->entry[i].device)
2176 if (strlen(copy->entry[i].busid) == 0)
2178 if (copy->entry[i].device) {
2179 dasd_put_device(copy->entry[i].device);
2180 copy->entry[i].device->copy = NULL;
2181 copy->entry[i].device = NULL;
2183 devmap = dasd_find_busid_locked(copy->entry[i].busid);
2184 devmap->copy = NULL;
2185 memset(copy->entry[i].busid, 0, DASD_BUS_ID_SIZE);
2187 kfree(copy);
2195 * parse BUSIDs from a copy pair
2240 struct dasd_copy_relation *copy;
2269 /* setting copy relation is only allowed for offline secondary */
2273 if (prim_devmap->copy) {
2274 copy = prim_devmap->copy;
2275 } else if (sec_devmap->copy) {
2276 copy = sec_devmap->copy;
2278 copy = kzalloc(sizeof(*copy), GFP_KERNEL);
2279 if (!copy)
2283 rc = dasd_devmap_set_copy_relation(prim_devmap, copy, prim_busid, true);
2288 rc = dasd_devmap_set_copy_relation(sec_devmap, copy, sec_busid, false);
2296 if (prim_devmap->device && !prim_devmap->device->copy) {
2307 dasd_devmap_del_copy_relation(copy, prim_busid);
2308 dasd_devmap_del_copy_relation(copy, sec_busid);
2321 struct dasd_copy_relation *copy;
2329 if (!device->copy) {
2333 copy = device->copy;
2335 if (copy->active->device == device) {
2340 if (copy->entry[i].device == device) {