linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] btrfs-progs: move clear-cache.[ch] from check to common directory
Date: Mon,  9 Oct 2023 15:16:59 +1030	[thread overview]
Message-ID: <ea481febfdd13de99682e86ce6bc4c8a475cdead.1696826531.git.wqu@suse.com> (raw)
In-Reply-To: <cover.1696826531.git.wqu@suse.com>

The clear-cache functionality is not shared by several commands:

- btrfs check
  For --clear-cache and --clear-ino-cache.

- btrfstune
  Mostly for block-group-tree feature conversion.

- btrfs-convert
  To enable the now default v2 space cache.

Thus it's no longer proper to keep clea-cache.[ch] under check/
directory, move them to common/ directory.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 Makefile                        | 6 +++---
 check/main.c                    | 2 +-
 {check => common}/clear-cache.c | 2 +-
 {check => common}/clear-cache.h | 0
 convert/main.c                  | 2 +-
 tune/main.c                     | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
 rename {check => common}/clear-cache.c (99%)
 rename {check => common}/clear-cache.h (100%)

diff --git a/Makefile b/Makefile
index e5817f1456a2..345c8efc8249 100644
--- a/Makefile
+++ b/Makefile
@@ -242,7 +242,7 @@ cmds_objects = cmds/subvolume.o cmds/subvolume-list.o \
 	       cmds/inspect-dump-super.o cmds/inspect-tree-stats.o cmds/filesystem-du.o \
 	       cmds/reflink.o \
 	       mkfs/common.o check/mode-common.o check/mode-lowmem.o \
-	       check/clear-cache.o
+	       common/clear-cache.o
 
 libbtrfs_objects = \
 		kernel-lib/rbtree.o	\
@@ -262,12 +262,12 @@ libbtrfsutil_objects = libbtrfsutil/errors.o libbtrfsutil/filesystem.o \
 		       libbtrfsutil/stubs.o
 convert_objects = convert/main.o convert/common.o convert/source-fs.o \
 		  convert/source-ext2.o convert/source-reiserfs.o \
-		  mkfs/common.o check/clear-cache.o
+		  mkfs/common.o common/clear-cache.o
 mkfs_objects = mkfs/main.o mkfs/common.o mkfs/rootdir.o
 image_objects = image/main.o image/sanitize.o image/image-create.o image/common.o \
 		image/image-restore.o
 tune_objects = tune/main.o tune/seeding.o tune/change-uuid.o tune/change-metadata-uuid.o \
-	       tune/convert-bgt.o tune/change-csum.o check/clear-cache.o tune/quota.o
+	       tune/convert-bgt.o tune/change-csum.o common/clear-cache.o tune/quota.o
 all_objects = $(objects) $(cmds_objects) $(libbtrfs_objects) $(convert_objects) \
 	      $(mkfs_objects) $(image_objects) $(tune_objects) $(libbtrfsutil_objects)
 
diff --git a/check/main.c b/check/main.c
index be27ee5f2415..1174939fd6eb 100644
--- a/check/main.c
+++ b/check/main.c
@@ -58,6 +58,7 @@
 #include "common/help.h"
 #include "common/open-utils.h"
 #include "common/string-utils.h"
+#include "common/clear-cache.h"
 #include "cmds/commands.h"
 #include "mkfs/common.h"
 #include "check/common.h"
@@ -66,7 +67,6 @@
 #include "check/mode-original.h"
 #include "check/mode-lowmem.h"
 #include "check/qgroup-verify.h"
-#include "check/clear-cache.h"
 
 /* Global context variables */
 struct btrfs_fs_info *gfs_info;
diff --git a/check/clear-cache.c b/common/clear-cache.c
similarity index 99%
rename from check/clear-cache.c
rename to common/clear-cache.c
index d83d9b2fcda8..d57313b783c0 100644
--- a/check/clear-cache.c
+++ b/common/clear-cache.c
@@ -33,7 +33,7 @@
 #include "common/messages.h"
 #include "check/repair.h"
 #include "check/mode-common.h"
-#include "check/clear-cache.h"
+#include "common/clear-cache.h"
 
 /*
  * Number of free space cache inodes to delete in one transaction.
diff --git a/check/clear-cache.h b/common/clear-cache.h
similarity index 100%
rename from check/clear-cache.h
rename to common/clear-cache.h
diff --git a/convert/main.c b/convert/main.c
index 5d7c1e1d99d6..c9e50c036f92 100644
--- a/convert/main.c
+++ b/convert/main.c
@@ -119,9 +119,9 @@
 #include "common/box.h"
 #include "common/open-utils.h"
 #include "common/extent-tree-utils.h"
+#include "common/clear-cache.h"
 #include "cmds/commands.h"
 #include "check/repair.h"
-#include "check/clear-cache.h"
 #include "mkfs/common.h"
 #include "convert/common.h"
 #include "convert/source-fs.h"
diff --git a/tune/main.c b/tune/main.c
index 08dedce26cb5..4aef76748343 100644
--- a/tune/main.c
+++ b/tune/main.c
@@ -37,9 +37,9 @@
 #include "common/string-utils.h"
 #include "common/help.h"
 #include "common/box.h"
+#include "common/clear-cache.h"
 #include "cmds/commands.h"
 #include "tune/tune.h"
-#include "check/clear-cache.h"
 
 static char *device;
 static int force = 0;
-- 
2.42.0


  reply	other threads:[~2023-10-09  4:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09  4:46 [PATCH 0/2] btrfs-progs: move inode cache removal functionality to "btrfs rescue" group Qu Wenruo
2023-10-09  4:46 ` Qu Wenruo [this message]
2023-10-09  4:47 ` [PATCH 2/2] btrfs-progs: move inode cache removal to rescue group Qu Wenruo
2023-10-09 14:23   ` David Sterba
2023-10-09 20:50     ` Qu Wenruo
2023-10-09 22:47       ` David Sterba

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=ea481febfdd13de99682e86ce6bc4c8a475cdead.1696826531.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;
as well as URLs for NNTP newsgroup(s).