All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: David Sterba <dsterba@suse.com>
Cc: Linux BTRFS Mailinglist <linux-btrfs@vger.kernel.org>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [RFC PATCH 09/17] progs: pass in a btrfs_mkfs_config to write_temp_extent_buffer
Date: Thu, 25 Jul 2019 11:33:56 +0200	[thread overview]
Message-ID: <042f116c565320bc134a6bca5b5d91b0754a19a8.1564046972.git.jthumshirn@suse.de> (raw)
In-Reply-To: <cover.1564046812.git.jthumshirn@suse.de>
In-Reply-To: <cover.1564046812.git.jthumshirn@suse.de>

Pass in a btrfs_mkfs_config to write_temp_extent_buffer(), this is needed
so we can grab the checksum type for checksum buffer verification in later
patches.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 convert/common.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/convert/common.c b/convert/common.c
index af4f8d372299..dea5f5b20d50 100644
--- a/convert/common.c
+++ b/convert/common.c
@@ -218,7 +218,8 @@ static void insert_temp_root_item(struct extent_buffer *buf,
  * Setup an extent buffer for tree block.
  */
 static inline int write_temp_extent_buffer(int fd, struct extent_buffer *buf,
-					   u64 bytenr)
+					   u64 bytenr,
+					   struct btrfs_mkfs_config *cfg)
 {
 	int ret;
 
@@ -281,7 +282,7 @@ static int setup_temp_root_tree(int fd, struct btrfs_mkfs_config *cfg,
 	insert_temp_root_item(buf, cfg, &slot, &itemoff,
 			      BTRFS_CSUM_TREE_OBJECTID, csum_bytenr);
 
-	ret = write_temp_extent_buffer(fd, buf, root_bytenr);
+	ret = write_temp_extent_buffer(fd, buf, root_bytenr, cfg);
 out:
 	free(buf);
 	return ret;
@@ -456,7 +457,7 @@ static int setup_temp_chunk_tree(int fd, struct btrfs_mkfs_config *cfg,
 				     BTRFS_BLOCK_GROUP_METADATA);
 	if (ret < 0)
 		goto out;
-	ret = write_temp_extent_buffer(fd, buf, chunk_bytenr);
+	ret = write_temp_extent_buffer(fd, buf, chunk_bytenr, cfg);
 
 out:
 	free(buf);
@@ -515,7 +516,7 @@ static int setup_temp_dev_tree(int fd, struct btrfs_mkfs_config *cfg,
 			       BTRFS_MKFS_SYSTEM_GROUP_SIZE);
 	insert_temp_dev_extent(buf, &slot, &itemoff, meta_chunk_start,
 			       BTRFS_CONVERT_META_GROUP_SIZE);
-	ret = write_temp_extent_buffer(fd, buf, dev_bytenr);
+	ret = write_temp_extent_buffer(fd, buf, dev_bytenr, cfg);
 out:
 	free(buf);
 	return ret;
@@ -537,7 +538,7 @@ static int setup_temp_fs_tree(int fd, struct btrfs_mkfs_config *cfg,
 	/*
 	 * Temporary fs tree is completely empty.
 	 */
-	ret = write_temp_extent_buffer(fd, buf, fs_bytenr);
+	ret = write_temp_extent_buffer(fd, buf, fs_bytenr, cfg);
 out:
 	free(buf);
 	return ret;
@@ -559,7 +560,7 @@ static int setup_temp_csum_tree(int fd, struct btrfs_mkfs_config *cfg,
 	/*
 	 * Temporary csum tree is completely empty.
 	 */
-	ret = write_temp_extent_buffer(fd, buf, csum_bytenr);
+	ret = write_temp_extent_buffer(fd, buf, csum_bytenr, cfg);
 out:
 	free(buf);
 	return ret;
@@ -765,7 +766,7 @@ static int setup_temp_extent_tree(int fd, struct btrfs_mkfs_config *cfg,
 	if (ret < 0)
 		goto out;
 
-	ret = write_temp_extent_buffer(fd, buf, extent_bytenr);
+	ret = write_temp_extent_buffer(fd, buf, extent_bytenr, cfg);
 out:
 	free(buf);
 	return ret;
-- 
2.16.4


  parent reply	other threads:[~2019-07-25  9:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  9:33 [RFC PATCH 0/4] Support xxhash64 checksums Johannes Thumshirn
2019-07-25  9:33 ` [RFC PATCH 1/4] btrfs: turn checksum type define into a union Johannes Thumshirn
2019-07-25 11:08   ` Mike Fleetwood
2019-07-25 11:21     ` Johannes Thumshirn
2019-07-25  9:33 ` [RFC PATCH 2/4] btrfs: create structure to encode checksum type and length Johannes Thumshirn
2019-07-26  3:09   ` Su Yue
2019-07-30 17:25   ` David Sterba
2019-08-12  9:07   ` Nikolay Borisov
2019-08-19  9:15     ` Johannes Thumshirn
2019-07-25  9:33 ` [RFC PATCH 3/4] btrfs: use xxhash64 for checksumming Johannes Thumshirn
2019-07-25 12:02   ` Qu Wenruo
2019-07-25 14:18     ` Johannes Thumshirn
2019-07-26 13:45       ` David Sterba
2019-07-25  9:33 ` [RFC PATCH 4/4] btrfs: sysfs: export supported checksums Johannes Thumshirn
2019-07-30 17:19   ` David Sterba
2019-07-31  8:06     ` Johannes Thumshirn
2019-08-07 14:10     ` Johannes Thumshirn
2019-08-21 16:19       ` David Sterba
2019-08-12  9:19   ` Nikolay Borisov
2019-08-19  9:15     ` Johannes Thumshirn
2019-07-25  9:33 ` [RFC PATCH 05/17] btrfs-progs: add option for checksum type to mkfs Johannes Thumshirn
2019-07-30 17:36   ` David Sterba
2019-08-12  9:30   ` Nikolay Borisov
2019-07-25  9:33 ` [RFC PATCH 06/17] btrfs-progs: don't blindly assume crc32c in csum_tree_block_size() Johannes Thumshirn
2019-08-12  9:49   ` Nikolay Borisov
2019-07-25  9:33 ` [RFC PATCH 07/17] btrfs-progs: use btrfs_csum_data() in __csum_tree_block_size() Johannes Thumshirn
2019-07-30 17:37   ` David Sterba
2019-07-25  9:33 ` [RFC PATCH 08/17] btrfs-progs: cache csum_type in recover_control Johannes Thumshirn
2019-08-12  9:52   ` Nikolay Borisov
2019-07-25  9:33 ` Johannes Thumshirn [this message]
2019-07-30 17:38   ` [RFC PATCH 09/17] progs: pass in a btrfs_mkfs_config to write_temp_extent_buffer David Sterba
2019-08-12  9:56   ` Nikolay Borisov
2019-07-25  9:33 ` [RFC PATCH 10/17] btrfs-progs: add checksum type to checksumming functions Johannes Thumshirn
2019-08-12 10:21   ` Nikolay Borisov
2019-08-26  9:34     ` Johannes Thumshirn
2019-07-25  9:33 ` [RFC PATCH 11/17] btrfs-progs: don't assume checksums are always 4 bytes Johannes Thumshirn
2019-07-25  9:33 ` [RFC PATCH 12/17] btrfs-progs: pass checksum type to btrfs_csum_data() Johannes Thumshirn
2019-08-12 10:51   ` Nikolay Borisov
2019-08-20  9:12     ` Johannes Thumshirn
2019-07-25  9:34 ` [RFC PATCH 13/17] " Johannes Thumshirn
2019-07-25  9:34 ` [RFC PATCH 14/17] btrfs-progs: simplify update_block_csum() in btrfs-sb-mod.c Johannes Thumshirn
2019-08-12 10:53   ` Nikolay Borisov
2019-07-25  9:34 ` [RFC PATCH 15/17] btrfs-progs: update checksumming api Johannes Thumshirn
2019-07-25  9:34 ` [RFC PATCH 16/17] btrfs-progs: add xxhash sources Johannes Thumshirn
2019-07-25  9:34 ` [RFC PATCH 17/17] btrfs-progs: add xxhash64 as checksum algorithm Johannes Thumshirn

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=042f116c565320bc134a6bca5b5d91b0754a19a8.1564046972.git.jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=dsterba@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 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.