All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: <dsterba@suse.cz>
Subject: [PATCH 03/19] btrfs-progs: Refactor btrfs_next_bg and its callers to use btrfs_fs_info
Date: Tue, 13 Jun 2017 17:19:19 +0800	[thread overview]
Message-ID: <20170613091935.23277-4-quwenruo@cn.fujitsu.com> (raw)
In-Reply-To: <20170613091935.23277-1-quwenruo@cn.fujitsu.com>

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 find-root.c |  4 ++--
 volumes.c   |  5 +++--
 volumes.h   | 14 +++++++-------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/find-root.c b/find-root.c
index 1b41b217..1765adf8 100644
--- a/find-root.c
+++ b/find-root.c
@@ -118,11 +118,11 @@ int btrfs_find_root_search(struct btrfs_fs_info *fs_info,
 	fs_info->suppress_check_block_errors = 1;
 	while (1) {
 		if (filter->objectid != BTRFS_CHUNK_TREE_OBJECTID)
-			ret = btrfs_next_bg_metadata(&fs_info->mapping_tree,
+			ret = btrfs_next_bg_metadata(fs_info,
 						  &chunk_offset,
 						  &chunk_size);
 		else
-			ret = btrfs_next_bg_system(&fs_info->mapping_tree,
+			ret = btrfs_next_bg_system(fs_info,
 						&chunk_offset,
 						&chunk_size);
 		if (ret) {
diff --git a/volumes.c b/volumes.c
index 89e39e43..700def64 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1252,9 +1252,10 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len)
 	return ret;
 }
 
-int btrfs_next_bg(struct btrfs_mapping_tree *map_tree, u64 *logical,
-		     u64 *size, u64 type)
+int btrfs_next_bg(struct btrfs_fs_info *fs_info, u64 *logical,
+		  u64 *size, u64 type)
 {
+	struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
 	struct cache_extent *ce;
 	struct map_lookup *map;
 	u64 cur = *logical;
diff --git a/volumes.h b/volumes.h
index 26d88813..6f164e7f 100644
--- a/volumes.h
+++ b/volumes.h
@@ -187,18 +187,18 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
 		    u64 logical, u64 *length,
 		    struct btrfs_multi_bio **multi_ret, int mirror_num,
 		    u64 **raid_map_ret);
-int btrfs_next_bg(struct btrfs_mapping_tree *map_tree, u64 *logical,
+int btrfs_next_bg(struct btrfs_fs_info *map_tree, u64 *logical,
 		     u64 *size, u64 type);
-static inline int btrfs_next_bg_metadata(struct btrfs_mapping_tree *map_tree,
-				      u64 *logical, u64 *size)
+static inline int btrfs_next_bg_metadata(struct btrfs_fs_info *fs_info,
+					 u64 *logical, u64 *size)
 {
-	return btrfs_next_bg(map_tree, logical, size,
+	return btrfs_next_bg(fs_info, logical, size,
 			BTRFS_BLOCK_GROUP_METADATA);
 }
-static inline int btrfs_next_bg_system(struct btrfs_mapping_tree *map_tree,
-				    u64 *logical, u64 *size)
+static inline int btrfs_next_bg_system(struct btrfs_fs_info *fs_info,
+				       u64 *logical, u64 *size)
 {
-	return btrfs_next_bg(map_tree, logical, size,
+	return btrfs_next_bg(fs_info, logical, size,
 			BTRFS_BLOCK_GROUP_SYSTEM);
 }
 int btrfs_rmap_block(struct btrfs_fs_info *fs_info,
-- 
2.13.1




  parent reply	other threads:[~2017-06-13  9:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13  9:19 [PATCH 00/19] fs_info refactor part 2 (disk-io.h and volumes.h based) Qu Wenruo
2017-06-13  9:19 ` [PATCH 01/19] btrfs-progs: Refactor btrfs_map_block and its variants to use btrfs_fs_info Qu Wenruo
2017-06-13  9:19 ` [PATCH 02/19] btrfs-progs: Refactor btrfs_num_copies " Qu Wenruo
2017-06-13  9:19 ` Qu Wenruo [this message]
2017-06-13  9:19 ` [PATCH 04/19] btrfs-progs: Refactor csum_tree_block " Qu Wenruo
2017-06-13  9:19 ` [PATCH 05/19] btrfs-progs: Refactor write_and_map_eb " Qu Wenruo
2017-06-13  9:19 ` [PATCH 06/19] btrfs-progs: Refactor write_tree_block " Qu Wenruo
2017-06-13  9:19 ` [PATCH 07/19] btrfs-progs: btrfstune: Refactor change_devices_uuid " Qu Wenruo
2017-06-13  9:19 ` [PATCH 08/19] btrfs-progs: Refactor read_extent_data " Qu Wenruo
2017-06-13  9:19 ` [PATCH 09/19] btrfs-progs: Refactor btrfs_find_tree_block " Qu Wenruo
2017-06-13  9:19 ` [PATCH 10/19] btrfs-progs: Refactor btrfs_readahead_tree_block " Qu Wenruo
2017-06-13  9:19 ` [PATCH 11/19] btrfs-progs: Refactor write_all_supers and its callers " Qu Wenruo
2017-06-13  9:19 ` [PATCH 12/19] btrfs-progs: Refactor btrfs_check_chunk_valid " Qu Wenruo
2017-06-13  9:19 ` [PATCH 13/19] btrfs-progs: Refactor btrfs_find_device " Qu Wenruo
2017-06-13  9:19 ` [PATCH 14/19] btrfs-progs: Refactor btrfs_read_sys_array/chunk_tree " Qu Wenruo
2017-06-13  9:19 ` [PATCH 15/19] btrfs-progs: Refactor btrfs_add_system_chunk " Qu Wenruo
2017-06-13  9:19 ` [PATCH 16/19] btrfs-progs: Refactor btrfs_chunk_readonly " Qu Wenruo
2017-06-13  9:19 ` [PATCH 17/19] btrfs-progs: Refactor btrfs_add_device() " Qu Wenruo
2017-06-13  9:19 ` [PATCH 18/19] btrfs-progs: Remove btrfs_read_super_device as there is no implementation Qu Wenruo
2017-06-13  9:19 ` [PATCH 19/19] btrfs-progs: Refactor chunk creation functions to use btrfs_fs_info Qu Wenruo
2017-07-11  9:11 ` [PATCH 00/19] fs_info refactor part 2 (disk-io.h and volumes.h based) Qu Wenruo
2017-07-12 15:57   ` 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=20170613091935.23277-4-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.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 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.