diff options
Diffstat (limited to 'fs/btrfs/delayed-ref.c')
| -rw-r--r-- | fs/btrfs/delayed-ref.c | 13 | 
1 files changed, 6 insertions, 7 deletions
| diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index ca382c5b186f..481802efaa14 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -895,7 +895,7 @@ add_delayed_ref_head(struct btrfs_trans_handle *trans,  }  /* - * Initialize the structure which represents a modification to a an extent. + * Initialize the structure which represents a modification to an extent.   *   * @fs_info:    Internal to the mounted filesystem mount structure.   * @@ -952,7 +952,7 @@ static void init_delayed_ref_common(struct btrfs_fs_info *fs_info,  void btrfs_init_tree_ref(struct btrfs_ref *generic_ref, int level, u64 mod_root,  			 bool skip_qgroup)  { -#ifdef CONFIG_BTRFS_FS_REF_VERIFY +#ifdef CONFIG_BTRFS_DEBUG  	/* If @real_root not set, use @root as fallback */  	generic_ref->real_root = mod_root ?: generic_ref->ref_root;  #endif @@ -969,7 +969,7 @@ void btrfs_init_tree_ref(struct btrfs_ref *generic_ref, int level, u64 mod_root,  void btrfs_init_data_ref(struct btrfs_ref *generic_ref, u64 ino, u64 offset,  			 u64 mod_root, bool skip_qgroup)  { -#ifdef CONFIG_BTRFS_FS_REF_VERIFY +#ifdef CONFIG_BTRFS_DEBUG  	/* If @real_root not set, use @root as fallback */  	generic_ref->real_root = mod_root ?: generic_ref->ref_root;  #endif @@ -1251,7 +1251,6 @@ void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans)  {  	struct btrfs_delayed_ref_root *delayed_refs = &trans->delayed_refs;  	struct btrfs_fs_info *fs_info = trans->fs_info; -	bool testing = btrfs_is_testing(fs_info);  	spin_lock(&delayed_refs->lock);  	while (true) { @@ -1281,7 +1280,7 @@ void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans)  		spin_unlock(&delayed_refs->lock);  		mutex_unlock(&head->mutex); -		if (!testing && pin_bytes) { +		if (!btrfs_is_testing(fs_info) && pin_bytes) {  			struct btrfs_block_group *bg;  			bg = btrfs_lookup_block_group(fs_info, head->bytenr); @@ -1312,14 +1311,14 @@ void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans)  			btrfs_error_unpin_extent_range(fs_info, head->bytenr,  				head->bytenr + head->num_bytes - 1);  		} -		if (!testing) +		if (!btrfs_is_testing(fs_info))  			btrfs_cleanup_ref_head_accounting(fs_info, delayed_refs, head);  		btrfs_put_delayed_ref_head(head);  		cond_resched();  		spin_lock(&delayed_refs->lock);  	} -	if (!testing) +	if (!btrfs_is_testing(fs_info))  		btrfs_qgroup_destroy_extent_records(trans);  	spin_unlock(&delayed_refs->lock); | 
