* RFC: Btrfs does not store checksum type? Only size? O_o
@ 2017-09-20 20:31 Timofey Titovets
2017-09-20 20:45 ` Hans van Kranenburg
2017-09-20 23:27 ` Qu Wenruo
0 siblings, 2 replies; 3+ messages in thread
From: Timofey Titovets @ 2017-09-20 20:31 UTC (permalink / raw)
To: linux-btrfs
I was reading the kernel code and docs and didn't find anything about
some info like "cheksum type" as btrfs have for compression code.
(I only found some silent "hack" in btrfs-progs, that print "checksum
type", but get "checksum size")
If i understood all correctly btrfs only store checksum size, i.e. 4
for current CRC32C.
May be that can be useful to rewrite some part of code and reuse
checksum size, as checksum type.
For backward compatibility current CRC32C size can be used for identify CRC32C.
As that will not add any new checksum, that allow make that with zero "blood".
And later if we add new checksum type, that possible to add compat
flag for that.
What you think?
Thanks.
--
Have a nice day,
Timofey.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: Btrfs does not store checksum type? Only size? O_o
2017-09-20 20:31 RFC: Btrfs does not store checksum type? Only size? O_o Timofey Titovets
@ 2017-09-20 20:45 ` Hans van Kranenburg
2017-09-20 23:27 ` Qu Wenruo
1 sibling, 0 replies; 3+ messages in thread
From: Hans van Kranenburg @ 2017-09-20 20:45 UTC (permalink / raw)
To: Timofey Titovets, linux-btrfs
On 09/20/2017 10:31 PM, Timofey Titovets wrote:
> I was reading the kernel code and docs and didn't find anything about
> some info like "cheksum type" as btrfs have for compression code.
> (I only found some silent "hack" in btrfs-progs, that print "checksum
> type", but get "checksum size")
>
> If i understood all correctly btrfs only store checksum size, i.e. 4
> for current CRC32C.
The checksum type is set in the superblock:
csum_type 0 (crc32c)
csum_size 4
[...]
So in the current design, you probably could have different checksum
types, but you will have to choose one of them when creating a filesystem.
--
Hans van Kranenburg
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: Btrfs does not store checksum type? Only size? O_o
2017-09-20 20:31 RFC: Btrfs does not store checksum type? Only size? O_o Timofey Titovets
2017-09-20 20:45 ` Hans van Kranenburg
@ 2017-09-20 23:27 ` Qu Wenruo
1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2017-09-20 23:27 UTC (permalink / raw)
To: Timofey Titovets, linux-btrfs
On 2017年09月21日 04:31, Timofey Titovets wrote:
> I was reading the kernel code and docs and didn't find anything about
> some info like "cheksum type" as btrfs have for compression code.
> (I only found some silent "hack" in btrfs-progs, that print "checksum
> type", but get "checksum size")
Checksum type is global, so one btrfs fs uses the same checksum type for
all its meta and data.
So checksum type is in superblock. Check btrfs_super_block->csum_type.
>
> If i understood all correctly btrfs only store checksum size, i.e. 4
> for current CRC32C.
Yes.
>
> May be that can be useful to rewrite some part of code and reuse
> checksum size, as checksum type.
>
> For backward compatibility current CRC32C size can be used for identify CRC32C.
Since we have superblock csum type, why introducing new one?
(Unless you're going to allow multi csum algorithm to co-exist in one
btrfs fs)
Thanks,
Qu
> As that will not add any new checksum, that allow make that with zero "blood".
> And later if we add new checksum type, that possible to add compat
> flag for that.
>
> What you think?
>
> Thanks.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-20 23:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-20 20:31 RFC: Btrfs does not store checksum type? Only size? O_o Timofey Titovets
2017-09-20 20:45 ` Hans van Kranenburg
2017-09-20 23:27 ` Qu Wenruo
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).