All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lvconvert 0/6] Refactoring lvconvert mirror
@ 2007-12-13 21:05 Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 1/6] Add insert_layer_for_lv() / remove_layer_from_lv() Jun'ichi Nomura
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:05 UTC (permalink / raw)
  To: lvm-devel

Hi,

This patchset refactors lvconvert mirror.
The patches are applicable on top of the pvmove refactoring patches.
https://www.redhat.com/archives/lvm-devel/2007-December/msg00020.html

I would like to know whether this changes are acceptable.
I guess there might be other needs for layer insertion/removal
APIs. Comments are welcome.
If they looks ok, I'll convert add-mirror-to-mirror patches based
on this.

The patches add following APIs:
  - lv_add_mirrors(), lv_remove_mirrors()
      Generic APIs for lvconvert mirror.
      Having 2 modes of conversion: MIRROR_BY_SEG and MIRROR_BY_LV.
      MIRROR_BY_LV is for the current version of lvconvert,
      i.e. mirroring by mimage LVs.
      MIRROR_BY_SEG is for the current version of pvmove,
      i.e. mirroring segment by segment.
  - add_mirror_images()
      Add mirrors (mimage LVs) to LV.
      The counter part of existing remove_mirror_images().
      Wrapped by lv_add_mirrors().
  - add_mirror_log(), remove_mirror_log()
      Simplified version of the APIs specific to add/remove disk log.
  - lv_mirror_count()
      Returns the number of mirrors
  - insert_layer_for_lv(), remove_layer_from_lv()
      Insert a layer on top of the LV and remove it.

Then, lvconvert, lvcreate and pvmove are converted to use them.

The patchset also includes an experimental patch to allow
  - lvcreate/lvconvert to create segment-by-segment mirrored LV
  - pvmove to use disk log

[1/6] add insert_layer_for_lv() / remove_layer_from_lv()
[2/6] add add_mirror_images(), {add,remove}_mirror_log()
[3/6] change lvconvert to use the new APIs
[4/6] change lvcreate to use the new APIs
[5/6] remove unused mirror functions
[6/6] add and convert tools to use lv_{add,remove}_mirrors()
[Appendix] experimental: pvmove with disk log and seg-by-seg mirror LV

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert 1/6] Add insert_layer_for_lv() / remove_layer_from_lv()
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
@ 2007-12-13 21:31 ` Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 2/6] Add add_mirror_images() / {add, remove}_mirror_log() Jun'ichi Nomura
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:31 UTC (permalink / raw)
  To: lvm-devel

Add insert_layer_for_lv() / remove_layer_from_lv().

insert_layer_for_lv() simply creates an layer LV with specified suffix,
move all segments of the LV to the layer LV ,then maps linearly
from the LV to the layer LV.

remove_layer_from_lv() removes the top-level layer from the LV.
This might be too simple.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-insert-layer-lv.patch
Type: text/x-patch
Size: 4851 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/2acab1c1/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert 2/6] Add add_mirror_images() / {add, remove}_mirror_log()
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 1/6] Add insert_layer_for_lv() / remove_layer_from_lv() Jun'ichi Nomura
@ 2007-12-13 21:31 ` Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 3/6] Change lvconvert to use the new mirror APIs Jun'ichi Nomura
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:31 UTC (permalink / raw)
  To: lvm-devel

Add functions to support LV conversion to mirror as whole-lv
  - add_mirror_images()
  - {add,remove}_mirror_log()

write_log_header() and set_lv() are moved/copied from toollib.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-convert-lv-mirrored.patch
Type: text/x-patch
Size: 15937 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/273e4730/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert 3/6] Change lvconvert to use the new mirror APIs
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 1/6] Add insert_layer_for_lv() / remove_layer_from_lv() Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 2/6] Add add_mirror_images() / {add, remove}_mirror_log() Jun'ichi Nomura
@ 2007-12-13 21:31 ` Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 4/6] Change lvcreate " Jun'ichi Nomura
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:31 UTC (permalink / raw)
  To: lvm-devel

Change lvconvert to use add_mirror_images() and {add,remove}_mirror_log().

There should be no change in functionality.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-lvconvert-use-new-mirror-api.patch
Type: text/x-patch
Size: 3330 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/89c4ad28/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert 4/6] Change lvcreate to use the new mirror APIs
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
                   ` (2 preceding siblings ...)
  2007-12-13 21:31 ` [PATCH lvconvert 3/6] Change lvconvert to use the new mirror APIs Jun'ichi Nomura
@ 2007-12-13 21:31 ` Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 5/6] Remove unused mirror functions Jun'ichi Nomura
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:31 UTC (permalink / raw)
  To: lvm-devel

Change lvconvert to use add_mirror_images().

The patch simplifies the lvcreate code and we no longer need
to export allocate_extents() directly to tools.

However, this patch slightly changes the allocation logic.
Original code allocated all mirrors at once.
OTOH, this code creates a linear LV first then adds mirrors to it.
It's better to allocate all at once because otherwise the allocation
code may make worse choice at the first attempt.
To do that, we have to be able to create an empty mirror layers.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-lvcreate-use-new-mirror-api.patch
Type: text/x-patch
Size: 3257 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/174fcfbb/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert 5/6] Remove unused mirror functions
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
                   ` (3 preceding siblings ...)
  2007-12-13 21:31 ` [PATCH lvconvert 4/6] Change lvcreate " Jun'ichi Nomura
