Home
last modified time | relevance | path

Searched refs:block_group (Results 1 – 25 of 36) sorted by relevance

12

/linux/fs/btrfs/
H A Ddiscard.c71 const struct btrfs_block_group *block_group) in get_discard_list() argument
73 return &discard_ctl->discard_list[block_group->discard_index]; in get_discard_list()
94 struct btrfs_block_group *block_group) in __add_to_discard_list() argument
100 if (list_empty(&block_group->discard_list) || in __add_to_discard_list()
101 block_group->discard_index == BTRFS_DISCARD_INDEX_UNUSED) { in __add_to_discard_list()
102 if (block_group->discard_index == BTRFS_DISCARD_INDEX_UNUSED) in __add_to_discard_list()
103 block_group->discard_index = BTRFS_DISCARD_INDEX_START; in __add_to_discard_list()
104 block_group->discard_eligible_time = (ktime_get_ns() + in __add_to_discard_list()
106 block_group->discard_state = BTRFS_DISCARD_RESET_CURSOR; in __add_to_discard_list()
108 if (list_empty(&block_group->discard_list)) in __add_to_discard_list()
[all …]
H A Dfree-space-tree.c21 struct btrfs_block_group *block_group,
25 struct btrfs_block_group *block_group) in btrfs_free_space_root() argument
33 if (btrfs_fs_incompat(block_group->fs_info, EXTENT_TREE_V2)) in btrfs_free_space_root()
34 key.offset = block_group->global_root_id; in btrfs_free_space_root()
35 return btrfs_global_root(block_group->fs_info, &key); in btrfs_free_space_root()
70 struct btrfs_block_group *block_group, in add_new_free_space_info() argument
73 struct btrfs_root *root = btrfs_free_space_root(block_group); in add_new_free_space_info()
79 key.objectid = block_group->start; in add_new_free_space_info()
81 key.offset = block_group->length; in add_new_free_space_info()
103 struct btrfs_block_group *block_group, in search_free_space_info() argument
[all …]
H A Dfree-space-cache.c132 struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group, in lookup_free_space_inode() argument
135 struct btrfs_fs_info *fs_info = block_group->fs_info; in lookup_free_space_inode()
139 spin_lock(&block_group->lock); in lookup_free_space_inode()
140 if (block_group->inode) in lookup_free_space_inode()
141 inode = igrab(&block_group->inode->vfs_inode); in lookup_free_space_inode()
142 spin_unlock(&block_group->lock); in lookup_free_space_inode()
147 block_group->start); in lookup_free_space_inode()
151 spin_lock(&block_group->lock); in lookup_free_space_inode()
156 block_group->disk_cache_state = BTRFS_DC_CLEAR; in lookup_free_space_inode()
159 if (!test_and_set_bit(BLOCK_GROUP_FLAG_IREF, &block_group->runtime_flags)) in lookup_free_space_inode()
[all …]
H A Dblock-group.c26 int btrfs_should_fragment_free_space(const struct btrfs_block_group *block_group) in btrfs_should_fragment_free_space() argument
28 struct btrfs_fs_info *fs_info = block_group->fs_info; in btrfs_should_fragment_free_space()
31 block_group->flags & BTRFS_BLOCK_GROUP_METADATA) || in btrfs_should_fragment_free_space()
33 block_group->flags & BTRFS_BLOCK_GROUP_DATA); in btrfs_should_fragment_free_space()
180 struct btrfs_block_group *block_group) in btrfs_add_block_group_cache() argument
187 ASSERT(block_group->length != 0); in btrfs_add_block_group_cache()
195 if (block_group->start < cache->start) { in btrfs_add_block_group_cache()
197 } else if (block_group->start > cache->start) { in btrfs_add_block_group_cache()
206 rb_link_node(&block_group->cache_node, parent, p); in btrfs_add_block_group_cache()
207 rb_insert_color_cached(&block_group->cache_node, in btrfs_add_block_group_cache()
[all …]
H A Dfree-space-cache.h89 struct btrfs_block_group *block_group; member
114 struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group,
117 struct btrfs_block_group *block_group,
121 struct btrfs_block_group *block_group);
124 struct btrfs_block_group *block_group,
126 int load_free_space_cache(struct btrfs_block_group *block_group);
128 struct btrfs_block_group *block_group,
131 struct btrfs_block_group *block_group,
134 void btrfs_init_free_space_ctl(struct btrfs_block_group *block_group,
136 int btrfs_add_free_space(struct btrfs_block_group *block_group,
[all …]
H A Dzoned.c66 static void wait_eb_writebacks(struct btrfs_block_group *block_group);
67 static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_written);
1873 struct btrfs_block_group *block_group = ctx->zoned_bg; in check_bg_is_active() local
1874 struct btrfs_fs_info *fs_info = block_group->fs_info; in check_bg_is_active()
1876 if (test_bit(BLOCK_GROUP_FLAG_ZONE_IS_ACTIVE, &block_group->runtime_flags)) in check_bg_is_active()
1879 if (fs_info->treelog_bg == block_group->start) { in check_bg_is_active()
1880 if (!btrfs_zone_activate(block_group)) { in check_bg_is_active()
1883 if (ret_fin != 1 || !btrfs_zone_activate(block_group)) in check_bg_is_active()
1886 } else if (*active_bg != block_group) { in check_bg_is_active()
1913 if (!btrfs_zone_activate(block_group)) in check_bg_is_active()
[all …]
H A Dfree-space-tree.h25 void set_free_space_tree_thresholds(struct btrfs_block_group *block_group);
31 struct btrfs_block_group *block_group);
33 struct btrfs_block_group *block_group);
42 struct btrfs_block_group *block_group,
45 struct btrfs_block_group *block_group,
48 struct btrfs_block_group *block_group,
51 struct btrfs_block_group *block_group,
54 struct btrfs_block_group *block_group,
56 int free_space_test_bit(struct btrfs_block_group *block_group,
H A Dblock-group.h107 struct btrfs_block_group *block_group; member
269 static inline u64 btrfs_block_group_end(const struct btrfs_block_group *block_group) in btrfs_block_group_end() argument
271 return (block_group->start + block_group->length); in btrfs_block_group_end()
281 static inline bool btrfs_is_block_group_data_only(const struct btrfs_block_group *block_group) in btrfs_is_block_group_data_only() argument
287 return (block_group->flags & BTRFS_BLOCK_GROUP_DATA) && in btrfs_is_block_group_data_only()
288 !(block_group->flags & BTRFS_BLOCK_GROUP_METADATA); in btrfs_is_block_group_data_only()
292 int btrfs_should_fragment_free_space(const struct btrfs_block_group *block_group);
315 int btrfs_add_new_free_space(struct btrfs_block_group *block_group,
H A Ddiscard.h18 void btrfs_discard_check_filter(struct btrfs_block_group *block_group, u64 bytes);
22 struct btrfs_block_group *block_group);
24 struct btrfs_block_group *block_group);
30 void btrfs_discard_update_discardable(struct btrfs_block_group *block_group);
H A Dextent-tree.c2638 struct btrfs_block_group *block_group; in __exclude_logged_extent() local
2640 block_group = btrfs_lookup_block_group(fs_info, start); in __exclude_logged_extent()
2641 if (!block_group) in __exclude_logged_extent()
2644 ret = btrfs_cache_block_group(block_group, true); in __exclude_logged_extent()
2648 ret = btrfs_remove_free_space(block_group, start, num_bytes); in __exclude_logged_extent()
2650 btrfs_put_block_group(block_group); in __exclude_logged_extent()
2824 struct btrfs_block_group *block_group, *tmp; in btrfs_finish_extent_commit() local
2866 list_for_each_entry_safe(block_group, tmp, deleted_bgs, bg_list) { in btrfs_finish_extent_commit()
2872 block_group->start, in btrfs_finish_extent_commit()
2873 block_group->length, in btrfs_finish_extent_commit()
[all …]
H A Dspace-info.c304 struct btrfs_block_group *block_group) in btrfs_add_bg_to_space_info() argument
309 factor = btrfs_bg_type_to_factor(block_group->flags); in btrfs_add_bg_to_space_info()
311 found = btrfs_find_space_info(info, block_group->flags); in btrfs_add_bg_to_space_info()
314 found->total_bytes += block_group->length; in btrfs_add_bg_to_space_info()
315 found->disk_total += block_group->length * factor; in btrfs_add_bg_to_space_info()
316 found->bytes_used += block_group->used; in btrfs_add_bg_to_space_info()
317 found->disk_used += block_group->used * factor; in btrfs_add_bg_to_space_info()
318 found->bytes_readonly += block_group->bytes_super; in btrfs_add_bg_to_space_info()
319 btrfs_space_info_update_bytes_zone_unusable(info, found, block_group->zone_unusable); in btrfs_add_bg_to_space_info()
320 if (block_group->length > 0) in btrfs_add_bg_to_space_info()
[all …]
H A Drelocation.c137 struct btrfs_block_group *block_group; member
178 in_range(node->bytenr, rc->block_group->start, in mark_block_processed()
179 rc->block_group->length)) { in mark_block_processed()
980 if (!in_range(bytenr, rc->block_group->start, in replace_file_extents()
981 rc->block_group->length)) in replace_file_extents()
1248 rc->block_group, parent, slot, in replace_path()
2902 const bool use_rst = btrfs_need_stripe_tree_update(fs_info, rc->block_group->flags); in relocate_one_folio()
3216 btrfs_err(rc->block_group->fs_info, in add_tree_block()
3320 struct btrfs_block_group *block_group, in delete_block_group_cache() argument
3347 ret = btrfs_truncate_free_space_cache(trans, block_group, inode); in delete_block_group_cache()
[all …]
H A Dzoned.h83 bool btrfs_zone_activate(struct btrfs_block_group *block_group);
84 int btrfs_zone_finish(struct btrfs_block_group *block_group);
219 static inline bool btrfs_zone_activate(struct btrfs_block_group *block_group) in btrfs_zone_activate() argument
224 static inline int btrfs_zone_finish(struct btrfs_block_group *block_group) in btrfs_zone_finish() argument
H A Dspace-info.h256 struct btrfs_block_group *block_group);
H A Dfs.h343 struct btrfs_block_group *block_group; member
368 struct btrfs_block_group *block_group; member
/linux/fs/ext4/
H A Dialloc.c81 ext4_group_t block_group, in ext4_validate_inode_bitmap() argument
93 grp = ext4_get_group_info(sb, block_group); in ext4_validate_inode_bitmap()
97 ext4_lock_group(sb, block_group); in ext4_validate_inode_bitmap()
103 ext4_unlock_group(sb, block_group); in ext4_validate_inode_bitmap()
105 "inode_bitmap = %llu", block_group, blk); in ext4_validate_inode_bitmap()
106 ext4_mark_group_bitmap_corrupted(sb, block_group, in ext4_validate_inode_bitmap()
112 ext4_unlock_group(sb, block_group); in ext4_validate_inode_bitmap()
123 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) in ext4_read_inode_bitmap() argument
131 desc = ext4_get_group_desc(sb, block_group, NULL); in ext4_read_inode_bitmap()
139 "block_group %u", bitmap_blk, block_group); in ext4_read_inode_bitmap()
[all …]
H A Dmballoc-test.c291 ext4_read_block_bitmap_nowait_stub(struct super_block *sb, ext4_group_t block_group, in ext4_read_block_bitmap_nowait_stub() argument
294 struct mbt_grp_ctx *grp_ctx = MBT_GRP_CTX(sb, block_group); in ext4_read_block_bitmap_nowait_stub()
302 ext4_group_t block_group, in ext4_wait_block_bitmap_stub() argument
316 ext4_get_group_desc_stub(struct super_block *sb, ext4_group_t block_group, in ext4_get_group_desc_stub() argument
319 struct mbt_grp_ctx *grp_ctx = MBT_GRP_CTX(sb, block_group); in ext4_get_group_desc_stub()
H A Dmballoc.c3849 ext4_group_t block_group, ext4_grpblk_t cluster, int count) in ext4_issue_discard() argument
3854 ext4_group_first_block_no(sb, block_group)); in ext4_issue_discard()
6409 ext4_group_t block_group; in ext4_mb_clear_bb() local
6430 ext4_get_group_no_and_offset(sb, block, &block_group, &bit); in ext4_mb_clear_bb()
6432 grp = ext4_get_group_info(sb, block_group); in ext4_mb_clear_bb()
6448 trace_ext4_mballoc_free(sb, inode, block_group, bit, count_clusters); in ext4_mb_clear_bb()
6451 err = ext4_mb_load_buddy_gfp(sb, block_group, &e4b, in ext4_mb_clear_bb()
6467 err = ext4_mb_mark_context(handle, sb, false, block_group, bit, in ext4_mb_clear_bb()
6495 new_entry->efd_group = block_group; in ext4_mb_clear_bb()
6499 ext4_lock_group(sb, block_group); in ext4_mb_clear_bb()
[all …]
H A Dext4.h2526 ext4_group_t block_group; member
2726 ext4_group_t block_group,
2733 ext4_group_t block_group,
2736 ext4_group_t block_group,
2739 ext4_group_t block_group);
2741 ext4_group_t block_group,
3114 ext4_group_t block_group,
3117 ext4_group_t block_group);
3363 ext4_group_t block_group) in ext4_flex_group() argument
3365 return block_group >> sbi->s_log_groups_per_flex; in ext4_flex_group()
/linux/fs/ext2/
H A Dballoc.c40 unsigned int block_group, in ext2_get_group_desc() argument
48 if (block_group >= sbi->s_groups_count) { in ext2_get_group_desc()
51 block_group, sbi->s_groups_count); in ext2_get_group_desc()
56 group_desc = block_group >> EXT2_DESC_PER_BLOCK_BITS(sb); in ext2_get_group_desc()
57 offset = block_group & (EXT2_DESC_PER_BLOCK(sb) - 1); in ext2_get_group_desc()
61 block_group, group_desc, offset); in ext2_get_group_desc()
73 unsigned int block_group, in ext2_valid_block_bitmap() argument
82 group_first_block = ext2_group_first_block_no(sb, block_group); in ext2_valid_block_bitmap()
83 max_bit = ext2_group_last_block_no(sb, block_group) - group_first_block; in ext2_valid_block_bitmap()
118 block_group, bitmap_blk); in ext2_valid_block_bitmap()
[all …]
H A Dialloc.c47 read_inode_bitmap(struct super_block * sb, unsigned long block_group) in read_inode_bitmap() argument
52 desc = ext2_get_group_desc(sb, block_group, NULL); in read_inode_bitmap()
61 block_group, le32_to_cpu(desc->bg_inode_bitmap)); in read_inode_bitmap()
111 unsigned long block_group; in ext2_free_inode() local
135 block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb); in ext2_free_inode()
137 bitmap_bh = read_inode_bitmap(sb, block_group); in ext2_free_inode()
142 if (!ext2_clear_bit_atomic(sb_bgl_lock(EXT2_SB(sb), block_group), in ext2_free_inode()
147 ext2_release_inode(sb, block_group, is_directory); in ext2_free_inode()
169 unsigned long block_group; in ext2_preread_inode() local
174 block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb); in ext2_preread_inode()
[all …]
H A Dext2.h122 sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) in sb_bgl_lock() argument
124 return bgl_lock_ptr(sbi->s_blockgroup_lock, block_group); in sb_bgl_lock()
712 unsigned int block_group,
/linux/include/trace/events/
H A Dbtrfs.h813 const struct btrfs_block_group *block_group, int create),
815 TP_ARGS(fs_info, block_group, create),
827 __entry->offset = block_group->start;
828 __entry->size = block_group->length;
829 __entry->flags = block_group->flags;
830 __entry->bytes_used = block_group->used;
831 __entry->bytes_super = block_group->bytes_super;
1304 const struct btrfs_block_group *block_group),
1306 TP_ARGS(root, ffe_ctl, block_group),
1326 __entry->bg_start = block_group->start;
[all …]
/linux/include/linux/
H A Dblockgroup_lock.h36 bgl_lock_ptr(struct blockgroup_lock *bgl, unsigned int block_group) in bgl_lock_ptr() argument
38 return &bgl->locks[block_group & (NR_BG_LOCKS-1)].lock; in bgl_lock_ptr()
/linux/fs/nilfs2/
H A Dmdt.h110 nilfs_mdt_bgl_lock(struct inode *inode, unsigned int block_group) in nilfs_mdt_bgl_lock() argument
112 return bgl_lock_ptr(NILFS_MDT(inode)->mi_bgl, block_group); in nilfs_mdt_bgl_lock()

12