• Home
  • Raw
  • Download

Lines Matching refs:device

1384 	struct btrfs_device *device;  in btrfs_sysfs_remove_fs_devices()  local
1387 list_for_each_entry(device, &fs_devices->devices, dev_list) in btrfs_sysfs_remove_fs_devices()
1388 btrfs_sysfs_remove_device(device); in btrfs_sysfs_remove_fs_devices()
1391 list_for_each_entry(device, &seed->devices, dev_list) in btrfs_sysfs_remove_fs_devices()
1392 btrfs_sysfs_remove_device(device); in btrfs_sysfs_remove_fs_devices()
1625 void btrfs_sysfs_remove_device(struct btrfs_device *device) in btrfs_sysfs_remove_device() argument
1633 devices_kobj = device->fs_info->fs_devices->devices_kobj; in btrfs_sysfs_remove_device()
1636 if (device->bdev) in btrfs_sysfs_remove_device()
1637 sysfs_remove_link(devices_kobj, bdev_kobj(device->bdev)->name); in btrfs_sysfs_remove_device()
1639 if (device->devid_kobj.state_initialized) { in btrfs_sysfs_remove_device()
1640 kobject_del(&device->devid_kobj); in btrfs_sysfs_remove_device()
1641 kobject_put(&device->devid_kobj); in btrfs_sysfs_remove_device()
1642 wait_for_completion(&device->kobj_unregister); in btrfs_sysfs_remove_device()
1651 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_in_fs_metadata_show() local
1654 val = !!test_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_devinfo_in_fs_metadata_show()
1664 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_missing_show() local
1667 val = !!test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in btrfs_devinfo_missing_show()
1678 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_replace_target_show() local
1681 val = !!test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); in btrfs_devinfo_replace_target_show()
1691 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_show() local
1694 return sysfs_emit(buf, "%llu\n", READ_ONCE(device->scrub_speed_max)); in btrfs_devinfo_scrub_speed_max_show()
1701 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_store() local
1711 WRITE_ONCE(device->scrub_speed_max, limit); in btrfs_devinfo_scrub_speed_max_store()
1721 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_writeable_show() local
1724 val = !!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_devinfo_writeable_show()
1733 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_fsid_show() local
1736 return sysfs_emit(buf, "%pU\n", device->fs_devices->fsid); in btrfs_devinfo_fsid_show()
1743 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_error_stats_show() local
1746 if (!device->dev_stats_valid) in btrfs_devinfo_error_stats_show()
1760 btrfs_dev_stat_read(device, BTRFS_DEV_STAT_WRITE_ERRS), in btrfs_devinfo_error_stats_show()
1761 btrfs_dev_stat_read(device, BTRFS_DEV_STAT_READ_ERRS), in btrfs_devinfo_error_stats_show()
1762 btrfs_dev_stat_read(device, BTRFS_DEV_STAT_FLUSH_ERRS), in btrfs_devinfo_error_stats_show()
1763 btrfs_dev_stat_read(device, BTRFS_DEV_STAT_CORRUPTION_ERRS), in btrfs_devinfo_error_stats_show()
1764 btrfs_dev_stat_read(device, BTRFS_DEV_STAT_GENERATION_ERRS)); in btrfs_devinfo_error_stats_show()
1787 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_release_devid_kobj() local
1790 memset(&device->devid_kobj, 0, sizeof(struct kobject)); in btrfs_release_devid_kobj()
1791 complete(&device->kobj_unregister); in btrfs_release_devid_kobj()
1800 int btrfs_sysfs_add_device(struct btrfs_device *device) in btrfs_sysfs_add_device() argument
1811 devices_kobj = device->fs_info->fs_devices->devices_kobj; in btrfs_sysfs_add_device()
1812 devinfo_kobj = device->fs_info->fs_devices->devinfo_kobj; in btrfs_sysfs_add_device()
1818 if (device->bdev) { in btrfs_sysfs_add_device()
1819 struct kobject *disk_kobj = bdev_kobj(device->bdev); in btrfs_sysfs_add_device()
1823 btrfs_warn(device->fs_info, in btrfs_sysfs_add_device()
1825 device->devid, ret); in btrfs_sysfs_add_device()
1830 init_completion(&device->kobj_unregister); in btrfs_sysfs_add_device()
1831 ret = kobject_init_and_add(&device->devid_kobj, &devid_ktype, in btrfs_sysfs_add_device()
1832 devinfo_kobj, "%llu", device->devid); in btrfs_sysfs_add_device()
1834 kobject_put(&device->devid_kobj); in btrfs_sysfs_add_device()
1835 btrfs_warn(device->fs_info, in btrfs_sysfs_add_device()
1837 device->devid, ret); in btrfs_sysfs_add_device()
1848 struct btrfs_device *device; in btrfs_sysfs_add_fs_devices() local
1851 list_for_each_entry(device, &fs_devices->devices, dev_list) { in btrfs_sysfs_add_fs_devices()
1852 ret = btrfs_sysfs_add_device(device); in btrfs_sysfs_add_fs_devices()
1858 list_for_each_entry(device, &seed->devices, dev_list) { in btrfs_sysfs_add_fs_devices()
1859 ret = btrfs_sysfs_add_device(device); in btrfs_sysfs_add_fs_devices()
1898 void btrfs_sysfs_update_devid(struct btrfs_device *device) in btrfs_sysfs_update_devid() argument
1902 snprintf(tmp, sizeof(tmp), "%llu", device->devid); in btrfs_sysfs_update_devid()
1904 if (kobject_rename(&device->devid_kobj, tmp)) in btrfs_sysfs_update_devid()
1905 btrfs_warn(device->fs_devices->fs_info, in btrfs_sysfs_update_devid()
1907 device->devid); in btrfs_sysfs_update_devid()