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);
176 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument
180 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show()
192 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument
202 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store()
260 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument
263 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible()
343 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() argument
350 static ssize_t supported_checksums_show(struct kobject *kobj, in supported_checksums_show() argument
371 static ssize_t send_stream_version_show(struct kobject *kobj, in send_stream_version_show() argument
386 static ssize_t supported_rescue_options_show(struct kobject *kobj, in supported_rescue_options_show() argument
401 static ssize_t supported_sectorsizes_show(struct kobject *kobj, in supported_sectorsizes_show() argument
417 static ssize_t acl_show(struct kobject *kobj, struct kobj_attribute *a, char *buf) in acl_show() argument
449 static ssize_t btrfs_discardable_bytes_show(struct kobject *kobj, in btrfs_discardable_bytes_show() argument
453 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discardable_bytes_show()
460 static ssize_t btrfs_discardable_extents_show(struct kobject *kobj, in btrfs_discardable_extents_show() argument
464 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discardable_extents_show()
471 static ssize_t btrfs_discard_bitmap_bytes_show(struct kobject *kobj, in btrfs_discard_bitmap_bytes_show() argument
475 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_bitmap_bytes_show()
482 static ssize_t btrfs_discard_bytes_saved_show(struct kobject *kobj, in btrfs_discard_bytes_saved_show() argument
486 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_bytes_saved_show()
493 static ssize_t btrfs_discard_extent_bytes_show(struct kobject *kobj, in btrfs_discard_extent_bytes_show() argument
497 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_extent_bytes_show()
504 static ssize_t btrfs_discard_iops_limit_show(struct kobject *kobj, in btrfs_discard_iops_limit_show() argument
508 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_iops_limit_show()
514 static ssize_t btrfs_discard_iops_limit_store(struct kobject *kobj, in btrfs_discard_iops_limit_store() argument
518 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_iops_limit_store()
535 static ssize_t btrfs_discard_kbps_limit_show(struct kobject *kobj, in btrfs_discard_kbps_limit_show() argument
539 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_kbps_limit_show()
545 static ssize_t btrfs_discard_kbps_limit_store(struct kobject *kobj, in btrfs_discard_kbps_limit_store() argument
549 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_kbps_limit_store()
565 static ssize_t btrfs_discard_max_discard_size_show(struct kobject *kobj, in btrfs_discard_max_discard_size_show() argument
569 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_max_discard_size_show()
575 static ssize_t btrfs_discard_max_discard_size_store(struct kobject *kobj, in btrfs_discard_max_discard_size_store() argument
579 struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj); in btrfs_discard_max_discard_size_store()
650 static ssize_t global_rsv_size_show(struct kobject *kobj, in global_rsv_size_show() argument
653 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_size_show()
659 static ssize_t global_rsv_reserved_show(struct kobject *kobj, in global_rsv_reserved_show() argument
662 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_reserved_show()
668 #define to_space_info(_kobj) container_of(_kobj, struct btrfs_space_info, kobj)
669 #define to_raid_kobj(_kobj) container_of(_kobj, struct raid_kobject, kobj)
671 static ssize_t raid_bytes_show(struct kobject *kobj,
676 static ssize_t raid_bytes_show(struct kobject *kobj, in raid_bytes_show() argument
680 struct btrfs_space_info *sinfo = to_space_info(kobj->parent); in raid_bytes_show()
682 int index = btrfs_bg_flags_to_raid_index(to_raid_kobj(kobj)->flags); in raid_bytes_show()
708 static void release_raid_kobj(struct kobject *kobj) in release_raid_kobj() argument
710 kfree(to_raid_kobj(kobj)); in release_raid_kobj()
720 static ssize_t btrfs_space_info_show_##field(struct kobject *kobj, \
724 struct btrfs_space_info *sinfo = to_space_info(kobj); \
729 static ssize_t btrfs_chunk_size_show(struct kobject *kobj, in btrfs_chunk_size_show() argument
732 struct btrfs_space_info *sinfo = to_space_info(kobj); in btrfs_chunk_size_show()
744 static ssize_t btrfs_chunk_size_store(struct kobject *kobj, in btrfs_chunk_size_store() argument
748 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_chunk_size_store()
749 struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj)); in btrfs_chunk_size_store()
789 static ssize_t btrfs_size_classes_show(struct kobject *kobj, in btrfs_size_classes_show() argument
792 struct btrfs_space_info *sinfo = to_space_info(kobj); in btrfs_size_classes_show()
832 static ssize_t btrfs_force_chunk_alloc_store(struct kobject *kobj, in btrfs_force_chunk_alloc_store() argument
836 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_force_chunk_alloc_store()
837 struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj)); in btrfs_force_chunk_alloc_store()
887 static ssize_t btrfs_sinfo_bg_reclaim_threshold_show(struct kobject *kobj, in btrfs_sinfo_bg_reclaim_threshold_show() argument
891 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_bg_reclaim_threshold_show()
896 static ssize_t btrfs_sinfo_bg_reclaim_threshold_store(struct kobject *kobj, in btrfs_sinfo_bg_reclaim_threshold_store() argument
900 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_bg_reclaim_threshold_store()
946 static void space_info_release(struct kobject *kobj) in space_info_release() argument
948 struct btrfs_space_info *sinfo = to_space_info(kobj); in space_info_release()
969 static ssize_t btrfs_label_show(struct kobject *kobj, in btrfs_label_show() argument
972 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_show()
983 static ssize_t btrfs_label_store(struct kobject *kobj, in btrfs_label_store() argument
987 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_store()
1020 static ssize_t btrfs_nodesize_show(struct kobject *kobj, in btrfs_nodesize_show() argument
1023 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_nodesize_show()
1030 static ssize_t btrfs_sectorsize_show(struct kobject *kobj, in btrfs_sectorsize_show() argument
1033 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_sectorsize_show()
1040 static ssize_t btrfs_commit_stats_show(struct kobject *kobj, in btrfs_commit_stats_show() argument
1043 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_commit_stats_show()
1056 static ssize_t btrfs_commit_stats_store(struct kobject *kobj, in btrfs_commit_stats_store() argument
1060 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_commit_stats_store()
1082 static ssize_t btrfs_clone_alignment_show(struct kobject *kobj, in btrfs_clone_alignment_show() argument
1085 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_clone_alignment_show()
1092 static ssize_t quota_override_show(struct kobject *kobj, in quota_override_show() argument
1095 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_show()
1102 static ssize_t quota_override_store(struct kobject *kobj, in quota_override_store() argument
1106 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_store()
1132 static ssize_t btrfs_metadata_uuid_show(struct kobject *kobj, in btrfs_metadata_uuid_show() argument
1135 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_metadata_uuid_show()
1142 static ssize_t btrfs_checksum_show(struct kobject *kobj, in btrfs_checksum_show() argument
1145 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_checksum_show()
1155 static ssize_t btrfs_exclusive_operation_show(struct kobject *kobj, in btrfs_exclusive_operation_show() argument
1158 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_exclusive_operation_show()
1194 static ssize_t btrfs_generation_show(struct kobject *kobj, in btrfs_generation_show() argument
1197 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_generation_show()
1205 static ssize_t btrfs_read_policy_show(struct kobject *kobj, in btrfs_read_policy_show() argument
1208 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_read_policy_show()
1228 static ssize_t btrfs_read_policy_store(struct kobject *kobj, in btrfs_read_policy_store() argument
1232 struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj); in btrfs_read_policy_store()
1251 static ssize_t btrfs_bg_reclaim_threshold_show(struct kobject *kobj, in btrfs_bg_reclaim_threshold_show() argument
1255 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_bg_reclaim_threshold_show()
1260 static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj, in btrfs_bg_reclaim_threshold_store() argument
1264 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_bg_reclaim_threshold_store()
1308 static void btrfs_release_fsid_kobj(struct kobject *kobj) in btrfs_release_fsid_kobj() argument
1310 struct btrfs_fs_devices *fs_devs = to_fs_devs(kobj); in btrfs_release_fsid_kobj()
1321 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj) in to_fs_devs() argument
1323 if (kobj->ktype != &btrfs_ktype) in to_fs_devs()
1325 return container_of(kobj, struct btrfs_fs_devices, fsid_kobj); in to_fs_devs()
1328 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj) in to_fs_info() argument
1330 if (kobj->ktype != &btrfs_ktype) in to_fs_info()
1332 return to_fs_devs(kobj)->fs_info; in to_fs_info()
1335 static struct kobject *get_btrfs_kobj(struct kobject *kobj) in get_btrfs_kobj() argument
1337 while (kobj) { in get_btrfs_kobj()
1338 if (kobj->ktype == &btrfs_ktype) in get_btrfs_kobj()
1339 return kobj; in get_btrfs_kobj()
1340 kobj = kobj->parent; in get_btrfs_kobj()
1587 kobject_init(&rkobj->kobj, &btrfs_raid_ktype); in btrfs_sysfs_add_block_group_type()
1601 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
1604 space_info->block_group_kobjs[index] = &rkobj->kobj; in btrfs_sysfs_add_block_group_type()
1608 ret = kobject_add(&rkobj->kobj, &space_info->kobj, "%s", in btrfs_sysfs_add_block_group_type()
1615 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
1631 struct kobject *kobj; in btrfs_sysfs_remove_space_info() local
1633 kobj = space_info->block_group_kobjs[i]; in btrfs_sysfs_remove_space_info()
1635 if (kobj) { in btrfs_sysfs_remove_space_info()
1636 kobject_del(kobj); in btrfs_sysfs_remove_space_info()
1637 kobject_put(kobj); in btrfs_sysfs_remove_space_info()
1640 kobject_del(&space_info->kobj); in btrfs_sysfs_remove_space_info()
1641 kobject_put(&space_info->kobj); in btrfs_sysfs_remove_space_info()
1670 ret = kobject_init_and_add(&space_info->kobj, &space_info_ktype, in btrfs_sysfs_add_space_info_type()
1674 kobject_put(&space_info->kobj); in btrfs_sysfs_add_space_info_type()
1702 static ssize_t btrfs_devinfo_in_fs_metadata_show(struct kobject *kobj, in btrfs_devinfo_in_fs_metadata_show() argument
1707 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_in_fs_metadata_show()
1716 static ssize_t btrfs_devinfo_missing_show(struct kobject *kobj, in btrfs_devinfo_missing_show() argument
1720 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_missing_show()
1729 static ssize_t btrfs_devinfo_replace_target_show(struct kobject *kobj, in btrfs_devinfo_replace_target_show() argument
1734 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_replace_target_show()
1743 static ssize_t btrfs_devinfo_scrub_speed_max_show(struct kobject *kobj, in btrfs_devinfo_scrub_speed_max_show() argument
1747 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_show()
1753 static ssize_t btrfs_devinfo_scrub_speed_max_store(struct kobject *kobj, in btrfs_devinfo_scrub_speed_max_store() argument
1757 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_scrub_speed_max_store()
1773 static ssize_t btrfs_devinfo_writeable_show(struct kobject *kobj, in btrfs_devinfo_writeable_show() argument
1777 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_writeable_show()
1786 static ssize_t btrfs_devinfo_fsid_show(struct kobject *kobj, in btrfs_devinfo_fsid_show() argument
1789 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_fsid_show()
1796 static ssize_t btrfs_devinfo_error_stats_show(struct kobject *kobj, in btrfs_devinfo_error_stats_show() argument
1799 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_devinfo_error_stats_show()
1841 static void btrfs_release_devid_kobj(struct kobject *kobj) in btrfs_release_devid_kobj() argument
1843 struct btrfs_device *device = container_of(kobj, struct btrfs_device, in btrfs_release_devid_kobj()
1932 ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); in btrfs_kobject_uevent()
1935 action, kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), in btrfs_kobject_uevent()
1936 &disk_to_dev(bdev->bd_disk)->kobj); in btrfs_kobject_uevent()
2057 error = sysfs_create_link(fsid_kobj, &fs_info->sb->s_bdi->dev->kobj, "bdi"); in btrfs_sysfs_add_mounted()
2159 static void qgroups_release(struct kobject *kobj) in qgroups_release() argument
2161 kfree(kobj); in qgroups_release()
2170 static inline struct btrfs_fs_info *qgroup_kobj_to_fs_info(struct kobject *kobj) in qgroup_kobj_to_fs_info() argument
2172 return to_fs_info(kobj->parent->parent); in qgroup_kobj_to_fs_info()
2182 struct btrfs_qgroup, kobj); \
2194 struct btrfs_qgroup, kobj); \
2227 static void qgroup_release(struct kobject *kobj) in qgroup_release() argument
2229 struct btrfs_qgroup *qgroup = container_of(kobj, struct btrfs_qgroup, kobj); in qgroup_release()
2231 memset(&qgroup->kobj, 0, sizeof(*kobj)); in qgroup_release()
2248 if (qgroup->kobj.state_initialized) in btrfs_sysfs_add_one_qgroup()
2253 ret = kobject_init_and_add(&qgroup->kobj, &qgroup_ktype, qgroups_kobj, in btrfs_sysfs_add_one_qgroup()
2257 kobject_put(&qgroup->kobj); in btrfs_sysfs_add_one_qgroup()
2323 if (qgroup->kobj.state_initialized) { in btrfs_sysfs_del_one_qgroup()
2324 kobject_del(&qgroup->kobj); in btrfs_sysfs_del_one_qgroup()
2325 kobject_put(&qgroup->kobj); in btrfs_sysfs_del_one_qgroup()
2361 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
2364 ret = sysfs_merge_group(&btrfs_kset->kobj, in btrfs_init_sysfs()
2370 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_init_sysfs()
2372 sysfs_unmerge_group(&btrfs_kset->kobj, in btrfs_init_sysfs()
2381 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
2390 sysfs_unmerge_group(&btrfs_kset->kobj, in btrfs_exit_sysfs()
2392 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_exit_sysfs()
2394 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_exit_sysfs()