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>
/*
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,
/*
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,
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,
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;
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) {
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,
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;
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 {
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:
#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];
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);
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),
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,
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,
{
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"));
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;
}
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);
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();
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();
{
uint32_t status = 0;
int ret;
- struct ctdb_server_id server_id;
+ struct ctdb_client_id server_id;
if (argc < 3) {
usage();