From patchwork Fri Nov 11 08:00:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Gross X-Patchwork-Id: 9422519 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 899F9601C0 for ; Fri, 11 Nov 2016 08:03:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DCA729962 for ; Fri, 11 Nov 2016 08:03:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7272429965; Fri, 11 Nov 2016 08:03:09 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20F3129962 for ; Fri, 11 Nov 2016 08:03:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c56l1-0007BR-KW; Fri, 11 Nov 2016 08:00:19 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c56l0-0007Ay-Hz for xen-devel@lists.xen.org; Fri, 11 Nov 2016 08:00:18 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 91/71-08512-19A75285; Fri, 11 Nov 2016 08:00:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVyuP0Ov+7EKtU Ig5erJSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozT3RfYCxbwVVxf7dTA2M3TxcjJISFgJPF2 4j+mLkYuDiGBhYwSh49dZAFJsAmoSmy4fooVxBYRkJa49vkyI4jNLHCKUWLHBicQW1ggVGLm9 t/sIDYLUP37mS+YQGxeATuJTe9usEMskJO4PnM6WJxTwF7i+IQHzCC2EFBN/7ZNbBMYuRcwMq xi1ChOLSpLLdI1tNRLKspMzyjJTczM0TU0MNXLTS0uTkxPzUlMKtZLzs/dxAj0bj0DA+MOxkf 9focYJTmYlER5WQtVI4T4kvJTKjMSizPii0pzUosPMcpwcChJ8C6uBMoJFqWmp1akZeYAwwwm LcHBoyTCGwSS5i0uSMwtzkyHSJ1i1OV4s+vlAyYhlrz8vFQpcd4ZIEUCIEUZpXlwI2Ahf4lRV kqYl5GBgUGIpyC1KDezBFX+FaM4B6OSMK8ByBSezLwSuE2vgI5gAjpiRpwKyBEliQgpqQbGVW qNl613f2FWsfkoPzH1GPczZov9TO/0NVa+X7L/9oXVR31+/QudJfijRWHl/pNWl3XWLk9Y/6j ve8mWt+5cWuK9v7hMfxS+/7s8WzsjR2d5wPuJUgLGFaHn37yI43yaHrTcuPWtrLZfM+PBP3uP RReHmH2anH3VjMtC8ECgYXSW22fXuEIdJZbijERDLeai4kQAcxRUynQCAAA= X-Env-Sender: jgross@suse.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1478851216!30879473!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29673 invoked from network); 11 Nov 2016 08:00:16 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-14.tower-206.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 11 Nov 2016 08:00:16 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A3679ABFB; Fri, 11 Nov 2016 08:00:16 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xen.org Date: Fri, 11 Nov 2016 09:00:00 +0100 Message-Id: <1478851210-6251-3-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1478851210-6251-1-git-send-email-jgross@suse.com> References: <1478851210-6251-1-git-send-email-jgross@suse.com> Cc: Juergen Gross , sstabellini@kernel.org, wei.liu2@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com Subject: [Xen-devel] [PATCH v3 02/12] xenstore: call add_change_node() directly when writing node X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of calling add_change_node() at places where write_node() is called, do that inside write_node(). Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index de1a9b4..1354387 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -456,7 +456,7 @@ static struct node *read_node(struct connection *conn, const void *ctx, return node; } -static bool write_node(struct connection *conn, const struct node *node) +static bool write_node(struct connection *conn, struct node *node) { /* * conn will be null when this is called from manual_node. @@ -476,6 +476,8 @@ static bool write_node(struct connection *conn, const struct node *node) if (domain_is_unprivileged(conn) && data.dsize >= quota_max_entry_size) goto error; + add_change_node(conn, node, false); + data.dptr = talloc_size(node, data.dsize); ((uint32_t *)data.dptr)[0] = node->num_perms; ((uint32_t *)data.dptr)[1] = node->datalen; @@ -976,7 +978,6 @@ static void do_write(struct connection *conn, struct buffered_data *in) } } - add_change_node(conn, node, false); fire_watches(conn, in, name, false); send_ack(conn, XS_WRITE); } @@ -1007,7 +1008,6 @@ static void do_mkdir(struct connection *conn, struct buffered_data *in) send_error(conn, errno); return; } - add_change_node(conn, node, false); fire_watches(conn, in, name, false); } send_ack(conn, XS_MKDIR); @@ -1209,7 +1209,6 @@ static void do_set_perms(struct connection *conn, struct buffered_data *in) return; } - add_change_node(conn, node, false); fire_watches(conn, in, name, false); send_ack(conn, XS_SET_PERMS); }