linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>,
	linux-btrfs@vger.kernel.org, Qu Wenruo <wqu@suse.com>
Subject: Re: [PATCH] btrfs-progs: remove BTRFS_CRC32_SIZE definition
Date: Mon, 26 Mar 2018 15:57:09 +0800	[thread overview]
Message-ID: <a90d3f5c-835d-d610-d819-9e33f4d3d874@gmx.com> (raw)
In-Reply-To: <e3a82fc6-2649-4d47-1893-9277130e6a1c@jp.fujitsu.com>


[-- Attachment #1.1: Type: text/plain, Size: 1828 bytes --]



On 2018年03月26日 08:54, Misono Tomohiro wrote:
> On 2018/03/23 18:14, Qu Wenruo wrote:
>>
>>
>> On 2018年03月23日 16:20, Misono Tomohiro wrote:
>>> The kernel code no longer has BTRFS_CRC32_SIZE and only uses
>>> btrfs_csum_sizes[]. So, update the progs code as well.
>>>
>>> Suggested-by: Qu Wenruo <wqu@suse.com>
>>> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
>>> ---
>>>  convert/common.c |  2 +-
>>>  convert/main.c   |  2 +-
>>>  ctree.h          |  3 +--
>>>  image/main.c     |  4 ++--
>>>  mkfs/common.c    | 14 +++++++-------
>>>  5 files changed, 12 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/convert/common.c b/convert/common.c
>>> index 3860f3b9..2b944fd8 100644
>>> --- a/convert/common.c
>>> +++ b/convert/common.c
>>> @@ -219,7 +219,7 @@ static inline int write_temp_extent_buffer(int fd, struct extent_buffer *buf,
>>>  {
>>>  	int ret;
>>>  
>>> -	csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0);
>>> +	csum_tree_block_size(buf, btrfs_csum_sizes[BTRFS_CSUM_TYPE_CRC32], 0);
>>
>> I'd say the normal kernel way to do this is like this, other than using
>> BTRFS_CSUM_TYPE_CRC32:
>> 	u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
>>
>> Thanks,
>> Qu
> 
> 
> Thanks, but we cannot access fs_info or struct btrfs_super_block here (and others in this diff).
> Should we pass the csum type parameter as an argument? Since currently the only
> supported type is crc32, I'm not sure if we should write the code so generic at this time.

Fair enough.

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-03-26  7:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23  8:20 [PATCH] btrfs-progs: remove BTRFS_CRC32_SIZE definition Misono Tomohiro
2018-03-23  9:14 ` Qu Wenruo
2018-03-26  0:54   ` Misono Tomohiro
2018-03-26  7:57     ` Qu Wenruo [this message]
2018-03-26 13:14       ` 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=a90d3f5c-835d-d610-d819-9e33f4d3d874@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=misono.tomohiro@jp.fujitsu.com \
    --cc=wqu@suse.com \
    /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).