From patchwork Thu Oct 6 03:16:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 678724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3sqHsV0QxNz9sR9 for ; Thu, 6 Oct 2016 14:18:06 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id C6F731091D; Wed, 5 Oct 2016 20:17:06 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 63D5510917 for ; Wed, 5 Oct 2016 20:17:05 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id F3933420110 for ; Wed, 5 Oct 2016 21:17:04 -0600 (MDT) X-ASG-Debug-ID: 1475723824-09eadd0cb267190001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar5.cudamail.com with ESMTP id UXuGwXDS8cn9sO2p (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 05 Oct 2016 21:17:04 -0600 (MDT) X-Barracuda-Envelope-From: blp@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO relay3-d.mail.gandi.net) (217.70.183.195) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 6 Oct 2016 03:17:04 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at ovn.org designates 217.70.183.195 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.195 X-Barracuda-RBL-IP: 217.70.183.195 Received: from mfilter47-d.gandi.net (mfilter47-d.gandi.net [217.70.178.178]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 72366A80D0; Thu, 6 Oct 2016 05:17:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter47-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter47-d.gandi.net (mfilter47-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id eCaouLUYgw0e; Thu, 6 Oct 2016 05:17:01 +0200 (CEST) X-Originating-IP: 173.228.112.90 Received: from sigabrt.gateway.sonic.net (173-228-112-90.dsl.dynamic.fusionbroadband.com [173.228.112.90]) (Authenticated sender: blp@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 4442FA80C2; Thu, 6 Oct 2016 05:16:59 +0200 (CEST) X-CudaMail-Envelope-Sender: blp@ovn.org From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-1004064234 X-CudaMail-DTE: 100516 X-CudaMail-Originating-IP: 217.70.183.195 Date: Wed, 5 Oct 2016 20:16:47 -0700 X-ASG-Orig-Subj: [##CM-V3-1004064234##][PATCH 10/15] ovsdb-idl: Improve comment on ovsdb_idl_txn_write[_clone](). Message-Id: <1475723812-20932-10-git-send-email-blp@ovn.org> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1475723812-20932-1-git-send-email-blp@ovn.org> References: <1475723812-20932-1-git-send-email-blp@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1475723824 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 10/15] ovsdb-idl: Improve comment on ovsdb_idl_txn_write[_clone](). X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Ben Pfaff --- lib/ovsdb-idl.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 3dbf0f7..ffee4b6 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -3080,23 +3080,6 @@ ovsdb_idl_txn_complete(struct ovsdb_idl_txn *txn, hmap_remove(&txn->idl->outstanding_txns, &txn->hmap_node); } -/* Writes 'datum' to the specified 'column' in 'row_'. Updates both 'row_' - * itself and the structs derived from it (e.g. the "struct ovsrec_*", for - * ovs-vswitchd). - * - * 'datum' must have the correct type for its column. The IDL does not check - * that it meets schema constraints, but ovsdb-server will do so at commit time - * so it had better be correct. - * - * A transaction must be in progress. Replication of 'column' must not have - * been disabled (by calling ovsdb_idl_omit()). - * - * Usually this function is used indirectly through one of the "set" functions - * generated by ovsdb-idlc. - * - * Takes ownership of what 'datum' points to (and in some cases destroys that - * data before returning) but makes a copy of 'datum' itself. (Commonly - * 'datum' is on the caller's stack.) */ static void ovsdb_idl_txn_write__(const struct ovsdb_idl_row *row_, const struct ovsdb_idl_column *column, @@ -3172,6 +3155,23 @@ discard_datum: } } +/* Writes 'datum' to the specified 'column' in 'row_'. Updates both 'row_' + * itself and the structs derived from it (e.g. the "struct ovsrec_*", for + * ovs-vswitchd). + * + * 'datum' must have the correct type for its column. The IDL does not check + * that it meets schema constraints, but ovsdb-server will do so at commit time + * so it had better be correct. + * + * A transaction must be in progress. Replication of 'column' must not have + * been disabled (by calling ovsdb_idl_omit()). + * + * Usually this function is used indirectly through one of the "set" functions + * generated by ovsdb-idlc. + * + * Takes ownership of what 'datum' points to (and in some cases destroys that + * data before returning) but makes a copy of 'datum' itself. (Commonly + * 'datum' is on the caller's stack.) */ void ovsdb_idl_txn_write(const struct ovsdb_idl_row *row, const struct ovsdb_idl_column *column, @@ -3180,6 +3180,8 @@ ovsdb_idl_txn_write(const struct ovsdb_idl_row *row, ovsdb_idl_txn_write__(row, column, datum, true); } +/* Similar to ovsdb_idl_txn_write(), except that the caller retains ownership + * of 'datum' and what it points to. */ void ovsdb_idl_txn_write_clone(const struct ovsdb_idl_row *row, const struct ovsdb_idl_column *column,