Lines Matching defs:fs_info

28 bool btrfs_check_space_for_delayed_refs(struct btrfs_fs_info *fs_info)
30 struct btrfs_block_rsv *delayed_refs_rsv = &fs_info->delayed_refs_rsv;
31 struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv;
61 avg_runtime = trans->fs_info->avg_delayed_ref_runtime;
68 return btrfs_check_space_for_delayed_refs(trans->fs_info);
73 * @fs_info - the fs_info for our fs.
79 void btrfs_delayed_refs_rsv_release(struct btrfs_fs_info *fs_info, int nr)
81 struct btrfs_block_rsv *block_rsv = &fs_info->delayed_refs_rsv;
82 u64 num_bytes = btrfs_calc_insert_metadata_size(fs_info, nr);
85 released = btrfs_block_rsv_release(fs_info, block_rsv, num_bytes, NULL);
87 trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
100 struct btrfs_fs_info *fs_info = trans->fs_info;
101 struct btrfs_block_rsv *delayed_rsv = &fs_info->delayed_refs_rsv;
107 num_bytes = btrfs_calc_insert_metadata_size(fs_info,
118 * @fs_info - the fs info for our fs.
125 void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
129 struct btrfs_block_rsv *delayed_refs_rsv = &fs_info->delayed_refs_rsv;
157 trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
160 btrfs_space_info_free_bytes_may_use(fs_info,
166 * @fs_info - the fs_info for our fs.
172 int btrfs_delayed_refs_rsv_refill(struct btrfs_fs_info *fs_info,
175 struct btrfs_block_rsv *block_rsv = &fs_info->delayed_refs_rsv;
176 u64 limit = btrfs_calc_insert_metadata_size(fs_info, 1);
190 ret = btrfs_reserve_metadata_bytes(fs_info->extent_root, block_rsv,
195 trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
480 struct btrfs_fs_info *fs_info = trans->fs_info;
494 read_lock(&fs_info->tree_mod_log_lock);
495 if (!list_empty(&fs_info->tree_mod_seq_list)) {
498 elem = list_first_entry(&fs_info->tree_mod_seq_list,
502 read_unlock(&fs_info->tree_mod_log_lock);
515 int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, u64 seq)
520 read_lock(&fs_info->tree_mod_log_lock);
521 if (!list_empty(&fs_info->tree_mod_seq_list)) {
522 elem = list_first_entry(&fs_info->tree_mod_seq_list,
525 btrfs_debug(fs_info,
533 read_unlock(&fs_info->tree_mod_log_lock);
655 struct btrfs_fs_info *fs_info = trans->fs_info;
713 btrfs_csum_bytes_to_leaves(fs_info,
718 btrfs_delayed_refs_rsv_release(fs_info, csum_leaves);
740 btrfs_mod_total_bytes_pinned(fs_info, flags, existing->num_bytes);
742 btrfs_mod_total_bytes_pinned(fs_info, flags, -existing->num_bytes);
744 btrfs_mod_total_bytes_pinned(fs_info, flags, existing->num_bytes);
830 if (btrfs_qgroup_trace_extent_nolock(trans->fs_info,
837 trace_add_delayed_ref_head(trans->fs_info, head_ref, action);
855 btrfs_csum_bytes_to_leaves(trans->fs_info,
859 btrfs_mod_total_bytes_pinned(trans->fs_info, flags,
876 * @fs_info: Internal to the mounted filesystem mount structure.
897 static void init_delayed_ref_common(struct btrfs_fs_info *fs_info,
908 seq = atomic64_read(&fs_info->tree_mod_seq);
932 struct btrfs_fs_info *fs_info = trans->fs_info;
961 if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
978 init_delayed_ref_common(fs_info, &ref->node, bytenr, num_bytes,
1008 trace_add_delayed_tree_ref(fs_info, &ref->node, ref,
1015 btrfs_qgroup_trace_extent_post(fs_info, record);
1027 struct btrfs_fs_info *fs_info = trans->fs_info;
1052 init_delayed_ref_common(fs_info, &ref->node, bytenr, num_bytes,
1066 if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
1102 trace_add_delayed_data_ref(trans->fs_info, &ref->node, ref,
1110 return btrfs_qgroup_trace_extent_post(fs_info, record);