linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Lyakas <alex.bolshoy.btrfs@gmail.com>
To: Alexander Block <ablock84@googlemail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Questions and notes about send/receive
Date: Wed, 1 Aug 2012 20:31:46 +0300	[thread overview]
Message-ID: <CAHf9xvYbECS5biGS9p8md9snLc1HxpLkpBqE1dUKxwzRxZOwng@mail.gmail.com> (raw)
In-Reply-To: <CAB9VWqC0NgYJNDkMAsfEQAmB8TkJdzQ3M=nHZCdiVHMhQAPRDQ@mail.gmail.com>

Alexander,
thanks for addressing the issues.

>> __get_cur_name_and_parent()
>> if we decided to call get_first_ref() on the send_root (due to ino <
>> sctx->send_progress), do we really need to call did_overwrite_ref()?
>> Because it will just lookup the send root again. I mean if we know
>> that this inode has been already handled, then it's not an orphan
>> anymore, so no need for this additional check. If my understanding is
>> wrong, pls give some small example?
> get_first_ref does not return the current state. It returns the
> permanent state. The result of did_overwrite_ref however depends on
> the current send progress. There is however some room for optimization
> here. In many cases, I did not think much about double tree lookups
> due to the different calls, as I wanted it to work first and later
> optimize it. One possible optimization for example would be to cache
> the results of lookups. But only for functions which return permanent
> state, e.g. get_inode_info.
So do you think my understanding is correct that if (ino <
sctx->send_progress), then both functions will return the same value?
Or perhaps: if (ino < sctx->send_progress), then no need to check
anymore the did_overwrite_ref(), because we have handled that already?
I think that the call to did_overwrite_ref() is relevant only as long
as we haven't handled this ino. After that, we are good...I think.

I'm not saying the code has be changed/optimized at this point, just
testing my understanding:)


>> struct btrfs_root_item:
>> what is the difference between existing "generation" field that you
>> mimic in generation_v2 and "ctransid"? (I know I need to study the
>> root tree code).
> Did you read the comments for btrfs_root_item and
> btrfs_read_root_item? They should answer your question.
Yes, I read the comments, but they address only "generation" and
"generation_v2", which I understand. Basically, I don't understand how
"generation" differs from ctransid (I need to dig more there).

Thanks!
Alex.



>>
>> Thank you,
>> Alex.
> Big thanks for your reviews :)
> I pushed a new version of the kernel and progs side. The branches are
> now "for-chris"

      reply	other threads:[~2012-08-01 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 16:32 Questions and notes about send/receive Alex Lyakas
2012-08-01 11:10 ` Alexander Block
2012-08-01 17:31   ` Alex Lyakas [this message]

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=CAHf9xvYbECS5biGS9p8md9snLc1HxpLkpBqE1dUKxwzRxZOwng@mail.gmail.com \
    --to=alex.bolshoy.btrfs@gmail.com \
    --cc=ablock84@googlemail.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 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).