Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4553fef authored by Anand Jain's avatar Anand Jain Committed by David Sterba
Browse files

Btrfs: consolidate btrfs_error() to btrfs_std_error()



btrfs_error() and btrfs_std_error() does the same thing
and calls _btrfs_std_error(), so consolidate them together.
And the main motivation is that btrfs_error() is closely
named with btrfs_err(), one handles error action the other
is to log the error, so don't closely name them.

Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Suggested-by: default avatarDavid Sterba <dsterba@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 57d816a1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1011,7 +1011,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
			return ret;
		if (refs == 0) {
			ret = -EROFS;
			btrfs_std_error(root->fs_info, ret);
			btrfs_std_error(root->fs_info, ret, NULL);
			return ret;
		}
	} else {
@@ -1927,7 +1927,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
		child = read_node_slot(root, mid, 0);
		if (!child) {
			ret = -EROFS;
			btrfs_std_error(root->fs_info, ret);
			btrfs_std_error(root->fs_info, ret, NULL);
			goto enospc;
		}

@@ -2030,7 +2030,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
		 */
		if (!left) {
			ret = -EROFS;
			btrfs_std_error(root->fs_info, ret);
			btrfs_std_error(root->fs_info, ret, NULL);
			goto enospc;
		}
		wret = balance_node_right(trans, root, mid, left);
+1 −8
Original line number Diff line number Diff line
@@ -4127,14 +4127,7 @@ do { \
				  __LINE__, (errno));		\
} while (0)

#define btrfs_std_error(fs_info, errno)				\
do {								\
	if ((errno))						\
		__btrfs_std_error((fs_info), __func__,		\
				   __LINE__, (errno), NULL);	\
} while (0)

#define btrfs_error(fs_info, errno, fmt, args...)		\
#define btrfs_std_error(fs_info, errno, fmt, args...)		\
do {								\
	__btrfs_std_error((fs_info), __func__, __LINE__,	\
			  (errno), fmt, ##args);		\
+4 −4
Original line number Diff line number Diff line
@@ -2377,7 +2377,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
	/* returns with log_tree_root freed on success */
	ret = btrfs_recover_log_trees(log_tree_root);
	if (ret) {
		btrfs_error(tree_root->fs_info, ret,
		btrfs_std_error(tree_root->fs_info, ret,
			    "Failed to recover log tree");
		free_extent_buffer(log_tree_root->node);
		kfree(log_tree_root);
@@ -3556,7 +3556,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
		if (ret) {
			mutex_unlock(
				&root->fs_info->fs_devices->device_list_mutex);
			btrfs_error(root->fs_info, ret,
			btrfs_std_error(root->fs_info, ret,
				    "errors while submitting device barriers.");
			return ret;
		}
@@ -3596,7 +3596,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
		mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);

		/* FUA is masked off if unsupported and can't be the reason */
		btrfs_error(root->fs_info, -EIO,
		btrfs_std_error(root->fs_info, -EIO,
			    "%d errors while writing supers", total_errors);
		return -EIO;
	}
@@ -3614,7 +3614,7 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
	}
	mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
	if (total_errors > max_errors) {
		btrfs_error(root->fs_info, -EIO,
		btrfs_std_error(root->fs_info, -EIO,
			    "%d errors while writing supers", total_errors);
		return -EIO;
	}
+1 −1
Original line number Diff line number Diff line
@@ -8688,7 +8688,7 @@ out:
	if (!for_reloc && root_dropped == false)
		btrfs_add_dead_root(root);
	if (err && err != -EAGAIN)
		btrfs_std_error(root->fs_info, err);
		btrfs_std_error(root->fs_info, err, NULL);
	return err;
}

+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
	 */
	if (!btrfs_find_name_in_ext_backref(path, ref_objectid,
					    name, name_len, &extref)) {
		btrfs_std_error(root->fs_info, -ENOENT);
		btrfs_std_error(root->fs_info, -ENOENT, NULL);
		ret = -EROFS;
		goto out;
	}
Loading