From patchwork Fri Dec 8 00:12:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 845928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ytCXS50Qgz9s82 for ; Fri, 8 Dec 2017 11:14:48 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DBFC7CAA; Fri, 8 Dec 2017 00:12:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D0534C18 for ; Fri, 8 Dec 2017 00:12:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7E2F6FE for ; Fri, 8 Dec 2017 00:12:50 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 8FD27C5A51; Fri, 8 Dec 2017 01:12:48 +0100 (CET) From: Ben Pfaff To: dev@openvswitch.org Date: Thu, 7 Dec 2017 16:12:30 -0800 Message-Id: <20171208001240.25829-4-blp@ovn.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20171208001240.25829-1-blp@ovn.org> References: <20171208001240.25829-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 03/13] log: Make json parameter to ovsdb_log_write() const. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovsdb/log.c | 4 +++- ovsdb/log.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ovsdb/log.c b/ovsdb/log.c index d9fedd9ded6c..1a372d7b73ee 100644 --- a/ovsdb/log.c +++ b/ovsdb/log.c @@ -360,8 +360,10 @@ ovsdb_log_unread(struct ovsdb_log *file) file->offset = file->prev_offset; } +/* Writes log record 'json' to 'file'. Returns NULL if successful or an error + * (which the caller must eventually destroy) on failure. */ struct ovsdb_error * -ovsdb_log_write(struct ovsdb_log *file, struct json *json) +ovsdb_log_write(struct ovsdb_log *file, const struct json *json) { uint8_t sha1[SHA1_DIGEST_SIZE]; struct ovsdb_error *error; diff --git a/ovsdb/log.h b/ovsdb/log.h index fbcea1f2b991..fd495e518dd0 100644 --- a/ovsdb/log.h +++ b/ovsdb/log.h @@ -41,7 +41,7 @@ struct ovsdb_error *ovsdb_log_read(struct ovsdb_log *, struct json **) OVS_WARN_UNUSED_RESULT; void ovsdb_log_unread(struct ovsdb_log *); -struct ovsdb_error *ovsdb_log_write(struct ovsdb_log *, struct json *) +struct ovsdb_error *ovsdb_log_write(struct ovsdb_log *, const struct json *) OVS_WARN_UNUSED_RESULT; struct ovsdb_error *ovsdb_log_commit(struct ovsdb_log *) OVS_WARN_UNUSED_RESULT;