All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [PATCH pvmove 0/6] Refactoring pvmove with generic APIs
Date: Fri, 07 Dec 2007 10:48:47 -0500	[thread overview]
Message-ID: <47596B5F.3010005@ce.jp.nec.com> (raw)
In-Reply-To: <20071207114954.GA6313@redhat.com>

Hi Heinz,

Thanks for the comment.

Heinz Mauelshagen wrote:
> it would be better to make this more generic.
> 
> Ie. convert_segments(struct lvm_conversion_handler *handler, ...)
> rather than having a per target conversion function.

Yes, generic interface is nice.
But as for conversion, I think starting from per-target
conversion functions is better.


We may have a generic library interface like this:

  int lv_convert(struct logical_volume *lv,
                   struct segment_type *segtype,
                   struct conversion_param *conv)

The conversion parameters are very specific to segment types.
So callers have to set up the conversion_param based on the segtype.

Parameter are perhaps passed as an array of name-value pairs.
I.e.
  struct conversion_param {
     int n_params;
     struct {
       const char *name;
       const char *value;
     } *params;
  }

 conv = { 4,
           { { "mirrors", "3" }, { "region_size", "64" },
             { "log_count", "0" }, { "type", "segment-by-segment" } }
         }

And the segment type handlers interpret it.
I think it's good for external applications using liblvm2
but too much for LVM2 internal use.

What do you think?

Anyway, IMO, it's easy to add a generic wrapper once we make up
underlying conversion functions for each segment types.
So I think we should focus first on building up working conversion
functions.

This pvmove patchset provides segment-by-segment conversion for
mirror.
Next step would be whole-lv conversion for mirror.
Then we can add a single wrapper for to-mirror conversion.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America



      reply	other threads:[~2007-12-07 15:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06 16:40 [PATCH pvmove 0/6] Refactoring pvmove with generic APIs Jun'ichi Nomura
2007-12-06 16:48 ` [PATCH pvmove 1/6] Add insert_layer_for_segments_on_pv() Jun'ichi Nomura
2007-12-06 16:48 ` [PATCH pvmove 2/6] Add convert_segments_mirrored() Jun'ichi Nomura
2007-12-06 16:49 ` [PATCH pvmove 3/6] Add split_parent_segments() Jun'ichi Nomura
2007-12-06 16:50 ` [PATCH pvmove 4/6] Change pvmove to use the generalized APIs Jun'ichi Nomura
2007-12-06 16:51 ` [PATCH pvmove 5/6] Remove unused mirrored_pv/mirrored_pe params from internal code Jun'ichi Nomura
2007-12-06 16:51 ` [PATCH pvmove 6/6] Remove unused can_split param from allocate_extents() Jun'ichi Nomura
2007-12-06 16:53 ` [PATCH pvmove 0/6] Refactoring pvmove with generic APIs Jun'ichi Nomura
2007-12-07 11:49 ` Heinz Mauelshagen
2007-12-07 15:48   ` Jun'ichi Nomura [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=47596B5F.3010005@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=lvm-devel@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.