Lines Matching refs:space_info
727 BTRFS_ATTR(space_info, field, btrfs_space_info_show_##field)
748 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_chunk_size_store() local
763 if (space_info->flags & BTRFS_BLOCK_GROUP_SYSTEM) in btrfs_chunk_size_store()
784 btrfs_update_space_info_chunk_size(space_info, val); in btrfs_chunk_size_store()
836 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_force_chunk_alloc_store() local
862 ret = btrfs_force_chunk_alloc(trans, space_info->flags); in btrfs_force_chunk_alloc_store()
870 BTRFS_ATTR_W(space_info, force_chunk_alloc, btrfs_force_chunk_alloc_store);
884 BTRFS_ATTR_RW(space_info, chunk_size, btrfs_chunk_size_show, btrfs_chunk_size_store);
885 BTRFS_ATTR(space_info, size_classes, btrfs_size_classes_show);
891 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_bg_reclaim_threshold_show() local
893 return sysfs_emit(buf, "%d\n", READ_ONCE(space_info->bg_reclaim_threshold)); in btrfs_sinfo_bg_reclaim_threshold_show()
900 struct btrfs_space_info *space_info = to_space_info(kobj); in btrfs_sinfo_bg_reclaim_threshold_store() local
911 WRITE_ONCE(space_info->bg_reclaim_threshold, thresh); in btrfs_sinfo_bg_reclaim_threshold_store()
916 BTRFS_ATTR_RW(space_info, bg_reclaim_threshold,
926 BTRFS_ATTR_PTR(space_info, flags),
927 BTRFS_ATTR_PTR(space_info, total_bytes),
928 BTRFS_ATTR_PTR(space_info, bytes_used),
929 BTRFS_ATTR_PTR(space_info, bytes_pinned),
930 BTRFS_ATTR_PTR(space_info, bytes_reserved),
931 BTRFS_ATTR_PTR(space_info, bytes_may_use),
932 BTRFS_ATTR_PTR(space_info, bytes_readonly),
933 BTRFS_ATTR_PTR(space_info, bytes_zone_unusable),
934 BTRFS_ATTR_PTR(space_info, disk_used),
935 BTRFS_ATTR_PTR(space_info, disk_total),
936 BTRFS_ATTR_PTR(space_info, bg_reclaim_threshold),
937 BTRFS_ATTR_PTR(space_info, chunk_size),
938 BTRFS_ATTR_PTR(space_info, size_classes),
940 BTRFS_ATTR_PTR(space_info, force_chunk_alloc),
944 ATTRIBUTE_GROUPS(space_info);
1563 struct btrfs_space_info *space_info = cache->space_info; in btrfs_sysfs_add_block_group_type() local
1598 spin_lock(&space_info->lock); in btrfs_sysfs_add_block_group_type()
1599 if (space_info->block_group_kobjs[index]) { in btrfs_sysfs_add_block_group_type()
1600 spin_unlock(&space_info->lock); in btrfs_sysfs_add_block_group_type()
1604 space_info->block_group_kobjs[index] = &rkobj->kobj; in btrfs_sysfs_add_block_group_type()
1606 spin_unlock(&space_info->lock); in btrfs_sysfs_add_block_group_type()
1608 ret = kobject_add(&rkobj->kobj, &space_info->kobj, "%s", in btrfs_sysfs_add_block_group_type()
1612 spin_lock(&space_info->lock); in btrfs_sysfs_add_block_group_type()
1613 space_info->block_group_kobjs[index] = NULL; in btrfs_sysfs_add_block_group_type()
1614 spin_unlock(&space_info->lock); in btrfs_sysfs_add_block_group_type()
1626 void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info) in btrfs_sysfs_remove_space_info() argument
1633 kobj = space_info->block_group_kobjs[i]; in btrfs_sysfs_remove_space_info()
1634 space_info->block_group_kobjs[i] = NULL; 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()
1666 struct btrfs_space_info *space_info) in btrfs_sysfs_add_space_info_type() argument
1670 ret = kobject_init_and_add(&space_info->kobj, &space_info_ktype, in btrfs_sysfs_add_space_info_type()
1672 alloc_name(space_info->flags)); in btrfs_sysfs_add_space_info_type()
1674 kobject_put(&space_info->kobj); in btrfs_sysfs_add_space_info_type()