Lines Matching refs:kobj
58 struct kobject kobj; member
101 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj);
102 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj);
103 static struct kobject *get_btrfs_kobj(struct kobject *kobj);
175 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument
179 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show()
191 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument
201 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store()
259 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument
262 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible()
347 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() argument
354 static ssize_t supported_checksums_show(struct kobject *kobj, in supported_checksums_show() argument
375 static ssize_t send_stream_version_show(struct kobject *kobj, in send_stream_version_show() argument
392 static ssize_t supported_rescue_options_show(struct kobject *kobj, in supported_rescue_options_show() argument
407 static ssize_t supported_sectorsizes_show(struct kobject *kobj, in supported_sectorsizes_show() argument
424 static ssize_t acl_show(struct kobject *kobj, struct kobj_attribute *a, char *buf) in acl_show() argument
430 static ssize_t temp_fsid_supported_show(struct kobject *kobj, in temp_fsid_supported_show() argument
464 static ssize_t btrfs_discardable_bytes_show(struct kobject *kobj, in btrfs_discardable_bytes_show() argument
468 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discardable_bytes_show()
475 static ssize_t btrfs_discardable_extents_show(struct kobject *kobj, in btrfs_discardable_extents_show() argument
479 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discardable_extents_show()
486 static ssize_t btrfs_discard_bitmap_bytes_show(struct kobject *kobj, in btrfs_discard_bitmap_bytes_show() argument
490 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_bitmap_bytes_show()
497 static ssize_t btrfs_discard_bytes_saved_show(struct kobject *kobj, in btrfs_discard_bytes_saved_show() argument
501 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_bytes_saved_show()
508 static ssize_t btrfs_discard_extent_bytes_show(struct kobject *kobj, in btrfs_discard_extent_bytes_show() argument
512 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_extent_bytes_show()
519 static ssize_t btrfs_discard_iops_limit_show(struct kobject *kobj, in btrfs_discard_iops_limit_show() argument
523 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_iops_limit_show()
529 static ssize_t btrfs_discard_iops_limit_store(struct kobject *kobj, in btrfs_discard_iops_limit_store() argument
533 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_iops_limit_store()
550 static ssize_t btrfs_discard_kbps_limit_show(struct kobject *kobj, in btrfs_discard_kbps_limit_show() argument
554 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_kbps_limit_show()
560 static ssize_t btrfs_discard_kbps_limit_store(struct kobject *kobj, in btrfs_discard_kbps_limit_store() argument
564 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_kbps_limit_store()
580 static ssize_t btrfs_discard_max_discard_size_show(struct kobject *kobj, in btrfs_discard_max_discard_size_show() argument
584 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_max_discard_size_show()
590 static ssize_t btrfs_discard_max_discard_size_store(struct kobject *kobj, in btrfs_discard_max_discard_size_store() argument
594 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_max_discard_size_store()
665 static ssize_t global_rsv_size_show(struct kobject *kobj, in global_rsv_size_show() argument
668 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_size_show()
674 static ssize_t global_rsv_reserved_show(struct kobject *kobj, in global_rsv_reserved_show() argument
677 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_reserved_show()
683 #define to_space_info(_kobj) container_of(_kobj, struct btrfs_space_info, kobj)
684 #define to_raid_kobj(_kobj) container_of(_kobj, struct raid_kobject, kobj)
686 static ssize_t raid_bytes_show(struct kobject *kobj,
691 static ssize_t raid_bytes_show(struct kobject *kobj, in raid_bytes_show() argument
695 struct btrfs_space_info *sinfo = to_space_info(kobj->parent); in raid_bytes_show()
697 int index = btrfs_bg_flags_to_raid_index(to_raid_kobj(kobj)->flags); in raid_bytes_show()
723 static void release_raid_kobj(struct kobject *kobj) in release_raid_kobj() argument
725 kfree(to_raid_kobj(kobj)); in release_raid_kobj()
735 static ssize_t btrfs_space_info_show_##field(struct kobject *kobj, \
739 struct btrfs_space_info *sinfo = to_space_info(kobj); \
744 static ssize_t btrfs_chunk_size_show(struct kobject *kobj, in btrfs_chunk_size_show() argument
747 struct btrfs_space_info *sinfo = to_space_info(kobj); in btrfs_chunk_size_show()
759 static ssize_t btrfs_chunk_size_store(struct kobject *kobj, in btrfs_chunk_size_store() argument
763 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_chunk_size_store()
764 struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj)); in btrfs_chunk_size_store()
804 static ssize_t btrfs_size_classes_show(struct kobject *kobj, in btrfs_size_classes_show() argument
807 struct btrfs_space_info *sinfo = to_space_info(kobj); in btrfs_size_classes_show()
847 static ssize_t btrfs_force_chunk_alloc_store(struct kobject *kobj, in btrfs_force_chunk_alloc_store() argument
851 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_force_chunk_alloc_store()
852 struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj)); in btrfs_force_chunk_alloc_store()
905 static ssize_t btrfs_sinfo_bg_reclaim_threshold_show(struct kobject *kobj, in btrfs_sinfo_bg_reclaim_threshold_show() argument
909 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_bg_reclaim_threshold_show()
918 static ssize_t btrfs_sinfo_bg_reclaim_threshold_store(struct kobject *kobj, in btrfs_sinfo_bg_reclaim_threshold_store() argument
922 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_bg_reclaim_threshold_store()
945 static ssize_t btrfs_sinfo_dynamic_reclaim_show(struct kobject *kobj, in btrfs_sinfo_dynamic_reclaim_show() argument
949 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_dynamic_reclaim_show()
954 static ssize_t btrfs_sinfo_dynamic_reclaim_store(struct kobject *kobj, in btrfs_sinfo_dynamic_reclaim_store() argument
958 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_dynamic_reclaim_store()
978 static ssize_t btrfs_sinfo_periodic_reclaim_show(struct kobject *kobj, in btrfs_sinfo_periodic_reclaim_show() argument
982 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_periodic_reclaim_show()
987 static ssize_t btrfs_sinfo_periodic_reclaim_store(struct kobject *kobj, in btrfs_sinfo_periodic_reclaim_store() argument
991 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_periodic_reclaim_store()
1042 static void space_info_release(struct kobject *kobj) in space_info_release() argument
1044 struct btrfs_space_info *sinfo = to_space_info(kobj); in space_info_release()
1065 static ssize_t btrfs_label_show(struct kobject *kobj, in btrfs_label_show() argument
1068 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_show()
1079 static ssize_t btrfs_label_store(struct kobject *kobj, in btrfs_label_store() argument
1083 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_store()
1116 static ssize_t btrfs_nodesize_show(struct kobject *kobj, in btrfs_nodesize_show() argument
1119 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_nodesize_show()
1126 static ssize_t btrfs_sectorsize_show(struct kobject *kobj, in btrfs_sectorsize_show() argument
1129 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_sectorsize_show()
1136 static ssize_t btrfs_commit_stats_show(struct kobject *kobj, in btrfs_commit_stats_show() argument
1139 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_commit_stats_show()
1160 static ssize_t btrfs_commit_stats_store(struct kobject *kobj, in btrfs_commit_stats_store() argument
1164 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_commit_stats_store()
1186 static ssize_t btrfs_clone_alignment_show(struct kobject *kobj, in btrfs_clone_alignment_show() argument
1189 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_clone_alignment_show()
1196 static ssize_t quota_override_show(struct kobject *kobj, in quota_override_show() argument
1199 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_show()
1206 static ssize_t quota_override_store(struct kobject *kobj, in quota_override_store() argument
1210 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_store()
1236 static ssize_t btrfs_metadata_uuid_show(struct kobject *kobj, in btrfs_metadata_uuid_show() argument
1239 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_metadata_uuid_show()
1246 static ssize_t btrfs_checksum_show(struct kobject *kobj, in btrfs_checksum_show() argument
1249 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_checksum_show()
1259 static ssize_t btrfs_exclusive_operation_show(struct kobject *kobj, in btrfs_exclusive_operation_show() argument
1262 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_exclusive_operation_show()
1298 static ssize_t btrfs_generation_show(struct kobject *kobj, in btrfs_generation_show() argument
1301 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_generation_show()
1307 static ssize_t btrfs_temp_fsid_show(struct kobject *kobj, in btrfs_temp_fsid_show() argument
1310 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_temp_fsid_show()
1385 static ssize_t btrfs_read_policy_show(struct kobject *kobj, in btrfs_read_policy_show() argument
1388 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_read_policy_show()
1420 static ssize_t btrfs_read_policy_store(struct kobject *kobj, in btrfs_read_policy_store() argument
1424 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_read_policy_store()
1502 static ssize_t btrfs_bg_reclaim_threshold_show(struct kobject *kobj, in btrfs_bg_reclaim_threshold_show() argument
1506 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_bg_reclaim_threshold_show()
1511 static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj, in btrfs_bg_reclaim_threshold_store() argument
1515 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_bg_reclaim_threshold_store()
1539 static ssize_t btrfs_offload_csum_show(struct kobject *kobj, in btrfs_offload_csum_show() argument
1542 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_offload_csum_show()
1557 static ssize_t btrfs_offload_csum_store(struct kobject *kobj, in btrfs_offload_csum_store() argument
1561 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_offload_csum_store()
1604 static void btrfs_release_fsid_kobj(struct kobject *kobj) in btrfs_release_fsid_kobj() argument
1606 struct btrfs_fs_devices *fs_devs = to_fs_devs(kobj); in btrfs_release_fsid_kobj()
1617 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj) in to_fs_devs() argument
1619 if (kobj->ktype != &btrfs_ktype) in to_fs_devs()
1621 return container_of(kobj, struct btrfs_fs_devices, fsid_kobj); in to_fs_devs()
1624 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj) in to_fs_info() argument
1626 if (kobj->ktype != &btrfs_ktype) in to_fs_info()
1628 return to_fs_devs(kobj)->fs_info; in to_fs_info()
1631 static struct kobject *get_btrfs_kobj(struct kobject *kobj) in get_btrfs_kobj() argument
1633 while (kobj) { in get_btrfs_kobj()
1634 if (kobj->ktype == &btrfs_ktype) in get_btrfs_kobj()
1635 return kobj; in get_btrfs_kobj()
1636 kobj = kobj->parent; in get_btrfs_kobj()
1883 kobject_init(&rkobj->kobj, &btrfs_raid_ktype); in btrfs_sysfs_add_block_group_type()
1897 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
1900 space_info->block_group_kobjs[index] = &rkobj->kobj; in btrfs_sysfs_add_block_group_type()
1904 ret = kobject_add(&rkobj->kobj, &space_info->kobj, "%s", in btrfs_sysfs_add_block_group_type()
1911 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
1927 struct kobject *kobj; in btrfs_sysfs_remove_space_info() local
1929 kobj = space_info->block_group_kobjs[i]; in btrfs_sysfs_remove_space_info()
1931 if (kobj) { in btrfs_sysfs_remove_space_info()
1932 kobject_del(kobj); in btrfs_sysfs_remove_space_info()
1933 kobject_put(kobj); in btrfs_sysfs_remove_space_info()
1936 kobject_del(&space_info->kobj); in btrfs_sysfs_remove_space_info()
1937 kobject_put(&space_info->kobj); in btrfs_sysfs_remove_space_info()
1985 ret = kobject_init_and_add(&space_info->kobj, &space_info_ktype, in btrfs_sysfs_add_space_info_type()
1989 kobject_put(&space_info->kobj); in btrfs_sysfs_add_space_info_type()
2017 static ssize_t btrfs_devinfo_in_fs_metadata_show(struct kobject *kobj, in btrfs_devinfo_in_fs_metadata_show() argument
2022 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_in_fs_metadata_show()
2031 static ssize_t btrfs_devinfo_missing_show(struct kobject *kobj, in btrfs_devinfo_missing_show() argument
2035 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_missing_show()
2044 static ssize_t btrfs_devinfo_replace_target_show(struct kobject *kobj, in btrfs_devinfo_replace_target_show() argument
2049 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_replace_target_show()
2058 static ssize_t btrfs_devinfo_scrub_speed_max_show(struct kobject *kobj, in btrfs_devinfo_scrub_speed_max_show() argument
2062 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_show()
2068 static ssize_t btrfs_devinfo_scrub_speed_max_store(struct kobject *kobj, in btrfs_devinfo_scrub_speed_max_store() argument
2072 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_store()
2088 static ssize_t btrfs_devinfo_writeable_show(struct kobject *kobj, in btrfs_devinfo_writeable_show() argument
2092 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_writeable_show()
2101 static ssize_t btrfs_devinfo_fsid_show(struct kobject *kobj, in btrfs_devinfo_fsid_show() argument
2104 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_fsid_show()
2111 static ssize_t btrfs_devinfo_error_stats_show(struct kobject *kobj, in btrfs_devinfo_error_stats_show() argument
2114 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_error_stats_show()
2156 static void btrfs_release_devid_kobj(struct kobject *kobj) in btrfs_release_devid_kobj() argument
2158 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_release_devid_kobj()
2247 ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); in btrfs_kobject_uevent()
2250 action, kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), in btrfs_kobject_uevent()
2251 &disk_to_dev(bdev->bd_disk)->kobj); in btrfs_kobject_uevent()
2371 ret = sysfs_create_link(fsid_kobj, &fs_info->sb->s_bdi->dev->kobj, "bdi"); in btrfs_sysfs_add_mounted()
2501 static void qgroups_release(struct kobject *kobj) in qgroups_release() argument
2503 kfree(kobj); in qgroups_release()
2512 static inline struct btrfs_fs_info *qgroup_kobj_to_fs_info(struct kobject *kobj) in qgroup_kobj_to_fs_info() argument
2514 return to_fs_info(kobj->parent->parent); in qgroup_kobj_to_fs_info()
2524 struct btrfs_qgroup, kobj); \
2536 struct btrfs_qgroup, kobj); \
2569 static void qgroup_release(struct kobject *kobj) in qgroup_release() argument
2571 struct btrfs_qgroup *qgroup = container_of(kobj, struct btrfs_qgroup, kobj); in qgroup_release()
2573 memset(&qgroup->kobj, 0, sizeof(*kobj)); in qgroup_release()
2590 if (qgroup->kobj.state_initialized) in btrfs_sysfs_add_one_qgroup()
2595 ret = kobject_init_and_add(&qgroup->kobj, &qgroup_ktype, qgroups_kobj, in btrfs_sysfs_add_one_qgroup()
2599 kobject_put(&qgroup->kobj); in btrfs_sysfs_add_one_qgroup()
2665 if (qgroup->kobj.state_initialized) { in btrfs_sysfs_del_one_qgroup()
2666 kobject_del(&qgroup->kobj); in btrfs_sysfs_del_one_qgroup()
2667 kobject_put(&qgroup->kobj); in btrfs_sysfs_del_one_qgroup()
2703 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
2706 ret = sysfs_merge_group(&btrfs_kset->kobj, in btrfs_init_sysfs()
2712 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_init_sysfs()
2714 sysfs_unmerge_group(&btrfs_kset->kobj, in btrfs_init_sysfs()
2723 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
2732 sysfs_unmerge_group(&btrfs_kset->kobj, in btrfs_exit_sysfs()
2734 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_exit_sysfs()
2736 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_exit_sysfs()