All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Jonathan Brassow <jbrassow@redhat.com>
Cc: dm-devel@redhat.com, Mikulas Patocka <mpatocka@redhat.com>
Subject: Re: [PATCH 2/4] dm-snapshot-refactor-associations
Date: Thu, 8 Oct 2009 13:32:18 -0400	[thread overview]
Message-ID: <20091008173217.GA11142@redhat.com> (raw)
In-Reply-To: <20091007182433.GB29197@redhat.com>

On Wed, Oct 07 2009 at  2:24pm -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Wed, Oct 07 2009 at  1:38pm -0400,
> Jonathan Brassow <jbrassow@redhat.com> wrote:
> 
> > If this is really something that we have to do, then fine.  However, it 
> > appears that you are doing this to pull out 'ti' and 'cow'... things that 
> > are separate by structure from the underlying exception store... which is 
> > ultimately what you want to hand over.  It seems to me that there is 
> > probably a better/cleaner way to do this, while simultaneously leaving 
> > 'ti' and 'cow' in their current place.
> 
> Yes, both 'ti' and 'cow' are seperate structures within the exception store.
> Yes, we want to handover the exception store itself (but keeping 'ti' and
> 'cow' fixed).
> 
> So you're saying have the handover be:
> 1) swap the 'complete' exception_table
> 2) swap the 'cow' and 'ti' in the 2 exception stores
> 3) swap the exception stores
> 
> Something like the following?:
> 
> static void handover_exceptions(struct dm_snapshot *old,
>                                 struct dm_snapshot *new)
> {
>         union {
>                 struct exception_table table_swap;
>                 struct dm_target *ti_swap;
>                 struct dm_dev *cow_swap;
>                 struct dm_exception_store *store_swap;
>         } u;
> 
>         u.table_swap = new->complete;
>         new->complete = old->complete;
>         old->complete = u.table_swap;
> 
>         u.ti_swap = new->store->ti;
>         new->store->ti = old->store->ti;
>         old->store->ti = u.ti_swap;
> 
>         u.cow_swap = new->store->cow;
>         new->store->cow = old->store->cow;
>         old->store->cow = u.cow_swap;
> 
>         u.store_swap = new->store;
>         new->store = old->store;
>         old->store = u.store_swap;
> 
>         old->active = 0;
>         new->handover = 0;
> }

Jon,

I discussed this with Mikulas and he agreed that the above would work.
But he raised the fact that reverting dm-snapshot-refactor-associations
leaves the dm_snapshot and  dm_exception_store structures muddled with
regard to where per-target members are located.  I'm inclined to agree
with him.

The dm-snapshot-refactor-associations patch offers cleanup so that:
1) dm_exception_store only contains exception store-specific members
2) dm_snapshot is the structure that contains per-target members

So while this dm-snapshot-refactor-associations patch could be viewed as
"avoidable churn" it actually takes the data structures in a more
controlled direction.

I would rather dm-snapshot-refactor-associations be applied.

Mike

  reply	other threads:[~2009-10-08 17:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 19:00 [PATCH 0/4] snapshot-merge preparation Mike Snitzer
2009-10-05 19:00 ` [PATCH 1/4] dm-snapshot-rework-origin-write Mike Snitzer
2009-10-06 14:17   ` Mike Snitzer
2009-10-07 17:39   ` Jonathan Brassow
2009-10-05 19:00 ` [PATCH 2/4] dm-snapshot-refactor-associations Mike Snitzer
2009-10-07 17:38   ` Jonathan Brassow
2009-10-07 18:24     ` Mike Snitzer
2009-10-08 17:32       ` Mike Snitzer [this message]
2009-10-08 21:14         ` Jonathan Brassow
2009-10-05 19:00 ` [PATCH 3/4] dm-snapshot-exception-handover Mike Snitzer
2009-10-06 14:38   ` Mike Snitzer
2009-10-07 17:42     ` Jonathan Brassow
2009-10-05 19:00 ` [PATCH 4/4] dm-exception-store-dont-read-metadata-if-going-to-handover Mike Snitzer
2009-10-07 17:48   ` Jonathan Brassow

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=20091008173217.GA11142@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=jbrassow@redhat.com \
    --cc=mpatocka@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.