linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Lyakas <alex.btrfs@zadarastorage.com>
To: Mohit Bhadade <mohitbhadade@gmail.com>
Cc: nafisa mandliwala <nafisa.mandliwala@gmail.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: Snapper snapshot comparison algorithm
Date: Sun, 9 Dec 2012 11:14:13 +0200	[thread overview]
Message-ID: <CAOcd+r2fS-=dCU-v8ZLUNGrS3ojfhLXYAtBek-JGvvOJLOar3Q@mail.gmail.com> (raw)
In-Reply-To: <CANTVtNqzGmK2fb3EEXtjAanNBGxBCN2T44wnMw9xLTYSyPV3vA@mail.gmail.com>

Mohit, Nafisa,
you should start reading from "changed_cb" function, which is the one
that notifies the send code about a particular change that needs to be
addressed.

The lowest-level instruction generation happens in functions like
"send_rename", "send_link", "send_unlink", "send_truncate" etc.

The best way to understand what is in between, is to stuff the code
with printk's and see what is happening (do a small change to the
file, observe the prints). This is how I learned:)

For starter, for example, create some file, do send, then grow the
file and see how the send code detects and reacts to this change. The
trickiest part is handling the changes in file name/hardlinks. So try
to rename the file and see what the code does.

You may also read through discussions with Alexander Block on the
list, on the link that I posted and others.

Alex.


On Thu, Dec 6, 2012 at 11:16 AM, Mohit Bhadade <mohitbhadade@gmail.com> wrote:
> Hello,
> Could oomeone please tell me how the instruction generation based on
> differences in snapshots takes place in the send receive code. ? I am going
> through the code but cant understand the hierarchy of structures declared in
> it. Some one please direct me to the function where the instructions are
> generated.
>
> Thanks
>
>
> On Sat, Dec 1, 2012 at 2:00 PM, Alex Lyakas <alex.btrfs@zadarastorage.com>
> wrote:
>>
>> Hi nafisa,
>> in order to understand how btrfs send code compares two btrfs file
>> trees, you may read this:
>> http://www.spinics.net/lists/linux-btrfs/msg17731.html (where I am
>> trying to understand it) and further down the thread. It's a very nice
>> algorithm, actually.
>>
>> Thanks,
>> Alex.
>>
>>
>>
>> On Sat, Dec 1, 2012 at 9:54 AM, nafisa mandliwala
>> <nafisa.mandliwala@gmail.com> wrote:
>> > I needed help with understanding the snapshot comparison algorithm
>> > that snapper uses and its shortcomings. From reading the code, what I
>> > understood is that it does a block by block compare. I'm not very sure
>> > if that's the best way to go about it. Also, since the send receive
>> > code is still in development stages, is there a scope to add more
>> > functionality to it?
>> > --
>> > 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
>> --
>> 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
>
>

  parent reply	other threads:[~2012-12-09  9:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-01  7:54 Snapper snapshot comparison algorithm nafisa mandliwala
2012-12-01 19:00 ` Alex Lyakas
     [not found]   ` <CANTVtNqzGmK2fb3EEXtjAanNBGxBCN2T44wnMw9xLTYSyPV3vA@mail.gmail.com>
2012-12-09  9:14     ` Alex Lyakas [this message]
     [not found]       ` <CANTVtNqB_C+srL9DsL2b7QC1rUT4m5-6RHR6CqQbajQm2NCy0w@mail.gmail.com>
2012-12-17  9:05         ` Alex Lyakas
     [not found]           ` <CAFhuFEeV-NpkGTdV+yh0K3vWj-1ntQNSkwtg1r=SyZ04dSkHaA@mail.gmail.com>
     [not found]             ` <CAFhuFEc9YRhP1aN_1-JG7VRfC0_pNA2nwK7-nzR6kj7bbNoX4g@mail.gmail.com>
     [not found]               ` <CAFhuFEc==AeTi8cjHHCZDiP-xN6XLJDJmW4pVtnhr2rcWVEoag@mail.gmail.com>
2012-12-31  9:21                 ` Alex Lyakas
2012-12-31 19:02                   ` Alex Lyakas
     [not found]                 ` <CAFhuFEeWGQML_qp-B1f6DSnDMaSaRyKCkDPDULaxWgdsBC1GzA@mail.gmail.com>
2012-12-31  9:36                   ` Alex Lyakas
2012-12-03 11:35 ` Snapper snapshot comparison algorithm - send/receive questions Arvin Schnell
2012-12-09  9:00   ` Alex Lyakas

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='CAOcd+r2fS-=dCU-v8ZLUNGrS3ojfhLXYAtBek-JGvvOJLOar3Q@mail.gmail.com' \
    --to=alex.btrfs@zadarastorage.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mohitbhadade@gmail.com \
    --cc=nafisa.mandliwala@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).