FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 11-02-2009, 01:20 PM
Zdenek Kabelac
 
Default Replicator: update _create_partial_dtree()

Creating partial tree for Replicator target.
Using dm_tree_set_priority() to set higher priority for Replicator.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
lib/activate/dev_manager.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index a4ae9e0..1f1d645 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -731,6 +731,9 @@ static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logi
struct dm_list *snh, *snht;
struct lv_segment *seg;
uint32_t s;
+ struct replicator_device *rdev;
+ struct replicator_site *rsite;
+ const char *replicator_dlid;

if (!(dtree = dm_tree_create())) {
log_error("Partial dtree creation failed for %s.", lv->name);
@@ -746,12 +749,34 @@ static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logi
goto_bad;

/* Add any LVs used by segments in this LV */
- dm_list_iterate_items(seg, &lv->segments)
+ dm_list_iterate_items(seg, &lv->segments) {
for (s = 0; s < seg->area_count; s++)
if (seg_type(seg, s) == AREA_LV && seg_lv(seg, s)) {
if (!_add_lv_to_dtree(dm, dtree, seg_lv(seg, s)))
goto_bad;
}
+ if (seg->replicator) {
+ /* Add all replicator-dev from same replicator */
+ dm_list_iterate_items(rsite, &seg->replicator->rsites) {
+ dm_list_iterate_items(rdev, &rsite->rdevices) {
+ if (rsite->state == REPLICATOR_STATE_ACTIVE) {
+ if (!rdev->replicator_dev->lv)
+ goto_bad;
+ if (lv == rdev->replicator_dev->lv)
+ continue;
+ /* Add replicator-dev LV */
+ if (!_add_lv_to_dtree(dm, dtree, rdev->replicator_dev->lv))
+ goto_bad;
+ }
+ }
+ }
+
+ if (!(replicator_dlid = build_dlid(dm, seg->replicator->lvid.s, NULL)))
+ goto_bad;
+ if (!dm_tree_set_replicator_suspend(dtree, replicator_dlid))
+ goto_bad;
+ }
+ }

return dtree;

--
1.6.5.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 08:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org