@ 2007-12-13 21:31 ` Jun'ichi Nomura
  2007-12-13 21:31 ` [PATCH lvconvert 6/6] Add lv_{add,remove}_mirrors() Jun'ichi Nomura
  2007-12-13 21:32 ` [PATCH lvconvert Appendix] Experimental: pvmove with disk log and seg-by-seg mirrored LV Jun'ichi Nomura
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:31 UTC (permalink / raw)
  To: lvm-devel

This patch removes:
  - lv_add_mirror_segment()
       Replaced by lv_add_mirror_lvs()
  - lv_add_more_mirrored_areas()
  - add_mirror_layers()
       These functions were not used.
  - create_mirror_layers()
       Replaced by add_mirror_images()
  - generate_log_name_format()
       "_mlog" hard coding is moved to lib. ("_mimage" has been there.)
  - create_mirror_log()
       Replaced by add_mirror_log()
  - _write_log_header()
       Moved to lib

and renames:
  - _create_layers_for_mirror() -> _create_mimage_lvs()
       This function doesn't create layers but just creates mimage LVs.

-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-remove-unused-mirror-functions.patch
Type: text/x-patch
Size: 14528 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/bbbfae2c/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert 6/6] Add lv_{add,remove}_mirrors()
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
                   ` (4 preceding siblings ...)
  2007-12-13 21:31 ` [PATCH lvconvert 5/6] Remove unused mirror functions Jun'ichi Nomura
@ 2007-12-13 21:31 ` Jun'ichi Nomura
  2007-12-13 21:32 ` [PATCH lvconvert Appendix] Experimental: pvmove with disk log and seg-by-seg mirrored LV Jun'ichi Nomura
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:31 UTC (permalink / raw)
  To: lvm-devel

This patch adds generic wrappers for mirror addition / removal
and changes lvcreate, lvconvert and pvmove to use them.

Mirror addition has 2 modes: MIRROR_BY_SEG and MIRROR_BY_LV.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-generic-lv-add-remove-mirrors.patch
Type: text/x-patch
Size: 7395 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/7094a477/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lvconvert Appendix] Experimental: pvmove with disk log and seg-by-seg mirrored LV
  2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
                   ` (5 preceding siblings ...)
  2007-12-13 21:31 ` [PATCH lvconvert 6/6] Add lv_{add,remove}_mirrors() Jun'ichi Nomura
@ 2007-12-13 21:32 ` Jun'ichi Nomura
  6 siblings, 0 replies; 8+ messages in thread
From: Jun'ichi Nomura @ 2007-12-13 21:32 UTC (permalink / raw)
  To: lvm-devel

This patch is experimental and just a proof-of-concept of new APIs.
(Some changes in lib were needed for adding pvmove support.)

Examples of commands and 'dmsetup ls --tree':
("/dev/mapper/d*" are PVs)

  Normal pvmove:
  # pvmove /dev/mapper/d1 /dev/mapper/d3 
    testvg-lvol2 (254:11)
     |-d2 (254:2)
     `-testvg-pvmove0 (254:13)
        |-d3 (254:3)
        `-d1 (254:1)
    testvg-lvol1 (254:10)
     `-testvg-pvmove0 (254:13)
        |-d3 (254:3)
        `-d1 (254:1)

  Disklog pvmove:
  # pvmove --mirrorlog disk /dev/mapper/d1 /dev/mapper/d3 /dev/mapper/d5:0-0
    testvg-lvol2 (254:11)
     |-d2 (254:2)
     `-testvg-pvmove0 (254:16)
        |-testvg-pvmove0_mimage_1 (254:15)
        |  `-d3 (254:3)
        |-testvg-pvmove0_mimage_0 (254:14)
        |  `-d1 (254:1)
        `-testvg-pvmove0_mlog (254:13)
           `-d5 (254:5)
    testvg-lvol1 (254:10)
     `-testvg-pvmove0 (254:16)
        |-testvg-pvmove0_mimage_1 (254:15)
        |  `-d3 (254:3)
        |-testvg-pvmove0_mimage_0 (254:14)
        |  `-d1 (254:1)
        `-testvg-pvmove0_mlog (254:13)
           `-d5 (254:5)

  Normal corelog mirror LV:
  # lvcreate -m1 -l1 --mirrorlog core testvg
    testvg-lvol0 (254:11)
     |-testvg-lvol0_mimage_1 (254:10)
     |  `-d2 (254:2)
     `-testvg-lvol0_mimage_0 (254:9)
        `-d1 (254:1)

  Seg-by-seg corelog mirror LV:
  # lvcreate -m1 -l1 --mirrorlog seg testvg
    testvg-lvol0 (254:9)
     |-d2 (254:2)
     `-d1 (254:1)

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pvmove-disklog-option.patch
Type: text/x-patch
Size: 9942 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20071213/95d64619/attachment.bin>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-12-13 21:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-13 21:05 [PATCH lvconvert 0/6] Refactoring lvconvert mirror Jun'ichi Nomura
2007-12-13 21:31 ` [PATCH lvconvert 1/6] Add insert_layer_for_lv() / remove_layer_from_lv() Jun'ichi Nomura
2007-12-13 21:31 ` [PATCH lvconvert 2/6] Add add_mirror_images() / {add, remove}_mirror_log() Jun'ichi Nomura
2007-12-13 21:31 ` [PATCH lvconvert 3/6] Change lvconvert to use the new mirror APIs Jun'ichi Nomura
2007-12-13 21:31 ` [PATCH lvconvert 4/6] Change lvcreate " Jun'ichi Nomura
2007-12-13 21:31 ` [PATCH lvconvert 5/6] Remove unused mirror functions Jun'ichi Nomura
2007-12-13 21:31 ` [PATCH lvconvert 6/6] Add lv_{add,remove}_mirrors() Jun'ichi Nomura
2007-12-13 21:32 ` [PATCH lvconvert Appendix] Experimental: pvmove with disk log and seg-by-seg mirrored LV Jun'ichi Nomura

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.