1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdb-daemon: Rename struct ctdb_server_id to ctdb_client_id

This is to avoid clash with samba structure server_id.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2015-10-28 17:47:03 +11:00 committed by Martin Schwenke
parent 22c84ff746
commit d858c210a7
6 changed files with 35 additions and 37 deletions

View File

@ -3205,15 +3205,15 @@ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb,
/*
register a server id
*/
int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
struct ctdb_server_id *id)
int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
struct ctdb_client_id *id)
{
TDB_DATA data;
int32_t res;
int ret;
data.dsize = sizeof(struct ctdb_server_id);
data.dsize = sizeof(struct ctdb_client_id);
data.dptr = (unsigned char *)id;
ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0,
@ -3231,15 +3231,15 @@ int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
/*
unregister a server id
*/
int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
struct ctdb_server_id *id)
int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
struct ctdb_client_id *id)
{
TDB_DATA data;
int32_t res;
int ret;
data.dsize = sizeof(struct ctdb_server_id);
data.dsize = sizeof(struct ctdb_client_id);
data.dptr = (unsigned char *)id;
ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0,
@ -3260,17 +3260,15 @@ int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
if a server id does exist, return *status == 1, otherwise *status == 0
*/
int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
uint32_t destnode,
struct ctdb_server_id *id,
uint32_t *status)
int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
struct ctdb_client_id *id, uint32_t *status)
{
TDB_DATA data;
int32_t res;
int ret;
data.dsize = sizeof(struct ctdb_server_id);
data.dsize = sizeof(struct ctdb_client_id);
data.dptr = (unsigned char *)id;
ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_CHECK_SERVER_ID,
@ -3874,7 +3872,7 @@ static bool ctdb_server_id_equal(struct server_id *id1, struct server_id *id2)
static bool server_id_exists(struct ctdb_context *ctdb, struct server_id *id)
{
struct ctdb_server_id sid;
struct ctdb_client_id sid;
int ret;
uint32_t result = 0;
@ -4135,7 +4133,7 @@ struct ctdb_transaction_handle *ctdb_transaction_start(struct ctdb_db_context *c
TALLOC_CTX *mem_ctx)
{
struct ctdb_transaction_handle *h;
struct ctdb_server_id id;
struct ctdb_client_id id;
h = talloc_zero(mem_ctx, struct ctdb_transaction_handle);
if (h == NULL) {

View File

@ -421,13 +421,13 @@ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb,
int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
struct ctdb_server_id *id);
struct ctdb_client_id *id);
int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
struct timeval timeout,
struct ctdb_server_id *id);
struct ctdb_client_id *id);
int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
struct ctdb_server_id *id, uint32_t *status);
struct ctdb_client_id *id, uint32_t *status);
int ctdb_ctrl_get_server_id_list(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout, uint32_t destnode,

View File

@ -790,7 +790,7 @@ enum ctdb_client_id_type {
SERVER_TYPE_ISCSID=3
};
struct ctdb_server_id {
struct ctdb_client_id {
enum ctdb_client_id_type type;
uint32_t pnn;
uint32_t server_id;
@ -798,7 +798,7 @@ struct ctdb_server_id {
struct ctdb_server_id_list {
uint32_t num;
struct ctdb_server_id server_ids[1];
struct ctdb_client_id server_ids[1];
};
struct ctdb_uptime {

View File

@ -420,15 +420,15 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
return ctdb_control_set_tcp_tickle_list(ctdb, indata);
case CTDB_CONTROL_REGISTER_SERVER_ID:
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_server_id));
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_id));
return ctdb_control_register_server_id(ctdb, client_id, indata);
case CTDB_CONTROL_UNREGISTER_SERVER_ID:
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_server_id));
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_id));
return ctdb_control_unregister_server_id(ctdb, indata);
case CTDB_CONTROL_CHECK_SERVER_ID:
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_server_id));
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_id));
return ctdb_control_check_server_id(ctdb, indata);
case CTDB_CONTROL_GET_SERVER_ID_LIST:

View File

