votequorum: clean up coding style

first pass to bring votequorum at corosync codying style.

fix whitespaces, add missing {}, fix comments, be consistent with
ENTER/LEAVE usage, be consistent with some functions variable names
and some more cosmetic changes

Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
This commit is contained in:
Fabio M. Di Nitto 2012-01-05 13:19:49 +01:00
parent c34ae1e846
commit b3949957f3
3 changed files with 334 additions and 179 deletions

View File

@ -1,9 +1,10 @@
/*
* Copyright (c) 2009 Red Hat, Inc.
* Copyright (c) 2009-2011 Red Hat, Inc.
*
* All rights reserved.
*
* Author: Christine Caulfield (ccaulfie@redhat.com)
* Authors: Christine Caulfield (ccaulfie@redhat.com)
* Fabio M. Di Nitto (fdinitto@redhat.com)
*
* This software licensed under BSD license, the text of which follows:
*
@ -62,35 +63,35 @@ enum res_votequorum_types {
};
struct req_lib_votequorum_setvotes {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
unsigned int votes;
int nodeid;
};
struct req_lib_votequorum_qdisk_register {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
unsigned int votes;
char name[VOTEQUORUM_MAX_QDISK_NAME_LEN];
};
struct req_lib_votequorum_qdisk_poll {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
int state;
};
struct req_lib_votequorum_setexpected {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
unsigned int expected_votes;
};
struct req_lib_votequorum_trackstart {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
uint64_t context;
unsigned int track_flags;
};
struct req_lib_votequorum_general {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
};
#define VOTEQUORUM_REASON_KILL_REJECTED 1
@ -98,12 +99,12 @@ struct req_lib_votequorum_general {
#define VOTEQUORUM_REASON_KILL_REJOIN 3
struct req_lib_votequorum_getinfo {
struct qb_ipc_request_header header __attribute__((aligned(8)));
struct qb_ipc_request_header header __attribute__((aligned(8)));
int nodeid;
};
struct res_lib_votequorum_status {
struct qb_ipc_response_header header __attribute__((aligned(8)));
struct qb_ipc_response_header header __attribute__((aligned(8)));
};
#define VOTEQUORUM_INFO_FLAG_HASSTATE 1
@ -111,7 +112,7 @@ struct res_lib_votequorum_status {
#define VOTEQUORUM_INFO_FLAG_QUORATE 4
struct res_lib_votequorum_getinfo {
struct qb_ipc_response_header header __attribute__((aligned(8)));
struct qb_ipc_response_header header __attribute__((aligned(8)));
int nodeid;
unsigned int votes;
unsigned int expected_votes;
@ -122,7 +123,7 @@ struct res_lib_votequorum_getinfo {
};
struct res_lib_votequorum_qdisk_getinfo {
struct qb_ipc_response_header header __attribute__((aligned(8)));
struct qb_ipc_response_header header __attribute__((aligned(8)));
unsigned int votes;
unsigned int state;
char name[VOTEQUORUM_MAX_QDISK_NAME_LEN];

View File

@ -1,9 +1,10 @@
/*
* Copyright (c) 2009 Red Hat, Inc.
* Copyright (c) 2009-2011 Red Hat, Inc.
*
* All rights reserved.
*
* Author: Christine Caulfield (ccaulfie@redhat.com)
* Authors: Christine Caulfield (ccaulfie@redhat.com)
* Fabio M. Di Nitto (fdinitto@redhat.com)
*
* This software licensed under BSD license, the text of which follows:
*
@ -78,20 +79,17 @@ typedef struct {
uint32_t state;
} votequorum_node_t;
typedef void (*votequorum_notification_fn_t) (
votequorum_handle_t handle,
uint64_t context,
uint32_t quorate,
uint32_t node_list_entries,
votequorum_node_t node_list[]
);
votequorum_node_t node_list[]);
typedef void (*votequorum_expectedvotes_notification_fn_t) (
votequorum_handle_t handle,
uint64_t context,
uint32_t expected_votes
);
uint32_t expected_votes);
typedef struct {
votequorum_notification_fn_t votequorum_notify_fn;

File diff suppressed because it is too large Load Diff