From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 14/16] btrfs-progs: check: Move reset_cached_block_groups to check/common.c
Date: Fri, 19 Jan 2018 13:37:29 +0800 [thread overview]
Message-ID: <20180119053731.10795-15-wqu@suse.com> (raw)
In-Reply-To: <20180119053731.10795-1-wqu@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
check/common.c | 25 +++++++++++++++++++++++++
check/common.h | 1 +
check/main.c | 27 ---------------------------
3 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/check/common.c b/check/common.c
index 4cdc46b0ba7c..d6abf6d6733c 100644
--- a/check/common.c
+++ b/check/common.c
@@ -324,3 +324,28 @@ int check_child_node(struct extent_buffer *parent, int slot,
}
return ret;
}
+
+void reset_cached_block_groups(struct btrfs_fs_info *fs_info)
+{
+ struct btrfs_block_group_cache *cache;
+ u64 start, end;
+ int ret;
+
+ while (1) {
+ ret = find_first_extent_bit(&fs_info->free_space_cache, 0,
+ &start, &end, EXTENT_DIRTY);
+ if (ret)
+ break;
+ clear_extent_dirty(&fs_info->free_space_cache, start, end);
+ }
+
+ start = 0;
+ while (1) {
+ cache = btrfs_lookup_first_block_group(fs_info, start);
+ if (!cache)
+ break;
+ if (cache->cached)
+ cache->cached = 0;
+ start = cache->key.objectid + cache->key.offset;
+ }
+}
diff --git a/check/common.h b/check/common.h
index d200a0c90e38..09745af4932f 100644
--- a/check/common.h
+++ b/check/common.h
@@ -95,5 +95,6 @@ void reada_walk_down(struct btrfs_root *root, struct extent_buffer *node,
int slot);
int check_child_node(struct extent_buffer *parent, int slot,
struct extent_buffer *child);
+void reset_cached_block_groups(struct btrfs_fs_info *fs_info);
#endif
diff --git a/check/main.c b/check/main.c
index af4e54857fbf..3c556db90c30 100644
--- a/check/main.c
+++ b/check/main.c
@@ -412,8 +412,6 @@ static void free_file_extent_holes(struct rb_root *holes)
}
}
-static void reset_cached_block_groups(struct btrfs_fs_info *fs_info);
-
static void record_root_in_trans(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
{
@@ -10196,31 +10194,6 @@ static int prune_corrupt_blocks(struct btrfs_fs_info *info)
return 0;
}
-static void reset_cached_block_groups(struct btrfs_fs_info *fs_info)
-{
- struct btrfs_block_group_cache *cache;
- u64 start, end;
- int ret;
-
- while (1) {
- ret = find_first_extent_bit(&fs_info->free_space_cache, 0,
- &start, &end, EXTENT_DIRTY);
- if (ret)
- break;
- clear_extent_dirty(&fs_info->free_space_cache, start, end);
- }
-
- start = 0;
- while (1) {
- cache = btrfs_lookup_first_block_group(fs_info, start);
- if (!cache)
- break;
- if (cache->cached)
- cache->cached = 0;
- start = cache->key.objectid + cache->key.offset;
- }
-}
-
static int check_extent_refs(struct btrfs_root *root,
struct cache_tree *extent_cache)
{
--
2.15.1
next prev parent reply other threads:[~2018-01-19 5:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 5:37 [PATCH 00/16] btrfs-progs: Split lowmem mode check to its own Qu Wenruo
2018-01-19 5:37 ` [PATCH 01/16] btrfs-progs: Moves cmds-check.c to check/main.c Qu Wenruo
2018-01-19 5:37 ` [PATCH 02/16] btrfs-progs: check: Move original mode definitions to check/original.h Qu Wenruo
2018-01-19 5:37 ` [PATCH 03/16] btrfs-progs: check: Move definitions of lowmem mode to check/lowmem.h Qu Wenruo
2018-01-19 5:37 ` [PATCH 04/16] btrfs-progs: check: Move node_ptr structure to check/common.h Qu Wenruo
2018-01-19 5:52 ` Su Yue
2018-01-19 5:53 ` Qu Wenruo
2018-01-19 5:37 ` [PATCH 05/16] btrfs-progs: check: Export check global variables " Qu Wenruo
2018-01-19 6:55 ` Su Yue
2018-01-19 7:26 ` Qu Wenruo
2018-01-19 5:37 ` [PATCH 06/16] btrfs-progs: check: Move imode_to_type function " Qu Wenruo
2018-01-19 5:37 ` [PATCH 07/16] btrfs-progs: check: Move fs_root_objectid " Qu Wenruo
2018-01-19 5:37 ` [PATCH 08/16] btrfs-progs: check: Move count_csum_range function to check/common.c Qu Wenruo
2018-01-19 6:46 ` Su Yue
2018-01-19 5:37 ` [PATCH 09/16] btrfs-progs: check: Move __create_inode_item " Qu Wenruo
2018-01-19 5:37 ` [PATCH 10/16] btrfs-progs: check: Move link_inode_to_lostfound function to common.c Qu Wenruo
2018-01-19 5:37 ` [PATCH 11/16] btrfs-progs: check: Move check_dev_size_alignment to check/common.c Qu Wenruo
2018-01-19 5:37 ` [PATCH 12/16] btrfs-progs: check: move reada_walk_down " Qu Wenruo
2018-01-19 5:37 ` [PATCH 13/16] btrfs-progs: check: Move check_child_node " Qu Wenruo
2018-01-19 5:37 ` Qu Wenruo [this message]
2018-01-19 5:37 ` [PATCH 16/16] btrfs-progs: check/lowmem: Cleanup unnecessary _v2 suffix Qu Wenruo
2018-01-19 7:50 ` [PATCH 00/16] btrfs-progs: Split lowmem mode check to its own Su Yue
2018-01-31 18:26 ` David Sterba
2018-02-01 5:00 ` 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=20180119053731.10795-15-wqu@suse.com \
--to=wqu@suse.com \
--cc=dsterba@suse.cz \
--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).