more include file cleanup for the general system.
Index: include/corosync/ipc_pload.h
===================================================================
--- include/corosync/ipc_pload.h (revision 2131)
+++ include/corosync/ipc_pload.h (working copy)
@@ -35,13 +35,7 @@
#define IPC_PLOAD_H_DEFINED
#include <corosync/corotypes.h>
-#include <corosync/coroipc_types.h>
-#include <corosync/coroipcc.h>
-#include <corosync/corodefs.h>
-
-#include <corosync/pload.h>
#include <corosync/mar_gen.h>
-#include <corosync/ipc_pload.h>
enum req_lib_evs_types {
MESSAGE_REQ_PLOAD_START = 0,
Index: include/corosync/ipc_cfg.h
===================================================================
--- include/corosync/ipc_cfg.h (revision 2131)
+++ include/corosync/ipc_cfg.h (working copy)
@@ -37,6 +37,7 @@
#include <netinet/in.h>
#include <corosync/corotypes.h>
+#include <corosync/mar_gen.h>
enum req_lib_cfg_types {
MESSAGE_REQ_CFG_RINGSTATUSGET = 0,
Index: include/corosync/corodefs.h
===================================================================
--- include/corosync/corodefs.h (revision 2131)
+++ include/corosync/corodefs.h (working copy)
@@ -40,10 +40,6 @@
#define COROSYNC_SOCKET_NAME "corosync.ipc"
-#define IPC_REQUEST_SIZE 8192*128
-#define IPC_RESPONSE_SIZE 8192*128
-#define IPC_DISPATCH_SIZE 8192*128
-
enum corosync_service_types {
EVS_SERVICE = 0,
CLM_SERVICE = 1,
Index: include/corosync/ipc_cpg.h
===================================================================
--- include/corosync/ipc_cpg.h (revision 2131)
+++ include/corosync/ipc_cpg.h (working copy)
@@ -37,6 +37,7 @@
#include <netinet/in.h>
#include <corosync/corotypes.h>
+#include <corosync/mar_gen.h>
enum req_cpg_types {
MESSAGE_REQ_CPG_JOIN = 0,
@@ -66,6 +67,65 @@
CONFCHG_CPG_REASON_PROCDOWN = 5
};
+typedef struct {
+ uint32_t length __attribute__((aligned(8)));
+ char value[CPG_MAX_NAME_LENGTH] __attribute__((aligned(8)));
+} mar_cpg_name_t;
+
+static inline void swab_mar_cpg_name_t (mar_cpg_name_t *to_swab)
+{
+ swab_mar_uint32_t (&to_swab->length);
+}
+
+static inline void marshall_from_mar_cpg_name_t (
+ struct cpg_name *dest,
+ const mar_cpg_name_t *src)
+{
+ dest->length = src->length;
+ memcpy (&dest->value, &src->value, CPG_MAX_NAME_LENGTH);
+}
+
+static inline void marshall_to_mar_cpg_name_t (
+ mar_cpg_name_t *dest,
+ const struct cpg_name *src)
+{
+ dest->length = src->length;
+ memcpy (&dest->value, &src->value, CPG_MAX_NAME_LENGTH);
+}
+
+typedef struct {
+ mar_uint32_t nodeid __attribute__((aligned(8)));
+ mar_uint32_t pid __attribute__((aligned(8)));
+ mar_uint32_t reason __attribute__((aligned(8)));
+} mar_cpg_address_t;
+
+static inline void marshall_from_mar_cpg_address_t (
+ struct cpg_address *dest,
+ const mar_cpg_address_t *src)
+{
+ dest->nodeid = src->nodeid;
+ dest->pid = src->pid;
+ dest->reason = src->reason;
+}
+
+static inline void marshall_to_mar_cpg_address_t (
+ mar_cpg_address_t *dest,
+ const struct cpg_address *src)
+{
+ dest->nodeid = src->nodeid;
+ dest->pid = src->pid;
+ dest->reason = src->reason;
+}
+
+static inline int mar_name_compare (
+ const mar_cpg_name_t *g1,
+ const mar_cpg_name_t *g2)
+{
+ return (g1->length == g2->length?
+ memcmp (g1->value, g2->value, g1->length):
+ g1->length - g2->length);
+}
+
struct req_lib_cpg_join {
coroipc_request_header_t header __attribute__((aligned(8)));
mar_cpg_name_t group_name __attribute__((aligned(8)));
Index: include/corosync/mar_gen.h
===================================================================
--- include/corosync/mar_gen.h (revision 2131)
+++ include/corosync/mar_gen.h (working copy)
@@ -184,19 +184,4 @@
swab_mar_int32_t (&to_swab->id);
}
-typedef struct {
- uint32_t nodeid __attribute__((aligned(8)));
- void *conn __attribute__((aligned(8)));
-} mar_message_source_t __attribute__((aligned(8)));
-
-static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
-{
- swab_mar_uint32_t (&to_swab->nodeid);
- /*
- * if it is from a byteswapped machine, then we can safely
- * ignore its conn info data structure since this is only
- * local to the machine
- */
- to_swab->conn = NULL;
-}
#endif /* MAR_GEN_H_DEFINED */
Index: include/corosync/ipc_evs.h
===================================================================
--- include/corosync/ipc_evs.h (revision 2131)
+++ include/corosync/ipc_evs.h (working copy)
@@ -34,8 +34,9 @@
#ifndef IPC_EVS_H_DEFINED
#define IPC_EVS_H_DEFINED
+#include <inttypes.h>
#include <corosync/corotypes.h>
-#include "evs.h"
+#include <corosync/mar_gen.h>
enum req_lib_evs_types {
MESSAGE_REQ_EVS_JOIN = 0,
Index: include/corosync/evs.h
===================================================================
--- include/corosync/evs.h (revision 2131)
+++ include/corosync/evs.h (working copy)
@@ -1,5 +1,4 @@
-/*
- * Copyright (c) 2004 MontaVista Software, Inc.
+/* * Copyright (c) 2004 MontaVista Software, Inc.
*
* All rights reserved.
*
@@ -34,7 +33,7 @@
#ifndef COROSYNC_EVS_H_DEFINED
#define COROSYNC_EVS_H_DEFINED
-#include <sys/types.h>
+#include <inttypes.h>
#include <netinet/in.h>
#include <corosync/corotypes.h>
Index: include/corosync/mar_cpg.h
===================================================================
--- include/corosync/mar_cpg.h (revision 2131)
+++ include/corosync/mar_cpg.h (working copy)
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2006-2009 Red Hat, Inc.
- * Author: Patrick Caulfield ([email protected])
- *
- * All rights reserved.
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef MAR_CPG_H_DEFINED
-#define MAR_CPG_H_DEFINED
-
-#include "cpg.h"
-#include "swab.h"
-
-typedef struct {
- uint32_t length __attribute__((aligned(8)));
- char value[CPG_MAX_NAME_LENGTH] __attribute__((aligned(8)));
-} mar_cpg_name_t;
-
-static inline void swab_mar_cpg_name_t (mar_cpg_name_t *to_swab)
-{
- swab_mar_uint32_t (&to_swab->length);
-}
-
-static inline void marshall_from_mar_cpg_name_t (
- struct cpg_name *dest,
- const mar_cpg_name_t *src)
-{
- dest->length = src->length;
- memcpy (&dest->value, &src->value, CPG_MAX_NAME_LENGTH);
-}
-
-static inline void marshall_to_mar_cpg_name_t (
- mar_cpg_name_t *dest,
- const struct cpg_name *src)
-{
- dest->length = src->length;
- memcpy (&dest->value, &src->value, CPG_MAX_NAME_LENGTH);
-}
-
-typedef struct {
- mar_uint32_t nodeid __attribute__((aligned(8)));
- mar_uint32_t pid __attribute__((aligned(8)));
- mar_uint32_t reason __attribute__((aligned(8)));
-} mar_cpg_address_t;
-
-static inline void marshall_from_mar_cpg_address_t (
- struct cpg_address *dest,
- const mar_cpg_address_t *src)
-{
- dest->nodeid = src->nodeid;
- dest->pid = src->pid;
- dest->reason = src->reason;
-}
-
-static inline void marshall_to_mar_cpg_address_t (
- mar_cpg_address_t *dest,
- const struct cpg_address *src)
-{
- dest->nodeid = src->nodeid;
- dest->pid = src->pid;
- dest->reason = src->reason;
-}
-
-static inline int mar_name_compare (
- const mar_cpg_name_t *g1,
- const mar_cpg_name_t *g2)
-{
- return (g1->length == g2->length?
- memcmp (g1->value, g2->value, g1->length):
- g1->length - g2->length);
-}
-
-#endif /* MAR_CPG_H_DEFINED */
Index: include/corosync/engine/coroapi.h
===================================================================
--- include/corosync/engine/coroapi.h (revision 2131)
+++ include/corosync/engine/coroapi.h (working copy)
@@ -39,7 +39,23 @@
#include <sys/uio.h>
#endif
#include <corosync/hdb.h>
+#include <corosync/swab.h>
+typedef struct {
+ uint32_t nodeid __attribute__((aligned(8)));
+ void *conn __attribute__((aligned(8)));
+} mar_message_source_t __attribute__((aligned(8)));
+
+static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
+{
+ swab32 (to_swab->nodeid);
+ /*
+ * if it is from a byteswapped machine, then we can safely
+ * ignore its conn info data structure since this is only
+ * local to the machine
+ */
+ to_swab->conn = NULL;
+}
typedef void * corosync_timer_handle_t;
struct corosync_tpg_group {
Index: include/corosync/ipc_votequorum.h
===================================================================
--- include/corosync/ipc_votequorum.h (revision 2131)
+++ include/corosync/ipc_votequorum.h (working copy)
@@ -34,6 +34,8 @@
#ifndef IPC_VOTEQUORUM_H_DEFINED
#define IPC_VOTEQUORUM_H_DEFINED
+#include <corosync/corotypes.h>
+#include <corosync/mar_gen.h>
#define VOTEQUORUM_MAX_QDISK_NAME_LEN 255
enum req_votequorum_types {
Index: include/corosync/ipc_quorum.h
===================================================================
--- include/corosync/ipc_quorum.h (revision 2131)
+++ include/corosync/ipc_quorum.h (working copy)
@@ -35,6 +35,7 @@
#define IPC_QUORUM_H_DEFINED
#include <corosync/corotypes.h>
+#include <corosync/mar_gen.h>
enum req_quorum_types {
MESSAGE_REQ_QUORUM_GETQUORATE = 0,
Index: include/corosync/ipc_confdb.h
===================================================================
--- include/corosync/ipc_confdb.h (revision 2131)
+++ include/corosync/ipc_confdb.h (working copy)
@@ -36,6 +36,7 @@
#include <netinet/in.h>
#include <corosync/corotypes.h>
+#include <corosync/mar_gen.h>
enum req_confdb_types {
MESSAGE_REQ_CONFDB_OBJECT_CREATE = 0,
Index: include/Makefile.am
===================================================================
--- include/Makefile.am (revision 2131)
+++ include/Makefile.am (working copy)
@@ -35,7 +35,7 @@
coroipcc.h coroipcs.h coroipc_types.h corodefs.h confdb.h list.h corotypes.h quorum.h votequorum.h
CS_INTERNAL_H = ipc_cfg.h ipc_confdb.h ipc_cpg.h ipc_evs.h ipc_pload.h ipc_quorum.h \
- jhash.h mar_cpg.h pload.h queue.h quorum.h rmd.h sq.h ipc_votequorum.h coroipc_ipc.h
+ jhash.h pload.h queue.h quorum.h rmd.h sq.h ipc_votequorum.h coroipc_ipc.h
LCR_H = lcr_ckpt.h lcr_comp.h lcr_ifact.h
Index: services/cpg.c
===================================================================
--- services/cpg.c (revision 2131)
+++ services/cpg.c (working copy)
@@ -61,13 +61,13 @@
#include <corosync/list.h>
#include <corosync/queue.h>
#include <corosync/jhash.h>
-#include <corosync/mar_gen.h>
-#include <corosync/mar_cpg.h>
-#include <corosync/ipc_cpg.h>
#include <corosync/lcr/lcr_comp.h>
#include <corosync/engine/logsys.h>
#include <corosync/engine/coroapi.h>
+#include <corosync/cpg.h>
+#include <corosync/ipc_cpg.h>
+
LOGSYS_DECLARE_SUBSYS ("CPG");
#define GROUP_HASH_SIZE 32
Index: services/evs.c
===================================================================
--- services/evs.c (revision 2131)
+++ services/evs.c (working copy)
@@ -58,10 +58,12 @@
#include <corosync/mar_gen.h>
#include <corosync/lcr/lcr_comp.h>
#include <corosync/engine/coroapi.h>
-#include <corosync/ipc_evs.h>
+#include <corosync/engine/logsys.h>
#include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/evs.h>
+#include <corosync/ipc_evs.h>
+
LOGSYS_DECLARE_SUBSYS ("EVS");
enum evs_exec_message_req_types {
Index: exec/apidef.c
===================================================================
--- exec/apidef.c (revision 2131)
+++ exec/apidef.c (working copy)
@@ -40,21 +40,20 @@
#include <corosync/corotypes.h>
#include <corosync/coroipc_types.h>
-#include <corosync/swab.h>
-#include <corosync/totem/totem.h>
-#include "util.h"
-#include <corosync/engine/logsys.h>
-#include "timer.h"
+#include <corosync/lcr/lcr_ifact.h>
#include <corosync/totem/totempg.h>
#include <corosync/totem/totemip.h>
-#include "main.h"
+#include <corosync/totem/totem.h>
+#include <corosync/engine/logsys.h>
#include <corosync/coroipcs.h>
+#include "util.h"
+#include "timer.h"
#include "sync.h"
#include "quorum.h"
-#include <corosync/engine/coroapi.h>
#include "service.h"
#include "schedwrk.h"
-#include <corosync/lcr/lcr_ifact.h>
+#include "main.h"
+#include <corosync/engine/coroapi.h>
#include "apidef.h"
LOGSYS_DECLARE_SUBSYS ("APIDEF");
Index: exec/main.h
===================================================================
--- exec/main.h (revision 2131)
+++ exec/main.h (working copy)
@@ -43,7 +43,7 @@
#include <corosync/totem/totempg.h>
#include <corosync/engine/objdb.h>
#include <corosync/engine/config.h>
-#include <corosync/mar_gen.h>
+#include <corosync/engine/coroapi.h>
extern struct totempg_group corosync_group;
Index: lib/cfg.c
===================================================================
--- lib/cfg.c (revision 2131)
+++ lib/cfg.c (working copy)
@@ -48,19 +48,15 @@
#include <sys/select.h>
#include <sys/un.h>
-
#include <corosync/corotypes.h>
#include <corosync/coroipc_types.h>
#include <corosync/coroipcc.h>
#include <corosync/corodefs.h>
+#include <corosync/hdb.h>
#include <corosync/cfg.h>
-#include <corosync/mar_gen.h>
#include <corosync/ipc_cfg.h>
-#include <corosync/hdb.h>
-#include <corosync/totem/totemip.h>
-
#include "util.h"
/*
Index: lib/pload.c
===================================================================
--- lib/pload.c (revision 2131)
+++ lib/pload.c (working copy)
@@ -42,14 +42,15 @@
#include <sys/socket.h>
#include <errno.h>
-#include <corosync/swab.h>
-#include <corosync/totem/totem.h>
#include <corosync/corotypes.h>
-#include <corosync/ipc_pload.h>
-#include <corosync/pload.h>
#include <corosync/coroipcc.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
#include <corosync/hdb.h>
+#include <corosync/pload.h>
+#include <corosync/ipc_pload.h>
+
#include "util.h"
static void pload_instance_destructor (void *instance);
Index: lib/cpg.c
===================================================================
--- lib/cpg.c (revision 2131)
+++ lib/cpg.c (working copy)
@@ -54,8 +54,6 @@
#include <corosync/hdb.h>
#include <corosync/cpg.h>
-#include <corosync/mar_gen.h>
-#include <corosync/mar_cpg.h>
#include <corosync/ipc_cpg.h>
#include "util.h"
Index: lib/util.h
===================================================================
--- lib/util.h (revision 2131)
+++ lib/util.h (working copy)
@@ -53,5 +53,8 @@
} \
}
+#define IPC_REQUEST_SIZE 8192*128
+#define IPC_RESPONSE_SIZE 8192*128
+#define IPC_DISPATCH_SIZE 8192*128
#endif /* AIS_UTIL_H_DEFINED */
Index: lib/votequorum.c
===================================================================
--- lib/votequorum.c (revision 2131)
+++ lib/votequorum.c (working copy)
@@ -54,9 +54,7 @@
#include <corosync/hdb.h>
#include <corosync/votequorum.h>
-#include <corosync/mar_gen.h>
#include <corosync/ipc_votequorum.h>
-#include <corosync/mar_gen.h>
#include "util.h"
Index: lib/quorum.c
===================================================================
--- lib/quorum.c (revision 2131)
+++ lib/quorum.c (working copy)
@@ -52,8 +52,6 @@
#include <corosync/hdb.h>
#include <corosync/quorum.h>
-#include <corosync/mar_gen.h>
-#include <corosync/mar_cpg.h>
#include <corosync/ipc_quorum.h>
#include "util.h"
Index: lib/confdb.c
===================================================================
--- lib/confdb.c (revision 2131)
+++ lib/confdb.c (working copy)
@@ -44,16 +44,15 @@
#include <sys/types.h>
#include <errno.h>
-
#include <corosync/corotypes.h>
#include <corosync/coroipc_types.h>
#include <corosync/coroipcc.h>
#include <corosync/corodefs.h>
+#include <corosync/hdb.h>
+#include <corosync/list.h>
-#include <corosync/mar_gen.h>
#include <corosync/confdb.h>
#include <corosync/ipc_confdb.h>
-#include <corosync/list.h>
#include "util.h"
Index: lib/evs.c
===================================================================
--- lib/evs.c (revision 2131)
+++ lib/evs.c (working copy)
@@ -56,7 +56,6 @@
#include <corosync/hdb.h>
#include <corosync/evs.h>
-#include <corosync/mar_gen.h>
#include <corosync/ipc_evs.h>
#include "util.h"
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais