]> sourceware.org Git - lvm2.git/commitdiff
use updated dm_event_get_registered_device interface
authorAlasdair Kergon <agk@redhat.com>
Tue, 16 Jan 2007 23:05:13 +0000 (23:05 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 16 Jan 2007 23:05:13 +0000 (23:05 +0000)
lib/mirror/mirrored.c

index 411d2a6305a8435d0a8d74ad084845dd11663a3e..09bd66770b174ad9a4ef3addad5da5e815b40ad4 100644 (file)
@@ -394,6 +394,7 @@ static int _target_registered(struct lv_segment *seg, int *pending)
        struct logical_volume *lv;
        struct volume_group *vg;
        enum dm_event_mask evmask = 0;
+       struct dm_event_handler *dmevh;
 
        lv = seg->lv;
        vg = lv->vg;
@@ -407,14 +408,26 @@ static int _target_registered(struct lv_segment *seg, int *pending)
        if (!(name = build_dm_name(vg->cmd->mem, vg->name, lv->name, NULL)))
                return_0;
 
-       if (!dm_event_get_registered_device(&dso, &name, &evmask, 0))
+       if (!(dmevh = dm_event_handler_create()))
+               return_0;
+
+       dm_event_handler_set_dso(dmevh, dso);
+       dm_event_handler_set_dev_name(dmevh, name);
+       dm_event_handler_set_event_mask(dmevh, DM_EVENT_ALL_ERRORS);
+
+       if (dm_event_get_registered_device(dmevh, 0)) {
+               dm_event_handler_destroy(dmevh);
                return 0;
+       }
 
+       evmask = dm_event_handler_get_event_mask(dmevh);
        if (evmask & DM_EVENT_REGISTRATION_PENDING) {
                *pending = 1;
                evmask &= ~DM_EVENT_REGISTRATION_PENDING;
        }
 
+       dm_event_handler_destroy(dmevh);
+
        return evmask;
 }
 
This page took 0.035515 seconds and 5 git commands to generate.