Lines Matching refs:kobj

30 	struct kobject kobj;  member
69 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj);
70 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj);
143 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument
147 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show()
159 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument
169 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store()
227 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument
230 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible()
291 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() argument
344 static ssize_t global_rsv_size_show(struct kobject *kobj, in global_rsv_size_show() argument
347 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_size_show()
353 static ssize_t global_rsv_reserved_show(struct kobject *kobj, in global_rsv_reserved_show() argument
356 struct btrfs_fs_info *fs_info = to_fs_info(kobj->parent); in global_rsv_reserved_show()
362 #define to_space_info(_kobj) container_of(_kobj, struct btrfs_space_info, kobj)
363 #define to_raid_kobj(_kobj) container_of(_kobj, struct raid_kobject, kobj)
365 static ssize_t raid_bytes_show(struct kobject *kobj,
370 static ssize_t raid_bytes_show(struct kobject *kobj, in raid_bytes_show() argument
374 struct btrfs_space_info *sinfo = to_space_info(kobj->parent); in raid_bytes_show()
376 int index = btrfs_bg_flags_to_raid_index(to_raid_kobj(kobj)->flags); in raid_bytes_show()
397 static void release_raid_kobj(struct kobject *kobj) in release_raid_kobj() argument
399 kfree(to_raid_kobj(kobj)); in release_raid_kobj()
409 static ssize_t btrfs_space_info_show_##field(struct kobject *kobj, \
413 struct btrfs_space_info *sinfo = to_space_info(kobj); \
418 static ssize_t btrfs_space_info_show_total_bytes_pinned(struct kobject *kobj, in btrfs_space_info_show_total_bytes_pinned() argument
422 struct btrfs_space_info *sinfo = to_space_info(kobj); in btrfs_space_info_show_total_bytes_pinned()
454 static void space_info_release(struct kobject *kobj) in space_info_release() argument
456 struct btrfs_space_info *sinfo = to_space_info(kobj); in space_info_release()
473 static ssize_t btrfs_label_show(struct kobject *kobj, in btrfs_label_show() argument
476 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_show()
487 static ssize_t btrfs_label_store(struct kobject *kobj, in btrfs_label_store() argument
491 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_label_store()
524 static ssize_t btrfs_nodesize_show(struct kobject *kobj, in btrfs_nodesize_show() argument
527 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_nodesize_show()
534 static ssize_t btrfs_sectorsize_show(struct kobject *kobj, in btrfs_sectorsize_show() argument
537 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_sectorsize_show()
545 static ssize_t btrfs_clone_alignment_show(struct kobject *kobj, in btrfs_clone_alignment_show() argument
548 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_clone_alignment_show()
556 static ssize_t quota_override_show(struct kobject *kobj, in quota_override_show() argument
559 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_show()
566 static ssize_t quota_override_store(struct kobject *kobj, in quota_override_store() argument
570 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in quota_override_store()
596 static ssize_t btrfs_metadata_uuid_show(struct kobject *kobj, in btrfs_metadata_uuid_show() argument
599 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_metadata_uuid_show()
617 static void btrfs_release_fsid_kobj(struct kobject *kobj) in btrfs_release_fsid_kobj() argument
619 struct btrfs_fs_devices *fs_devs = to_fs_devs(kobj); in btrfs_release_fsid_kobj()
630 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj) in to_fs_devs() argument
632 if (kobj->ktype != &btrfs_ktype) in to_fs_devs()
634 return container_of(kobj, struct btrfs_fs_devices, fsid_kobj); in to_fs_devs()
637 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj) in to_fs_info() argument
639 if (kobj->ktype != &btrfs_ktype) in to_fs_info()
641 return to_fs_devs(kobj)->fs_info; in to_fs_info()
852 kobject_init(&rkobj->kobj, &btrfs_raid_ktype); in btrfs_sysfs_add_block_group_type()
853 ret = kobject_add(&rkobj->kobj, &space_info->kobj, "%s", in btrfs_sysfs_add_block_group_type()
857 kobject_put(&rkobj->kobj); in btrfs_sysfs_add_block_group_type()
863 space_info->block_group_kobjs[index] = &rkobj->kobj; in btrfs_sysfs_add_block_group_type()
875 struct kobject *kobj; in btrfs_sysfs_remove_space_info() local
877 kobj = space_info->block_group_kobjs[i]; in btrfs_sysfs_remove_space_info()
879 if (kobj) { in btrfs_sysfs_remove_space_info()
880 kobject_del(kobj); in btrfs_sysfs_remove_space_info()
881 kobject_put(kobj); in btrfs_sysfs_remove_space_info()
884 kobject_del(&space_info->kobj); in btrfs_sysfs_remove_space_info()
885 kobject_put(&space_info->kobj); in btrfs_sysfs_remove_space_info()
914 ret = kobject_init_and_add(&space_info->kobj, &space_info_ktype, in btrfs_sysfs_add_space_info_type()
918 kobject_put(&space_info->kobj); in btrfs_sysfs_add_space_info_type()
938 disk_kobj = &part_to_dev(disk)->kobj; in btrfs_sysfs_rm_device_link()
952 disk_kobj = &part_to_dev(disk)->kobj; in btrfs_sysfs_rm_device_link()
990 disk_kobj = &part_to_dev(disk)->kobj; in btrfs_sysfs_add_device_link()
1005 ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action); in btrfs_kobject_uevent()
1008 action, kobject_name(&disk_to_dev(bdev->bd_disk)->kobj), in btrfs_kobject_uevent()
1009 &disk_to_dev(bdev->bd_disk)->kobj); in btrfs_kobject_uevent()
1144 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
1147 ret = sysfs_merge_group(&btrfs_kset->kobj, in btrfs_init_sysfs()
1153 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group); in btrfs_init_sysfs()
1161 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_init_sysfs()
1170 sysfs_unmerge_group(&btrfs_kset->kobj, in btrfs_exit_sysfs()
1172 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); in btrfs_exit_sysfs()