master - Add support for raid0/raid0_meta raid types
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cb5156ce1f909abfde91e51a46b95eaca45f46ce Commit: cb5156ce1f909abfde91e51a46b95eaca45f46ce Parent: 3225f8d17596b79b76ed9da5291843d02a2aa7b6 Author: Heinz Mauelshagen <[email protected]> AuthorDate: Tue Jun 9 19:41:41 2015 +0200 Committer: Heinz Mauelshagen <[email protected]> CommitterDate: Tue Jun 9 19:41:41 2015 +0200
Add support for raid0/raid0_meta raid types
Supports creation of raid types raid0 and raid0_meta with 'lvcreate --type (raid0|raid0_meta) ...' based on functionality available in dm-raid target version 1.0.7
The raid0 type provides access via the MD raid0 personality without metadata devices
The raid0_meta type provides access via the MD raid0 personality _with_ metadata devices, i.e. it reserves space for rmeta devices which is useful for future functional enhancements supporting conversions between raid0 and raid4/5/6/10 to ensure metadata space on raid0_meta creation.
Conversion between striped/raid0/raid0_meta LVs with striped LVs being restricted to one stripe zone (i.e. no varying stripes) is possible with 'lvconvert --type (striped|raid0|raid0_meta) ...'
lvconvert-striped-raid0.sh provides various tests
--- WHATS_NEW | 1 + lib/activate/dev_manager.c | 14 +- lib/config/defaults.h | 2 + lib/format_text/export.c | 6 +- lib/metadata/lv.c | 1 + lib/metadata/lv.h | 4 +- lib/metadata/lv_manip.c | 362 ++++++---- lib/metadata/merge.c | 2 +- lib/metadata/metadata-exported.h | 12 +- lib/metadata/raid_manip.c | 1483 +++++++++++++++++++++++++++++++------- lib/metadata/segtype.h | 133 +++- lib/raid/raid.c | 213 +++--- lib/uuid/uuid.c | 2 +- libdm/libdm-deptree.c | 70 ++- tools/lvchange.c | 2 +- tools/lvconvert.c | 60 +- tools/lvcreate.c | 75 ++- 17 files changed, 1834 insertions(+), 608 deletions(-)
WHATS_NEW +1 -0
@@ -8,6 +8,7 @@ Version 2.02.121 - Do not fail polling when poll LV not found (already finished or removed). Replace poll_get_copy_vg/lv fns with vg_read() and find_lv() in polldaemon. Close all device fds only in before sleep call in polldaemon. + Support for raid types raid0 and raid0_meta Version 2.02.120 - 15th May 2015 ================================
lib/activate/dev_manager.c +11 -3
@@ -2134,6 +2134,7 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, !_add_lv_to_dtree(dm, dtree, seg_lv(seg, s), 0)) return_0;if (seg_is_raid (seg) && + seg->meta_areas &&seg_metalv (seg, s) && !_add_lv_to_dtree (dm, dtree,seg_metalv (seg, s),0 )) return_0; }
@@ -2303,9 +2304,15 @@ int add_areas_line(struct dev_manager *dm, struct lv_segment *seg, return_0;continue ; } -if (!(dlid =build_dm_uuid (dm->mem,seg_metalv (seg, s),NULL ))) - return_0; -if (!dm_tree_node_add_target_area (node,NULL , dlid, extent_size *seg_metale (seg, s))) + +if (seg->meta_areas &&seg_metalv (seg, s)) { +if (!(dlid =build_dm_uuid (dm->mem,seg_metalv (seg, s),NULL ))) + return_0; +if (!dm_tree_node_add_target_area (node,NULL , dlid, extent_size *seg_metale (seg, s))) + return_0; + +/* One for metadata area */ + }else if (!dm_tree_node_add_null_area (node,0 )) return_0;if (!(dlid =build_dm_uuid (dm->mem,seg_lv (seg, s),NULL )))
@@ -2632,6 +2639,7 @@ static int _add_segment_to_dtree(struct dev_manager *dm, laopts, NULL)) return_0;if (seg_is_raid (seg) && + seg->meta_areas &&seg_metalv (seg, s) && !_add_new_lv_to_dtree (dm, dtree,seg_metalv (seg, s), laopts,NULL )) return_0;
lib/config/defaults.h +2 -0
@@ -60,7 +60,9 @@#define DEFAULT_MIRROR_LOG_FAULT_POLICY "allocate"#define DEFAULT_MIRROR_IMAGE_FAULT_POLICY "remove"#define DEFAULT_MIRROR_MAX_IMAGES 8/* limited by kernel DM_KCOPYD_MAX_REGIONS */ +#define DEFAULT_RAID_MAX_IMAGES 64/* limited by kernel failed devices bitfield in superblock (raid4/5/6 max 253) */ #define DEFAULT_RAID_FAULT_POLICY "warn" +#define DEFAULT_RAID_STRIPE_SIZE (64 * 2)#define DEFAULT_DMEVENTD_RAID_LIB "libdevmapper-event-lvm2raid.so"#define DEFAULT_DMEVENTD_MIRROR_LIB "libdevmapper-event-lvm2mirror.so"
lib/format_text/export.c +3 -3
@@ -590,14 +590,14 @@ int out_areas(struct formatter *f, const struct lv_segment *seg,/* RAID devices are laid-out in metadata/data pairs */ if (!lv_is_raid_image (seg_lv (seg, s)) || - !lv_is_raid_metadata (seg_metalv (seg, s))) { + (seg->meta_areas &&seg_metalv (seg, s) && !lv_is_raid_metadata (seg_metalv (seg, s)))) {log_error ("RAID segment has non-RAID areas" );return 0 ; }outf (f,"\"%s\", \"%s\"%s" , -seg_metalv (seg, s)->name,seg_lv (seg, s)->name, - (s == seg->area_count -1 ) ?"" :"," ); + (seg->meta_areas &&seg_metalv (seg, s)) ?seg_metalv (seg, s)->name :"-" , +seg_lv (seg, s)->name, (s == seg->area_count -1 ) ?"" :"," );break ;case AREA_UNASSIGNED :
lib/metadata/lv.c +1 -0
@@ -533,6 +533,7 @@ int lv_raid_image_in_sync(const struct logical_volume *lv)if ((seg =first_seg (lv))) raid_seg =get_only_segment_using_this_lv (seg->lv); +if (!raid_seg) {log_error ("Failed to find RAID segment for %s" , lv->name);return 0 ;
lib/metadata/lv.h +2 -2
@@ -35,8 +35,8 @@ struct logical_volume {int32_t major;int32_t minor; -uint64_t size;/* Sectors */ -uint32_t le_count; +uint64_t size;/* Sectors visible */ +uint32_t le_count;/* Logical extents visible */ uint32_t origin_count;uint32_t external_count;
lib/metadata/lv_manip.c +221 -141
712 lines not on this page · raw message
lib/metadata/merge.c +1 -1
@@ -412,7 +412,7 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)continue ;if (lv ==seg_lv (seg, s)) seg_found++; -if (seg_is_raid (seg) && (lv ==seg_metalv (seg, s))) +if (seg_is_raid (seg) && seg->meta_areas && (lv ==seg_metalv (seg, s))) seg_found++; }if (seg_is_replicator_dev (seg)) {
lib/metadata/metadata-exported.h +10 -2
@@ -1109,6 +1109,9 @@ struct logical_volume *first_replicator_dev(const struct logical_volume *lv);/* -- metadata/replicator_manip.c */ /* ++ metadata/raid_manip.c */ +uint32_t raid_rmeta_extents_delta (struct cmd_context *cmd, +uint32_t rimage_extents_cur,uint32_t rimage_extents_new, +uint32_t region_size,uint32_t extent_size);int lv_is_raid_with_tracking (const struct logical_volume *lv);uint32_t lv_raid_image_count (const struct logical_volume *lv); int lv_raid_change_image_count(struct logical_volume *lv,
@@ -1118,8 +1121,13 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,int lv_raid_split_and_track (struct logical_volume *lv,struct dm_list *splittable_pvs);int lv_raid_merge (struct logical_volume *lv); -int lv_raid_reshape (struct logical_volume *lv, -const struct segment_type *new_segtype); +int lv_raid_convert (struct logical_volume *lv, +const struct segment_type *new_segtype, +int yes,int force, +const unsigned image_count, +const unsigned stripes, +const unsigned new_stripe_size, +struct dm_list *allocate_pvs);int lv_raid_replace (struct logical_volume *lv,struct dm_list *remove_pvs,struct dm_list *allocate_pvs);int lv_raid_remove_missing (struct logical_volume *lv);
lib/metadata/raid_manip.c +1223 -250
1,665 lines not on this page · raw message
lib/metadata/segtype.h +100 -33
170 lines not on this page · raw message
lib/raid/raid.c +112 -101
303 lines not on this page · raw message
lib/uuid/uuid.c +1 -1
@@ -140,7 +140,7 @@ int id_valid(struct id *id)for (i =0 ; i <ID_LEN ; i++)if (!_inverse_c[id->uuid[i]]) { -log_error ("UUID contains invalid character" ); +log_error ("UUID contains invalid character '%c'" , id->uuid[i]);return 0 ; }
libdm/libdm-deptree.c +49 -21
28 lines not on this page · raw message
tools/lvconvert.c +32 -28
60 lines not on this page · raw message
tools/lvcreate.c +59 -16
75 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.