All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: Anand Jain <anand.jain@oracle.com>
Subject: [PATCH 20/29] btrfs: btrfs_recover_relocation rename ret to ret2 and err to ret
Date: Tue, 19 Mar 2024 20:25:28 +0530	[thread overview]
Message-ID: <ebbe199d7e44b7a1c03605da163d27ed4e362c04.1710857863.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1710857863.git.anand.jain@oracle.com>

Fix the code style for the return variable. First, rename ret to ret2,
compile it, and then rename err to ret. This method of changing helped
confirm that there are no instances of the old ret not renamed to ret2.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/relocation.c | 64 +++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 6f8747c907d5..ab3d3d2ed853 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4260,8 +4260,8 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 	struct extent_buffer *leaf;
 	struct reloc_control *rc = NULL;
 	struct btrfs_trans_handle *trans;
-	int ret;
-	int err = 0;
+	int ret2;
+	int ret = 0;
 
 	path = btrfs_alloc_path();
 	if (!path)
@@ -4273,13 +4273,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 	key.offset = (u64)-1;
 
 	while (1) {
-		ret = btrfs_search_slot(NULL, fs_info->tree_root, &key,
+		ret2 = btrfs_search_slot(NULL, fs_info->tree_root, &key,
 					path, 0, 0);
-		if (ret < 0) {
-			err = ret;
+		if (ret2 < 0) {
+			ret = ret2;
 			goto out;
 		}
-		if (ret > 0) {
+		if (ret2 > 0) {
 			if (path->slots[0] == 0)
 				break;
 			path->slots[0]--;
@@ -4294,7 +4294,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 
 		reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key);
 		if (IS_ERR(reloc_root)) {
-			err = PTR_ERR(reloc_root);
+			ret = PTR_ERR(reloc_root);
 			goto out;
 		}
 
@@ -4305,14 +4305,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 			fs_root = btrfs_get_fs_root(fs_info,
 					reloc_root->root_key.offset, false);
 			if (IS_ERR(fs_root)) {
-				ret = PTR_ERR(fs_root);
-				if (ret != -ENOENT) {
-					err = ret;
+				ret2 = PTR_ERR(fs_root);
+				if (ret2 != -ENOENT) {
+					ret = ret2;
 					goto out;
 				}
-				ret = mark_garbage_root(reloc_root);
-				if (ret < 0) {
-					err = ret;
+				ret2 = mark_garbage_root(reloc_root);
+				if (ret2 < 0) {
+					ret = ret2;
 					goto out;
 				}
 			} else {
@@ -4332,13 +4332,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 
 	rc = alloc_reloc_control(fs_info);
 	if (!rc) {
-		err = -ENOMEM;
+		ret = -ENOMEM;
 		goto out;
 	}
 
-	ret = reloc_chunk_start(fs_info);
-	if (ret < 0) {
-		err = ret;
+	ret2 = reloc_chunk_start(fs_info);
+	if (ret2 < 0) {
+		ret = ret2;
 		goto out_end;
 	}
 
@@ -4348,7 +4348,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 
 	trans = btrfs_join_transaction(rc->extent_root);
 	if (IS_ERR(trans)) {
-		err = PTR_ERR(trans);
+		ret = PTR_ERR(trans);
 		goto out_unset;
 	}
 
@@ -4368,15 +4368,15 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 		fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
 					    false);
 		if (IS_ERR(fs_root)) {
-			err = PTR_ERR(fs_root);
+			ret = PTR_ERR(fs_root);
 			list_add_tail(&reloc_root->root_list, &reloc_roots);
 			btrfs_end_transaction(trans);
 			goto out_unset;
 		}
 
-		err = __add_reloc_root(reloc_root);
-		ASSERT(err != -EEXIST);
-		if (err) {
+		ret = __add_reloc_root(reloc_root);
+		ASSERT(ret != -EEXIST);
+		if (ret) {
 			list_add_tail(&reloc_root->root_list, &reloc_roots);
 			btrfs_put_root(fs_root);
 			btrfs_end_transaction(trans);
@@ -4386,8 +4386,8 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 		btrfs_put_root(fs_root);
 	}
 
-	err = btrfs_commit_transaction(trans);
-	if (err)
+	ret = btrfs_commit_transaction(trans);
+	if (ret)
 		goto out_unset;
 
 	merge_reloc_roots(rc);
@@ -4396,14 +4396,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 
 	trans = btrfs_join_transaction(rc->extent_root);
 	if (IS_ERR(trans)) {
-		err = PTR_ERR(trans);
+		ret = PTR_ERR(trans);
 		goto out_clean;
 	}
-	err = btrfs_commit_transaction(trans);
+	ret = btrfs_commit_transaction(trans);
 out_clean:
-	ret = clean_dirty_subvols(rc);
-	if (ret < 0 && !err)
-		err = ret;
+	ret2 = clean_dirty_subvols(rc);
+	if (ret2 < 0 && !ret)
+		ret = ret2;
 out_unset:
 	unset_reloc_control(rc);
 out_end:
@@ -4414,14 +4414,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 
 	btrfs_free_path(path);
 
-	if (err == 0) {
+	if (ret == 0) {
 		/* cleanup orphan inode in data relocation tree */
 		fs_root = btrfs_grab_root(fs_info->data_reloc_root);
 		ASSERT(fs_root);
-		err = btrfs_orphan_cleanup(fs_root);
+		ret = btrfs_orphan_cleanup(fs_root);
 		btrfs_put_root(fs_root);
 	}
-	return err;
+	return ret;
 }
 
 /*
-- 
2.38.1


  parent reply	other threads:[~2024-03-19 14:58 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 14:55 [PATCH 00/29] trivial adjustments for return variable coding style Anand Jain
2024-03-19 14:55 ` [PATCH 01/29] btrfs: btrfs_cleanup_fs_roots rename ret to ret2 and err to ret Anand Jain
2024-03-19 17:38   ` Josef Bacik
2024-03-19 20:43   ` Qu Wenruo
2024-04-17  3:24     ` Anand Jain
2024-04-17  3:59       ` Qu Wenruo
2024-03-20 21:17   ` Goffredo Baroncelli
2024-03-19 14:55 ` [PATCH 02/29] btrfs: btrfs_initxattrs rename " Anand Jain
2024-03-19 14:55 ` [PATCH 03/29] btrfs: send_extent_data " Anand Jain
2024-03-20 12:59   ` Filipe Manana
2024-03-19 14:55 ` [PATCH 04/29] btrfs: btrfs_rmdir " Anand Jain
2024-03-19 14:55 ` [PATCH 05/29] btrfs: btrfs_cont_expand " Anand Jain
2024-03-19 14:55 ` [PATCH 06/29] btrfs: btrfs_setsize rename err to ret2 Anand Jain
2024-03-19 14:55 ` [PATCH 07/29] btrfs: btrfs_find_orphan_roots rename ret to ret2 and err to ret Anand Jain
2024-03-19 17:44   ` Josef Bacik
2024-03-19 21:09   ` Qu Wenruo
2024-03-19 14:55 ` [PATCH 08/29] btrfs: btrfs_ioctl_snap_destroy rename " Anand Jain
2024-03-19 14:55 ` [PATCH 09/29] btrfs: __set_extent_bit " Anand Jain
2024-03-19 14:55 ` [PATCH 10/29] btrfs: convert_extent_bit " Anand Jain
2024-03-19 14:55 ` [PATCH 11/29] btrfs: __btrfs_end_transaction " Anand Jain
2024-03-19 14:55 ` [PATCH 12/29] btrfs: btrfs_write_marked_extents rename werr to ret err to ret2 Anand Jain
2024-03-19 17:53   ` Josef Bacik
2024-04-16  2:39     ` Anand Jain
2024-03-19 21:25   ` Qu Wenruo
2024-04-16  3:18     ` Anand Jain
2024-03-19 14:55 ` [PATCH 13/29] btrfs: __btrfs_wait_marked_extents " Anand Jain
2024-03-19 17:54   ` Josef Bacik
2024-03-19 23:47   ` Qu Wenruo
2024-03-19 14:55 ` [PATCH 14/29] btrfs: build_backref_tree rename err to ret and ret " Anand Jain
2024-03-19 17:57   ` Josef Bacik
2024-03-19 14:55 ` [PATCH 15/29] btrfs: relocate_tree_blocks rename ret to ret2 and err to ret Anand Jain
2024-03-19 17:58   ` Josef Bacik
2024-03-19 14:55 ` [PATCH 16/29] btrfs: relocate_block_group " Anand Jain
2024-03-19 14:55 ` [PATCH 17/29] btrfs: create_reloc_inode rename " Anand Jain
2024-03-19 14:55 ` [PATCH 18/29] btrfs: btrfs_relocate_block_group rename ret to ret2 and err ro ret Anand Jain
2024-03-19 18:04   ` Josef Bacik
2024-03-19 14:55 ` [PATCH 19/29] btrfs: mark_garbage_root rename err to ret2 Anand Jain
2024-03-19 18:07   ` Josef Bacik
2024-03-22  2:29     ` David Sterba
2024-03-19 14:55 ` Anand Jain [this message]
2024-03-19 14:55 ` [PATCH 21/29] btrfs: quick_update_accounting " Anand Jain
2024-03-19 18:10   ` Josef Bacik
2024-03-19 14:55 ` [PATCH 22/29] btrfs: btrfs_qgroup_rescan_worker rename ret to ret2 and err to ret Anand Jain
2024-03-19 14:55 ` [PATCH 23/29] btrfs: lookup_extent_data_ref " Anand Jain
2024-03-19 18:17   ` Josef Bacik
2024-04-18  6:55     ` Anand Jain
2024-03-19 14:55 ` [PATCH 24/29] btrfs: btrfs_drop_snapshot " Anand Jain
2024-03-19 18:20   ` Josef Bacik
2024-03-19 14:55 ` [PATCH 25/29] btrfs: btrfs_drop_subtree rename retw to ret2 Anand Jain
2024-03-19 18:22   ` Josef Bacik
2024-03-19 14:55 ` [PATCH 26/29] btrfs: btrfs_dirty_pages rename variable err to ret Anand Jain
2024-03-19 14:55 ` [PATCH 27/29] btrfs: prepare_pages rename " Anand Jain
2024-03-19 14:55 ` [PATCH 28/29] btrfs: btrfs_direct_write " Anand Jain
2024-03-19 14:55 ` [PATCH 29/29] btrfs: fixup_tree_root_location rename ret to ret2 and " Anand Jain
2024-03-19 18:24   ` Josef Bacik
2024-04-16 10:42     ` Anand Jain
2024-04-16 10:44       ` Anand Jain
2024-03-22  2:32 ` [PATCH 00/29] trivial adjustments for return variable coding style David Sterba
2024-03-25  9:37   ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebbe199d7e44b7a1c03605da163d27ed4e362c04.1710857863.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.