From patchwork Tue Dec 27 08:03:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tang.junhui@zte.com.cn X-Patchwork-Id: 9489055 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2575B62AAF for ; Tue, 27 Dec 2016 08:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14D5D200DF for ; Tue, 27 Dec 2016 08:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 090E8201BC; Tue, 27 Dec 2016 08:13:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8CF5D200DF for ; Tue, 27 Dec 2016 08:13:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uBR8C9Tt017158; Tue, 27 Dec 2016 03:12:09 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uBR8C8QK022588 for ; Tue, 27 Dec 2016 03:12:08 -0500 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBR8C72f012922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 27 Dec 2016 03:12:07 -0500 Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by mx1.redhat.com (Postfix) with ESMTP id 0C176C057EC9 for ; Tue, 27 Dec 2016 08:12:06 +0000 (UTC) X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20161227155920 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 27 Dec 2016 07:59:20 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id uBR84eH5013892; Tue, 27 Dec 2016 16:04:40 +0800 (GMT-8) (envelope-from tang.junhui@zte.com.cn) Received: from localhost.localdomain ([10.118.202.203]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2016122716044377-13720 ; Tue, 27 Dec 2016 16:04:43 +0800 From: tang.junhui@zte.com.cn To: christophe.varoqui@opensvc.com, hare@suse.de, bmarzins@redhat.com, mwilck@suse.com, bart.vanassche@sandisk.com Date: Tue, 27 Dec 2016 16:03:19 +0800 Message-Id: <1482825809-9528-3-git-send-email-tang.junhui@zte.com.cn> In-Reply-To: <1482825809-9528-1-git-send-email-tang.junhui@zte.com.cn> References: <1482825809-9528-1-git-send-email-tang.junhui@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2016-12-27 16:04:43, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2016-12-27 16:04:25, Serialize complete at 2016-12-27 16:04:25 X-MAIL: mse01.zte.com.cn uBR84eH5013892 X-HQIP: 127.0.0.1 X-Greylist: Delayed for 00:06:37 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 27 Dec 2016 08:12:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 27 Dec 2016 08:12:07 +0000 (UTC) for IP:'202.103.147.172' DOMAIN:'out1.zte.com.cn' HELO:'out1.zte.com.cn' FROM:'tang.junhui@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: -2.717 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RP_MATCHES_RCVD, SPF_PASS) 202.103.147.172 out1.zte.com.cn 202.103.147.172 out1.zte.com.cn X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-loop: dm-devel@redhat.com Cc: zhang.kai16@zte.com.cn, dm-devel@redhat.com, tang.junhui@zte.com.cn, tang.wenjun3@zte.com.cn Subject: [dm-devel] [PATCH 02/12] libmultipath: add merge_node for "struct uevent" to record nodes of merged uevents X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP From: tang.junhui 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 --- 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;