Lines Matching refs:bg

1384 static int btrfs_load_block_group_single(struct btrfs_block_group *bg,  in btrfs_load_block_group_single()  argument
1389 btrfs_err(bg->fs_info, in btrfs_load_block_group_single()
1395 bg->alloc_offset = info->alloc_offset; in btrfs_load_block_group_single()
1396 bg->zone_capacity = info->capacity; in btrfs_load_block_group_single()
1398 set_bit(BLOCK_GROUP_FLAG_ZONE_IS_ACTIVE, &bg->runtime_flags); in btrfs_load_block_group_single()
1402 static int btrfs_load_block_group_dup(struct btrfs_block_group *bg, in btrfs_load_block_group_dup() argument
1408 btrfs_err(bg->fs_info, in btrfs_load_block_group_dup()
1414 btrfs_err(bg->fs_info, in btrfs_load_block_group_dup()
1420 btrfs_err(bg->fs_info, in btrfs_load_block_group_dup()
1426 btrfs_err(bg->fs_info, in btrfs_load_block_group_dup()
1432 if (!btrfs_zone_activate(bg)) in btrfs_load_block_group_dup()
1435 set_bit(BLOCK_GROUP_FLAG_ZONE_IS_ACTIVE, &bg->runtime_flags); in btrfs_load_block_group_dup()
1438 bg->alloc_offset = zone_info[0].alloc_offset; in btrfs_load_block_group_dup()
1439 bg->zone_capacity = min(zone_info[0].capacity, zone_info[1].capacity); in btrfs_load_block_group_dup()
2285 struct btrfs_block_group *bg = in btrfs_zone_finish_endio_workfn() local
2288 wait_on_extent_buffer_writeback(bg->last_eb); in btrfs_zone_finish_endio_workfn()
2289 free_extent_buffer(bg->last_eb); in btrfs_zone_finish_endio_workfn()
2290 btrfs_zone_finish_endio(bg->fs_info, bg->start, bg->length); in btrfs_zone_finish_endio_workfn()
2291 btrfs_put_block_group(bg); in btrfs_zone_finish_endio_workfn()
2294 void btrfs_schedule_zone_finish_bg(struct btrfs_block_group *bg, in btrfs_schedule_zone_finish_bg() argument
2297 if (!test_bit(BLOCK_GROUP_FLAG_SEQUENTIAL_ZONE, &bg->runtime_flags) || in btrfs_schedule_zone_finish_bg()
2298 eb->start + eb->len * 2 <= bg->start + bg->zone_capacity) in btrfs_schedule_zone_finish_bg()
2301 if (WARN_ON(bg->zone_finish_work.func == btrfs_zone_finish_endio_workfn)) { in btrfs_schedule_zone_finish_bg()
2302 btrfs_err(bg->fs_info, "double scheduling of bg %llu zone finishing", in btrfs_schedule_zone_finish_bg()
2303 bg->start); in btrfs_schedule_zone_finish_bg()
2308 btrfs_get_block_group(bg); in btrfs_schedule_zone_finish_bg()
2310 bg->last_eb = eb; in btrfs_schedule_zone_finish_bg()
2311 INIT_WORK(&bg->zone_finish_work, btrfs_zone_finish_endio_workfn); in btrfs_schedule_zone_finish_bg()
2312 queue_work(system_unbound_wq, &bg->zone_finish_work); in btrfs_schedule_zone_finish_bg()
2315 void btrfs_clear_data_reloc_bg(struct btrfs_block_group *bg) in btrfs_clear_data_reloc_bg() argument
2317 struct btrfs_fs_info *fs_info = bg->fs_info; in btrfs_clear_data_reloc_bg()
2320 if (fs_info->data_reloc_bg == bg->start) in btrfs_clear_data_reloc_bg()
2446 struct btrfs_block_group *bg; in btrfs_zoned_activate_one_bg() local
2458 list_for_each_entry(bg, &space_info->block_groups[index], in btrfs_zoned_activate_one_bg()
2460 if (!spin_trylock(&bg->lock)) in btrfs_zoned_activate_one_bg()
2462 if (btrfs_zoned_bg_is_full(bg) || in btrfs_zoned_activate_one_bg()
2464 &bg->runtime_flags)) { in btrfs_zoned_activate_one_bg()
2465 spin_unlock(&bg->lock); in btrfs_zoned_activate_one_bg()
2468 spin_unlock(&bg->lock); in btrfs_zoned_activate_one_bg()
2470 if (btrfs_zone_activate(bg)) { in btrfs_zoned_activate_one_bg()