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: [PATCH v2 02/11] btrfs-progs: cache csum_type in recover_control
Date: Mon, 26 Aug 2019 13:48:44 +0200	[thread overview]
Message-ID: <20190826114853.14860-3-jthumshirn@suse.de> (raw)
In-Reply-To: <20190826114853.14860-1-jthumshirn@suse.de>

Cache the super-block's checksum type field in 'struct recover_control'.
This will be needed for further refactoring the checksum handling.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
---
 cmds/rescue-chunk-recover.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmds/rescue-chunk-recover.c b/cmds/rescue-chunk-recover.c
index 608af9d49407..308731ea5ea6 100644
--- a/cmds/rescue-chunk-recover.c
+++ b/cmds/rescue-chunk-recover.c
@@ -47,6 +47,7 @@ struct recover_control {
 	int yes;
 
 	u16 csum_size;
+	u16 csum_type;
 	u32 sectorsize;
 	u32 nodesize;
 	u64 generation;
@@ -1530,6 +1531,7 @@ static int recover_prepare(struct recover_control *rc, const char *path)
 	rc->generation = btrfs_super_generation(sb);
 	rc->chunk_root_generation = btrfs_super_chunk_root_generation(sb);
 	rc->csum_size = btrfs_super_csum_size(sb);
+	rc->csum_type = btrfs_super_csum_type(sb);
 
 	/* if seed, the result of scanning below will be partial */
 	if (btrfs_super_flags(sb) & BTRFS_SUPER_FLAG_SEEDING) {
-- 
2.16.4


  parent reply	other threads:[~2019-08-26 11:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 11:48 [PATCH v2 00/11] btrfs-progs: support xxhash64 checksums Johannes Thumshirn
2019-08-26 11:48 ` [PATCH v2 01/11] btrfs-progs: don't blindly assume crc32c in csum_tree_block_size() Johannes Thumshirn
2019-08-27 16:33   ` David Sterba
2019-08-27 16:36     ` David Sterba
2019-08-28  7:48       ` Johannes Thumshirn
2019-08-26 11:48 ` Johannes Thumshirn [this message]
2019-08-26 11:48 ` [PATCH v2 03/11] btrfs-progs: add checksum type to checksumming functions Johannes Thumshirn
2019-08-27 12:51   ` Nikolay Borisov
2019-08-26 11:48 ` [PATCH v2 04/11] btrfs-progs: don't assume checksums are always 4 bytes Johannes Thumshirn
2019-08-27 12:52   ` Nikolay Borisov
2019-08-26 11:48 ` [PATCH v2 05/11] btrfs-progs: pass checksum type to btrfs_csum_data()/btrfs_csum_final() Johannes Thumshirn
2019-08-27 12:53   ` Nikolay Borisov
2019-08-26 11:48 ` [PATCH v2 06/11] btrfs-progs: simplify update_block_csum() in btrfs-sb-mod.c Johannes Thumshirn
2019-08-26 11:48 ` [PATCH v2 07/11] btrfs-progs: update checksumming api Johannes Thumshirn
2019-08-26 11:48 ` [PATCH v2 08/11] btrfs-progs: add option for checksum type to mkfs Johannes Thumshirn
2019-08-27 13:03   ` Nikolay Borisov
2019-08-26 11:48 ` [PATCH v2 09/11] btrfs-progs: add xxhash sources Johannes Thumshirn
2019-08-27 13:05   ` Nikolay Borisov
2019-08-27 16:20     ` David Sterba
2019-08-26 11:48 ` [PATCH v2 10/11] btrfs-progs: add xxhash64 as checksum algorithm Johannes Thumshirn
2019-08-27 14:16   ` Nikolay Borisov
2019-08-27 16:12     ` David Sterba
2019-08-30  9:33     ` Johannes Thumshirn
2019-08-26 11:48 ` [PATCH v2 11/11] btrfs-progs: add test-case for mkfs with xxhash64 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=20190826114853.14860-3-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.