@ -32,7 +32,7 @@
#define SERVER_ID_KEY_SIZE 3
static uint32_t *get_server_id_key(struct ctdb_server_id *server_id)
static uint32_t *get_server_id_key(struct ctdb_client_id *server_id)
{
static uint32_t key[SERVER_ID_KEY_SIZE];
@ -67,7 +67,7 @@ int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
uint32_t client_id,
TDB_DATA indata)
{
struct ctdb_server_id *server_id;
struct ctdb_client_id *server_id;
struct ctdb_client *client = reqid_find(ctdb->idr, client_id, struct ctdb_client);
@ -82,9 +82,9 @@ int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
when the structure is free'd it will be automatically
removed from the tree
*/
server_id = talloc_zero(client, struct ctdb_server_id);
server_id = talloc_zero(client, struct ctdb_client_id);
CTDB_NO_MEMORY(ctdb, server_id);
memcpy(server_id, indata.dptr, sizeof(struct ctdb_server_id));
memcpy(server_id, indata.dptr, sizeof(struct ctdb_client_id));
trbt_insertarray32_callback(ctdb->server_ids, SERVER_ID_KEY_SIZE,
get_server_id_key(server_id),
@ -100,7 +100,7 @@ int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
int32_t ctdb_control_check_server_id(struct ctdb_context *ctdb,
TDB_DATA indata)
{
struct ctdb_server_id *server_id = (struct ctdb_server_id *)indata.dptr;
struct ctdb_client_id *server_id = (struct ctdb_client_id *)indata.dptr;
return trbt_lookuparray32(ctdb->server_ids,
SERVER_ID_KEY_SIZE,
@ -113,7 +113,7 @@ int32_t ctdb_control_check_server_id(struct ctdb_context *ctdb,
int32_t ctdb_control_unregister_server_id(struct ctdb_context *ctdb,
TDB_DATA indata)
{
struct ctdb_server_id *server_id = (struct ctdb_server_id *)indata.dptr;
struct ctdb_client_id *server_id = (struct ctdb_client_id *)indata.dptr;
talloc_free(trbt_lookuparray32(ctdb->server_ids,
SERVER_ID_KEY_SIZE,
@ -147,8 +147,8 @@ static int server_id_store(void *param, void *data)
{
struct count_server_ids *svid = talloc_get_type(param,
struct count_server_ids);
struct ctdb_server_id *server_id = talloc_get_type(data,
struct ctdb_server_id);
struct ctdb_client_id *server_id = talloc_get_type(data,
struct ctdb_client_id);
if (svid == NULL) {
DEBUG(DEBUG_ERR, (__location__ " Got null pointer for svid\n"));
@ -160,7 +160,7 @@ static int server_id_store(void *param, void *data)
return -1;
}
memcpy(&svid->list->server_ids[svid->count], server_id, sizeof(struct ctdb_server_id));
memcpy(&svid->list->server_ids[svid->count], server_id, sizeof(struct ctdb_client_id));
svid->count++;
return 0;
}
@ -184,7 +184,7 @@ int32_t ctdb_control_get_server_id_list(struct ctdb_context *ctdb, TDB_DATA *out
outdata->dsize = offsetof(struct ctdb_server_id_list,
server_ids)
+ sizeof(struct ctdb_server_id) * svid->count;
+ sizeof(struct ctdb_client_id) * svid->count;
outdata->dptr = talloc_size(outdata, outdata->dsize);
CTDB_NO_MEMORY(ctdb, outdata->dptr);

View File

@ -2788,7 +2788,7 @@ static int control_gratious_arp(struct ctdb_context *ctdb, int argc, const char
static int regsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
struct ctdb_server_id server_id;
struct ctdb_client_id server_id;
if (argc < 3) {
usage();
@ -2814,7 +2814,7 @@ static int regsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
static int unregsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
struct ctdb_server_id server_id;
struct ctdb_client_id server_id;
if (argc < 3) {
usage();
@ -2839,7 +2839,7 @@ static int chksrvid(struct ctdb_context *ctdb, int argc, const char **argv)
{
uint32_t status = 0;
int ret;
struct ctdb_server_id server_id;
struct ctdb_client_id server_id;
if (argc < 3) {
usage();