From: tang.junhui <tang.jun...@zte.com.cn>

Add merged nodes list to store nodes of merged uevents. By Adding
this member, after merging, the list of uevents would be linked like
this:
uevent
 ---------------------------
|struct list_head node      |----->list node of un-merged uevents
 ---------------------------
|struct list_head merge_node|----->list node of merged uevents, which
----------------------------       moved from the origin un-merged list
|...                        |
 ---------------------------

Change-Id: I5fbfc7656ede77e03ca35c855212e2d2d60706b2
Signed-off-by: tang.junhui <tang.jun...@zte.com.cn>
---
 libmultipath/uevent.c | 4 +++-
 libmultipath/uevent.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
index ef1bafe..181b3b8 100644
--- a/libmultipath/uevent.c
+++ b/libmultipath/uevent.c
@@ -72,8 +72,10 @@ struct uevent * alloc_uevent (void)
 {
        struct uevent *uev = MALLOC(sizeof(struct uevent));
 
-       if (uev)
+       if (uev) {
                INIT_LIST_HEAD(&uev->node);
+               INIT_LIST_HEAD(&uev->merge_node);
+       }
 
        return uev;
 }
diff --git a/libmultipath/uevent.h b/libmultipath/uevent.h
index 7bfccef..61a4207 100644
--- a/libmultipath/uevent.h
+++ b/libmultipath/uevent.h
@@ -17,6 +17,7 @@ struct udev;
 
 struct uevent {
        struct list_head node;
+       struct list_head merge_node;
        struct udev_device *udev;
        char buffer[HOTPLUG_BUFFER_SIZE + OBJECT_SIZE];
        char *devpath;
-- 
2.8.1.windows.1


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

Reply via email to