public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/3] btrfs-progs: check: remove inode cache clearing functionality
Date: Mon,  4 Dec 2023 17:26:27 +1030	[thread overview]
Message-ID: <9ded4d71f4ab77ee4ed8d3ff31df839e85756def.1701672971.git.wqu@suse.com> (raw)
In-Reply-To: <cover.1701672971.git.wqu@suse.com>

Since we're already directing the end user to use "btrfs rescue
clear-ino-cache" command, there is not much need to support it in
btrfs-check.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 check/main.c                                        |  12 ++----------
 .../060-ino-cache-clean}/ino-cache-enabled.raw.xz   | Bin
 .../060-ino-cache-clean}/test.sh                    |   2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)
 rename tests/{fsck-tests/046-ino-cache-clean => misc-tests/060-ino-cache-clean}/ino-cache-enabled.raw.xz (100%)
 rename tests/{fsck-tests/046-ino-cache-clean => misc-tests/060-ino-cache-clean}/test.sh (97%)

diff --git a/check/main.c b/check/main.c
index 901a7ef5ebcb..30967fd426ca 100644
--- a/check/main.c
+++ b/check/main.c
@@ -9994,7 +9994,6 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
 	int init_csum_tree = 0;
 	int readonly = 0;
 	int clear_space_cache = 0;
-	int clear_ino_cache = 0;
 	int qgroup_report = 0;
 	int qgroups_repaired = 0;
 	int qgroup_verify_ret;
@@ -10118,8 +10117,8 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
 				ctree_flags |= OPEN_CTREE_WRITES;
 				break;
 			case GETOPT_VAL_CLEAR_INO_CACHE:
-				clear_ino_cache = 1;
-				ctree_flags |= OPEN_CTREE_WRITES;
+				error("--clear-ino-cache option is deprecated, please use \"btrfs rescue clear-ino-cache\" instead");
+				exit(1);
 				break;
 			case GETOPT_VAL_FORCE:
 				force = 1;
@@ -10240,13 +10239,6 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
 		goto close_out;
 	}
 
-	if (clear_ino_cache) {
-		warning("--clear-ino-cache option is deprecated, please use \"btrfs rescue clear-ino-cache\" instead");
-		ret = clear_ino_cache_items(gfs_info);
-		err = ret;
-		goto close_out;
-	}
-
 	/*
 	 * repair mode will force us to commit transaction which
 	 * will make us fail to load log tree when mounting.
diff --git a/tests/fsck-tests/046-ino-cache-clean/ino-cache-enabled.raw.xz b/tests/misc-tests/060-ino-cache-clean/ino-cache-enabled.raw.xz
similarity index 100%
rename from tests/fsck-tests/046-ino-cache-clean/ino-cache-enabled.raw.xz
rename to tests/misc-tests/060-ino-cache-clean/ino-cache-enabled.raw.xz
diff --git a/tests/fsck-tests/046-ino-cache-clean/test.sh b/tests/misc-tests/060-ino-cache-clean/test.sh
similarity index 97%
rename from tests/fsck-tests/046-ino-cache-clean/test.sh
rename to tests/misc-tests/060-ino-cache-clean/test.sh
index cfbadf251d30..10b75cc5f5b0 100755
--- a/tests/fsck-tests/046-ino-cache-clean/test.sh
+++ b/tests/misc-tests/060-ino-cache-clean/test.sh
@@ -9,7 +9,7 @@ setup_root_helper
 
 image=$(extract_image "./ino-cache-enabled.raw.xz")
 
-run_check "$TOP/btrfs" check --clear-ino-cache "$image"
+run_check "$TOP/btrfs" rescue clear-ino-cache "$image"
 run_check "$TOP/btrfs" check "$image"
 
 # Check for FREE_INO items for toplevel subvol
-- 
2.43.0


  reply	other threads:[~2023-12-04  6:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04  6:56 [PATCH 0/3] btrfs-progs: tune: run "btrfs check" before and after full fs conversion Qu Wenruo
2023-12-04  6:56 ` Qu Wenruo [this message]
2023-12-05 16:47   ` [PATCH 1/3] btrfs-progs: check: remove inode cache clearing functionality David Sterba
2023-12-04  6:56 ` [PATCH 2/3] btrfs-progs: check: export a dedicated btrfs_check() function Qu Wenruo
2023-12-04  6:56 ` [PATCH 3/3] btrfs-progs: tune: add fsck runs before and after a full conversion Qu Wenruo
2023-12-04  9:44   ` Su Yue
2023-12-04 10:11     ` l
2023-12-04 10:22       ` Qu Wenruo
2023-12-05 16:46         ` David Sterba
2023-12-05 21:33           ` Qu Wenruo

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=9ded4d71f4ab77ee4ed8d3ff31df839e85756def.1701672971.git.wqu@suse.com \
    --to=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox