From: Calvin Walton <calvin.walton@kepstin.ca>
To: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>,
Austin S Hemmelgarn <ahferroin7@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs: obtain block checksums from user space
Date: Mon, 28 Sep 2015 19:11:51 -0400 [thread overview]
Message-ID: <1443481911.12614.4.camel@kepstin.ca> (raw)
In-Reply-To: <CAJs94EbJV+VX16dnkFqH21OMV=uLYSCKnG9KNUCrs7B=rULYLg@mail.gmail.com>
On Thu, 2015-09-24 at 21:48 +0300, Matwey V. Kornilov wrote:
> 2015-09-24 21:35 GMT+03:00 Austin S Hemmelgarn <ahferroin7@gmail.com>
> :
> > On 2015-09-24 14:06, Matwey V. Kornilov wrote:
> > It's worth noting that the way btrfs does checksums isn't per-file,
> > it's
> > per-block. This means that:
[...]
> > All in all, this means that if you just want a checksum of the
> > contents of
> > the file, it's almost certainly better to just do it in userspace.
> > If you're trying to figure out what changed, using send/receive and
> > snapshots is more efficient (usually).
>
> I want the checksums of the every block of the file to see which part
> has been changed.
> I cannot use send/receive because my other file replica is on the
> remote host but not on the same filesystem. Compare with how rsync
> works. It calculates checksums of the chunks of both versions of the
> file and then syncs different chunks over the network. I just want to
> utilize the fact that btrfs already has the data I need to calculate.
The problem with trying to use btrfs checksums to compare two different
files is that the blocks might not match up, if only due to
fragmentation. E.g., the same 1gb file might be stored like this on one
machine:
[ 256MB ][ 512 MB ][ 256MB ]
And like this on the other:
[ 512MB ][ 512MB ]
Since the checksums are per block, and the blocks can be different
arrangements on different machines, they're not really all that useful
for doing comparisons like you want.
--
Calvin Walton <calvin.walton@kepstin.ca>
next prev parent reply other threads:[~2015-09-28 23:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 18:06 btrfs: obtain block checksums from user space Matwey V. Kornilov
2015-09-24 18:35 ` Austin S Hemmelgarn
2015-09-24 18:48 ` Matwey V. Kornilov
2015-09-24 19:47 ` Austin S Hemmelgarn
2015-09-28 23:11 ` Calvin Walton [this message]
2015-09-28 23:16 ` Hugo Mills
2015-09-28 23:25 ` Calvin Walton
2015-10-01 16:59 ` 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=1443481911.12614.4.camel@kepstin.ca \
--to=calvin.walton@kepstin.ca \
--cc=ahferroin7@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=matwey.kornilov@gmail.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).