• Home
  • Raw
  • Download

Lines Matching refs:device

50 	struct dasd_device *device;  member
429 new->device = NULL; in dasd_add_busid()
483 BUG_ON(devmap->device != NULL); in dasd_forget_ranges()
498 struct dasd_device *device; in dasd_device_from_devindex() local
510 if (devmap && devmap->device) { in dasd_device_from_devindex()
511 device = devmap->device; in dasd_device_from_devindex()
512 dasd_get_device(device); in dasd_device_from_devindex()
514 device = ERR_PTR(-ENODEV); in dasd_device_from_devindex()
516 return device; in dasd_device_from_devindex()
542 struct dasd_device *device; in dasd_create_device() local
550 device = dasd_alloc_device(); in dasd_create_device()
551 if (IS_ERR(device)) in dasd_create_device()
552 return device; in dasd_create_device()
553 atomic_set(&device->ref_count, 3); in dasd_create_device()
556 if (!devmap->device) { in dasd_create_device()
557 devmap->device = device; in dasd_create_device()
558 device->devindex = devmap->devindex; in dasd_create_device()
559 device->features = devmap->features; in dasd_create_device()
561 device->cdev = cdev; in dasd_create_device()
569 dasd_free_device(device); in dasd_create_device()
574 dev_set_drvdata(&cdev->dev, device); in dasd_create_device()
577 return device; in dasd_create_device()
590 dasd_delete_device(struct dasd_device *device) in dasd_delete_device() argument
597 devmap = dasd_find_busid(dev_name(&device->cdev->dev)); in dasd_delete_device()
600 if (devmap->device != device) { in dasd_delete_device()
602 dasd_put_device(device); in dasd_delete_device()
605 devmap->device = NULL; in dasd_delete_device()
609 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); in dasd_delete_device()
610 dev_set_drvdata(&device->cdev->dev, NULL); in dasd_delete_device()
611 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); in dasd_delete_device()
617 atomic_sub(3, &device->ref_count); in dasd_delete_device()
620 wait_event(dasd_delete_wq, atomic_read(&device->ref_count) == 0); in dasd_delete_device()
623 cdev = device->cdev; in dasd_delete_device()
624 device->cdev = NULL; in dasd_delete_device()
630 dasd_free_device(device); in dasd_delete_device()
638 dasd_put_device_wake(struct dasd_device *device) in dasd_put_device_wake() argument
652 struct dasd_device *device = dev_get_drvdata(&cdev->dev); in dasd_device_from_cdev_locked() local
654 if (!device) in dasd_device_from_cdev_locked()
656 dasd_get_device(device); in dasd_device_from_cdev_locked()
657 return device; in dasd_device_from_cdev_locked()
666 struct dasd_device *device; in dasd_device_from_cdev() local
670 device = dasd_device_from_cdev_locked(cdev); in dasd_device_from_cdev()
672 return device; in dasd_device_from_cdev()
675 void dasd_add_link_to_gendisk(struct gendisk *gdp, struct dasd_device *device) in dasd_add_link_to_gendisk() argument
679 devmap = dasd_find_busid(dev_name(&device->cdev->dev)); in dasd_add_link_to_gendisk()
689 struct dasd_device *device; in dasd_device_from_gendisk() local
694 device = NULL; in dasd_device_from_gendisk()
697 if (devmap && devmap->device) { in dasd_device_from_gendisk()
698 device = devmap->device; in dasd_device_from_gendisk()
699 dasd_get_device(device); in dasd_device_from_gendisk()
702 return device; in dasd_device_from_gendisk()
712 static ssize_t dasd_ff_show(struct device *dev, struct device_attribute *attr, in dasd_ff_show()
726 static ssize_t dasd_ff_store(struct device *dev, struct device_attribute *attr, in dasd_ff_store()
746 if (devmap->device) in dasd_ff_store()
747 devmap->device->features = devmap->features; in dasd_ff_store()
758 dasd_ro_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_ro_show()
772 dasd_ro_store(struct device *dev, struct device_attribute *attr, in dasd_ro_store()
776 struct dasd_device *device; in dasd_ro_store() local
793 device = devmap->device; in dasd_ro_store()
794 if (device) { in dasd_ro_store()
795 device->features = devmap->features; in dasd_ro_store()
796 val = val || test_bit(DASD_FLAG_DEVICE_RO, &device->flags); in dasd_ro_store()
799 if (device && device->block && device->block->gdp) in dasd_ro_store()
800 set_disk_ro(device->block->gdp, val); in dasd_ro_store()
810 dasd_erplog_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_erplog_show()
824 dasd_erplog_store(struct device *dev, struct device_attribute *attr, in dasd_erplog_store()
844 if (devmap->device) in dasd_erplog_store()
845 devmap->device->features = devmap->features; in dasd_erplog_store()
857 dasd_use_diag_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_use_diag_show()
871 dasd_use_diag_store(struct device *dev, struct device_attribute *attr, in dasd_use_diag_store()
890 if (!devmap->device && !(devmap->features & DASD_FEATURE_USERAW)) { in dasd_use_diag_store()
908 dasd_use_raw_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_use_raw_show()
922 dasd_use_raw_store(struct device *dev, struct device_attribute *attr, in dasd_use_raw_store()
939 if (!devmap->device && !(devmap->features & DASD_FEATURE_USEDIAG)) { in dasd_use_raw_store()
954 dasd_safe_offline_store(struct device *dev, struct device_attribute *attr, in dasd_safe_offline_store()
958 struct dasd_device *device; in dasd_safe_offline_store() local
961 device = dasd_device_from_cdev(cdev); in dasd_safe_offline_store()
962 if (IS_ERR(device)) { in dasd_safe_offline_store()
963 rc = PTR_ERR(device); in dasd_safe_offline_store()
967 if (test_bit(DASD_FLAG_OFFLINE, &device->flags) || in dasd_safe_offline_store()
968 test_bit(DASD_FLAG_SAFE_OFFLINE_RUNNING, &device->flags)) { in dasd_safe_offline_store()
970 dasd_put_device(device); in dasd_safe_offline_store()
975 set_bit(DASD_FLAG_SAFE_OFFLINE, &device->flags); in dasd_safe_offline_store()
976 dasd_put_device(device); in dasd_safe_offline_store()
987 dasd_discipline_show(struct device *dev, struct device_attribute *attr, in dasd_discipline_show()
990 struct dasd_device *device; in dasd_discipline_show() local
993 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_discipline_show()
994 if (IS_ERR(device)) in dasd_discipline_show()
996 else if (!device->discipline) { in dasd_discipline_show()
997 dasd_put_device(device); in dasd_discipline_show()
1001 device->discipline->name); in dasd_discipline_show()
1002 dasd_put_device(device); in dasd_discipline_show()
1013 dasd_device_status_show(struct device *dev, struct device_attribute *attr, in dasd_device_status_show()
1016 struct dasd_device *device; in dasd_device_status_show() local
1019 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_device_status_show()
1020 if (!IS_ERR(device)) { in dasd_device_status_show()
1021 switch (device->state) { in dasd_device_status_show()
1044 dasd_put_device(device); in dasd_device_status_show()
1052 static ssize_t dasd_alias_show(struct device *dev, in dasd_alias_show()
1055 struct dasd_device *device; in dasd_alias_show() local
1058 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_alias_show()
1059 if (IS_ERR(device)) in dasd_alias_show()
1062 if (device->discipline && device->discipline->get_uid && in dasd_alias_show()
1063 !device->discipline->get_uid(device, &uid)) { in dasd_alias_show()
1066 dasd_put_device(device); in dasd_alias_show()
1070 dasd_put_device(device); in dasd_alias_show()
1077 static ssize_t dasd_vendor_show(struct device *dev, in dasd_vendor_show()
1080 struct dasd_device *device; in dasd_vendor_show() local
1084 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_vendor_show()
1086 if (IS_ERR(device)) in dasd_vendor_show()
1089 if (device->discipline && device->discipline->get_uid && in dasd_vendor_show()
1090 !device->discipline->get_uid(device, &uid)) in dasd_vendor_show()
1093 dasd_put_device(device); in dasd_vendor_show()
1105 dasd_uid_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_uid_show()
1107 struct dasd_device *device; in dasd_uid_show() local
1112 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_uid_show()
1114 if (IS_ERR(device)) in dasd_uid_show()
1117 if (device->discipline && device->discipline->get_uid && in dasd_uid_show()
1118 !device->discipline->get_uid(device, &uid)) { in dasd_uid_show()
1148 dasd_put_device(device); in dasd_uid_show()
1158 dasd_eer_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_eer_show()
1164 if (!IS_ERR(devmap) && devmap->device) in dasd_eer_show()
1165 eer_flag = dasd_eer_enabled(devmap->device); in dasd_eer_show()
1172 dasd_eer_store(struct device *dev, struct device_attribute *attr, in dasd_eer_store()
1182 if (!devmap->device) in dasd_eer_store()
1190 rc = dasd_eer_enable(devmap->device); in dasd_eer_store()
1194 dasd_eer_disable(devmap->device); in dasd_eer_store()
1204 dasd_expires_show(struct device *dev, struct device_attribute *attr, char *buf) in dasd_expires_show()
1206 struct dasd_device *device; in dasd_expires_show() local
1209 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_expires_show()
1210 if (IS_ERR(device)) in dasd_expires_show()
1212 len = snprintf(buf, PAGE_SIZE, "%lu\n", device->default_expires); in dasd_expires_show()
1213 dasd_put_device(device); in dasd_expires_show()
1218 dasd_expires_store(struct device *dev, struct device_attribute *attr, in dasd_expires_store()
1221 struct dasd_device *device; in dasd_expires_store() local
1224 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_expires_store()
1225 if (IS_ERR(device)) in dasd_expires_store()
1230 dasd_put_device(device); in dasd_expires_store()
1235 device->default_expires = val; in dasd_expires_store()
1237 dasd_put_device(device); in dasd_expires_store()
1243 static ssize_t dasd_reservation_policy_show(struct device *dev, in dasd_reservation_policy_show()
1264 static ssize_t dasd_reservation_policy_store(struct device *dev, in dasd_reservation_policy_store()
1282 if (devmap->device) in dasd_reservation_policy_store()
1283 devmap->device->features = devmap->features; in dasd_reservation_policy_store()
1294 static ssize_t dasd_reservation_state_show(struct device *dev, in dasd_reservation_state_show()
1298 struct dasd_device *device; in dasd_reservation_state_show() local
1301 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_reservation_state_show()
1302 if (IS_ERR(device)) in dasd_reservation_state_show()
1305 if (test_bit(DASD_FLAG_IS_RESERVED, &device->flags)) in dasd_reservation_state_show()
1307 else if (test_bit(DASD_FLAG_LOCK_STOLEN, &device->flags)) in dasd_reservation_state_show()
1311 dasd_put_device(device); in dasd_reservation_state_show()
1315 static ssize_t dasd_reservation_state_store(struct device *dev, in dasd_reservation_state_store()
1319 struct dasd_device *device; in dasd_reservation_state_store() local
1322 device = dasd_device_from_cdev(to_ccwdev(dev)); in dasd_reservation_state_store()
1323 if (IS_ERR(device)) in dasd_reservation_state_store()
1326 clear_bit(DASD_FLAG_LOCK_STOLEN, &device->flags); in dasd_reservation_state_store()
1329 dasd_put_device(device); in dasd_reservation_state_store()
1396 if (devmap->device) in dasd_set_feature()
1397 devmap->device->features = devmap->features; in dasd_set_feature()