Lines Matching refs:kobj

54 	struct kobject kobj;  member
93 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj);
94 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj);
167 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument
171 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show()
183 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument
193 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store()
251 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument
254 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible()
330 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() argument
337 static ssize_t supported_checksums_show(struct kobject *kobj, in supported_checksums_show() argument
358 static ssize_t send_stream_version_show(struct kobject *kobj, in send_stream_version_show() argument
373 static ssize_t supported_rescue_options_show(struct kobject *kobj, in supported_rescue_options_show() argument
389 static ssize_t supported_sectorsizes_show(struct kobject *kobj, in supported_sectorsizes_show() argument
434 static ssize_t btrfs_discardable_bytes_show(struct kobject *kobj, in btrfs_discardable_bytes_show() argument
438 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discardable_bytes_show()
445 static ssize_t btrfs_discardable_extents_show(struct kobject *kobj, in btrfs_discardable_extents_show() argument
449 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discardable_extents_show()
456 static ssize_t btrfs_discard_bitmap_bytes_show(struct kobject *kobj, in btrfs_discard_bitmap_bytes_show() argument
460 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_bitmap_bytes_show()
467 static ssize_t btrfs_discard_bytes_saved_show(struct kobject *kobj, in btrfs_discard_bytes_saved_show() argument
471 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_bytes_saved_show()
478 static ssize_t btrfs_discard_extent_bytes_show(struct kobject *kobj, in btrfs_discard_extent_bytes_show() argument
482 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_extent_bytes_show()
489 static ssize_t btrfs_discard_iops_limit_show(struct kobject *kobj, in btrfs_discard_iops_limit_show() argument
493 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_iops_limit_show()
499 static ssize_t btrfs_discard_iops_limit_store(struct kobject *kobj, in btrfs_discard_iops_limit_store() argument
503 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_iops_limit_store()
520 static ssize_t btrfs_discard_kbps_limit_show(struct kobject *kobj, in btrfs_discard_kbps_limit_show() argument
524 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_kbps_limit_show()
530 static ssize_t btrfs_discard_kbps_limit_store(struct kobject *kobj, in btrfs_discard_kbps_limit_store() argument
534 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_kbps_limit_store()
550 static ssize_t btrfs_discard_max_discard_size_show(struct kobject *kobj, in btrfs_discard_max_discard_size_show() argument
554 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_max_discard_size_show()
560 static ssize_t btrfs_discard_max_discard_size_store(struct kobject *kobj, in btrfs_discard_max_discard_size_store() argument
564 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_max_discard_size_store()
633 static ssize_t global_rsv_size_show(struct kobject *kobj, in global_rsv_size_show() argument
636 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_size_show()
642 static ssize_t global_rsv_reserved_show(struct kobject *kobj, in global_rsv_reserved_show() argument
645 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_reserved_show()
651 #define to_space_info(_kobj) container_of(_kobj, struct btrfs_space_info, kobj)
652 #define to_raid_kobj(_kobj) container_of(_kobj, struct raid_kobject, kobj)
654 static ssize_t raid_bytes_show(struct kobject *kobj,
659 static ssize_t raid_bytes_show(struct kobject *kobj, in raid_bytes_show() argument
663 struct btrfs_space_info *sinfo = to_space_info(kobj->parent); in raid_bytes_show()
665 int index = btrfs_bg_flags_to_raid_index(to_raid_kobj(kobj)->flags); in raid_bytes_show()
691 static void release_raid_kobj(struct kobject *kobj) in release_raid_kobj() argument
693 kfree(to_raid_kobj(kobj)); in release_raid_kobj()
703 static ssize_t btrfs_space_info_show_##field(struct kobject *kobj, \
707 struct btrfs_space_info *sinfo = to_space_info(kobj); \
743 static void space_info_release(struct kobject *kobj) in space_info_release() argument
745 struct btrfs_space_info *sinfo = to_space_info(kobj); in space_info_release()
766 static ssize_t btrfs_label_show(struct kobject *kobj, in btrfs_label_show() argument
769 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_show()
780 static ssize_t btrfs_label_store(struct kobject *kobj, in btrfs_label_store() argument
784 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_store()
817 static ssize_t btrfs_nodesize_show(struct kobject *kobj, in btrfs_nodesize_show() argument
820 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_nodesize_show()
827 static ssize_t btrfs_sectorsize_show(struct kobject *kobj, in btrfs_sectorsize_show() argument
830 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_sectorsize_show()
838 static ssize_t btrfs_clone_alignment_show(struct kobject *kobj, in btrfs_clone_alignment_show() argument
841 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_clone_alignment_show()
848 static ssize_t quota_override_show(struct kobject *kobj, in quota_override_show() argument
851 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_show()
858 static ssize_t quota_override_store(struct kobject *kobj, in quota_override_store() argument
862 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_store()
888 static ssize_t btrfs_metadata_uuid_show(struct kobject *kobj, in btrfs_metadata_uuid_show() argument
891 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_metadata_uuid_show()
899 static ssize_t btrfs_checksum_show(struct kobject *kobj, in btrfs_checksum_show() argument
902 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_checksum_show()
912 static ssize_t btrfs_exclusive_operation_show(struct kobject *kobj, in btrfs_exclusive_operation_show() argument
915 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_exclusive_operation_show()
948 static ssize_t btrfs_generation_show(struct kobject *kobj, in btrfs_generation_show() argument
951 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_generation_show()
978 static ssize_t btrfs_read_policy_show(struct kobject *kobj, in btrfs_read_policy_show() argument
981 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_read_policy_show()
1001 static ssize_t btrfs_read_policy_store(struct kobject *kobj, in btrfs_read_policy_store() argument
1005 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_read_policy_store()
1024 static ssize_t btrfs_bg_reclaim_threshold_show(struct kobject *kobj, in btrfs_bg_reclaim_threshold_show() argument
1028 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_bg_reclaim_threshold_show()
1037 static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj, in btrfs_bg_reclaim_threshold_store() argument
1041 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_bg_reclaim_threshold_store()
1079 static void btrfs_release_fsid_kobj(struct kobject *kobj) in btrfs_release_fsid_kobj() argument
1081 struct btrfs_fs_devices *fs_devs = to_fs_devs(kobj); in btrfs_release_fsid_kobj()
1092 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj) in to_fs_devs() argument
1094 if (kobj->ktype != &btrfs_ktype) in to_fs_devs()
1096 return container_of(kobj, struct btrfs_fs_devices, fsid_kobj); in to_fs_devs()
1099 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj) in to_fs_info() argument
1101 if (kobj->ktype != &btrfs_ktype) in to_fs_info()
1103 return to_fs_devs(kobj)->fs_info; in to_fs_info()
1349 kobject_init(&rkobj->kobj, &btrfs_raid_ktype); in btrfs_sysfs_add_block_group_type()
1363 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
1366 space_info->block_group_kobjs[index] = &rkobj->kobj; in btrfs_sysfs_add_block_group_type()
1370 ret = kobject_add(&rkobj->kobj, &space_info->kobj, "%s", in btrfs_sysfs_add_block_group_type()
1377 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
1393 struct kobject *kobj; in btrfs_sysfs_remove_space_info() local
1395 kobj = space_info->block_group_kobjs[i]; in btrfs_sysfs_remove_space_info()
1397 if (kobj) { in btrfs_sysfs_remove_space_info()
1398 kobject_del(kobj); in btrfs_sysfs_remove_space_info()
1399 kobject_put(kobj); in btrfs_sysfs_remove_space_info()
1402 kobject_del(&space_info->kobj); in btrfs_sysfs_remove_space_info()
1403 kobject_put(&space_info->kobj); in btrfs_sysfs_remove_space_info()
1432 ret = kobject_init_and_add(&space_info->kobj, &space_info_ktype, in btrfs_sysfs_add_space_info_type()
1436 kobject_put(&space_info->kobj); in btrfs_sysfs_add_space_info_type()
1464 static ssize_t btrfs_devinfo_in_fs_metadata_show(struct kobject *kobj, in btrfs_devinfo_in_fs_metadata_show() argument
1469 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_in_fs_metadata_show()
1478 static ssize_t btrfs_devinfo_missing_show(struct kobject *kobj, in btrfs_devinfo_missing_show() argument
1482 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_missing_show()
1491 static ssize_t btrfs_devinfo_replace_target_show(struct kobject *kobj, in btrfs_devinfo_replace_target_show() argument
1496 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_replace_target_show()
1505 static ssize_t btrfs_devinfo_scrub_speed_max_show(struct kobject *kobj, in btrfs_devinfo_scrub_speed_max_show() argument
1509 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_show()
1516 static ssize_t btrfs_devinfo_scrub_speed_max_store(struct kobject *kobj, in btrfs_devinfo_scrub_speed_max_store() argument
1520 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_store()
1532 static ssize_t btrfs_devinfo_writeable_show(struct kobject *kobj, in btrfs_devinfo_writeable_show() argument
1536 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_writeable_show()
1545 static ssize_t btrfs_devinfo_error_stats_show(struct kobject *kobj, in btrfs_devinfo_error_stats_show() argument
1548 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_error_stats_show()
1589 static void btrfs_release_devid_kobj(struct kobject *kobj) in btrfs_release_devid_kobj() argument
1591 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_release_devid_kobj()
1680 ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); in btrfs_kobject_uevent()
1683 action, kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), in btrfs_kobject_uevent()
1684 &disk_to_dev(bdev->bd_disk)->kobj); in btrfs_kobject_uevent()
1807 error = sysfs_create_link(fsid_kobj, &fs_info->sb->s_bdi->dev->kobj, "bdi"); in btrfs_sysfs_add_mounted()
1828 static inline struct btrfs_fs_info *qgroup_kobj_to_fs_info(struct kobject *kobj) in qgroup_kobj_to_fs_info() argument
1830 return to_fs_info(kobj->parent->parent); in qgroup_kobj_to_fs_info()
1840 struct btrfs_qgroup, kobj); \
1852 struct btrfs_qgroup, kobj); \
1885 static void qgroup_release(struct kobject *kobj) in qgroup_release() argument
1887 struct btrfs_qgroup *qgroup = container_of(kobj, struct btrfs_qgroup, kobj); in qgroup_release()
1889 memset(&qgroup->kobj, 0, sizeof(*kobj)); in qgroup_release()
1906 if (qgroup->kobj.state_initialized) in btrfs_sysfs_add_one_qgroup()
1911 ret = kobject_init_and_add(&qgroup->kobj, &qgroup_ktype, qgroups_kobj, in btrfs_sysfs_add_one_qgroup()
1915 kobject_put(&qgroup->kobj); in btrfs_sysfs_add_one_qgroup()
1977 if (qgroup->kobj.state_initialized) { in btrfs_sysfs_del_one_qgroup()
1978 kobject_del(&qgroup->kobj); in btrfs_sysfs_del_one_qgroup()
1979 kobject_put(&qgroup->kobj); in btrfs_sysfs_del_one_qgroup()
2028 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
2031 ret = sysfs_merge_group(&btrfs_kset->kobj, in btrfs_init_sysfs()
2037 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_init_sysfs()
2045 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
2054 sysfs_unmerge_group(&btrfs_kset->kobj, in btrfs_exit_sysfs()
2056 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_exit_sysfs()
2058 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_exit_sysfs()