mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-protocol: Drop unused protocol data structures
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
66694d8926
commit
0772cf45b4
@ -800,16 +800,6 @@ struct ctdb_key_data {
|
||||
TDB_DATA key;
|
||||
};
|
||||
|
||||
struct ctdb_uint8_array {
|
||||
int num;
|
||||
uint8_t *val;
|
||||
};
|
||||
|
||||
struct ctdb_uint64_array {
|
||||
int num;
|
||||
uint64_t *val;
|
||||
};
|
||||
|
||||
struct ctdb_db_statistics {
|
||||
struct {
|
||||
uint32_t num_calls;
|
||||
@ -876,7 +866,6 @@ struct ctdb_req_control_data {
|
||||
uint64_t srvid;
|
||||
struct ctdb_iface *iface;
|
||||
struct ctdb_key_data *key;
|
||||
struct ctdb_uint64_array *u64_array;
|
||||
struct ctdb_traverse_start_ext *traverse_start_ext;
|
||||
struct ctdb_traverse_all_ext *traverse_all_ext;
|
||||
} data;
|
||||
@ -910,7 +899,6 @@ struct ctdb_reply_control_data {
|
||||
struct ctdb_public_ip_info *ipinfo;
|
||||
struct ctdb_iface_list *iface_list;
|
||||
struct ctdb_statistics_list *stats_list;
|
||||
struct ctdb_uint8_array *u8_array;
|
||||
struct ctdb_db_statistics *dbstats;
|
||||
enum ctdb_runstate runstate;
|
||||
uint32_t num_records;
|
||||
|
@ -42,16 +42,6 @@ void ctdb_double_push(double val, uint8_t *buf);
|
||||
int ctdb_double_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
double *out);
|
||||
|
||||
size_t ctdb_uint8_array_len(struct ctdb_uint8_array *array);
|
||||
void ctdb_uint8_array_push(struct ctdb_uint8_array *array, uint8_t *buf);
|
||||
int ctdb_uint8_array_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_uint8_array **out);
|
||||
|
||||
size_t ctdb_uint64_array_len(struct ctdb_uint64_array *array);
|
||||
void ctdb_uint64_array_push(struct ctdb_uint64_array *array, uint8_t *buf);
|
||||
int ctdb_uint64_array_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_uint64_array **out);
|
||||
|
||||
size_t ctdb_pid_len(pid_t pid);
|
||||
void ctdb_pid_push(pid_t pid, uint8_t *buf);
|
||||
int ctdb_pid_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
|
@ -111,84 +111,6 @@ int ctdb_double_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t ctdb_uint8_array_len(struct ctdb_uint8_array *array)
|
||||
{
|
||||
return array->num * sizeof(uint8_t);
|
||||
}
|
||||
|
||||
void ctdb_uint8_array_push(struct ctdb_uint8_array *array, uint8_t *buf)
|
||||
{
|
||||
if (array->num > 0) {
|
||||
memcpy(buf, array->val, array->num * sizeof(uint8_t));
|
||||
}
|
||||
}
|
||||
|
||||
int ctdb_uint8_array_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_uint8_array **out)
|
||||
{
|
||||
struct ctdb_uint8_array *array;
|
||||
|
||||
array = talloc(mem_ctx, struct ctdb_uint8_array);
|
||||
if (array == NULL) {
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
array->num = buflen / sizeof(uint8_t);
|
||||
|
||||
if (array->num > 0) {
|
||||
array->val = talloc_array(array, uint8_t, array->num);
|
||||
if (array->val == NULL) {
|
||||
talloc_free(array);
|
||||
return ENOMEM;
|
||||
}
|
||||
memcpy(array->val, buf, buflen);
|
||||
} else {
|
||||
array->val = NULL;
|
||||
}
|
||||
|
||||
*out = array;
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t ctdb_uint64_array_len(struct ctdb_uint64_array *array)
|
||||
{
|
||||
return array->num * sizeof(uint64_t);
|
||||
}
|
||||
|
||||
void ctdb_uint64_array_push(struct ctdb_uint64_array *array, uint8_t *buf)
|
||||
{
|
||||
if (array->num > 0) {
|
||||
memcpy(buf, array->val, array->num * sizeof(uint64_t));
|
||||
}
|
||||
}
|
||||
|
||||
int ctdb_uint64_array_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_uint64_array **out)
|
||||
{
|
||||
struct ctdb_uint64_array *array;
|
||||
|
||||
array = talloc(mem_ctx, struct ctdb_uint64_array);
|
||||
if (array == NULL) {
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
array->num = buflen / sizeof(uint64_t);
|
||||
|
||||
if (array->num > 0) {
|
||||
array->val = talloc_array(array, uint64_t, array->num);
|
||||
if (array->val == NULL) {
|
||||
talloc_free(array);
|
||||
return ENOMEM;
|
||||
}
|
||||
memcpy(array->val, buf, buflen);
|
||||
} else {
|
||||
array->val = NULL;
|
||||
}
|
||||
|
||||
*out = array;
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t ctdb_pid_len(pid_t pid)
|
||||
{
|
||||
return sizeof(pid_t);
|
||||
|
@ -830,64 +830,6 @@ static void verify_ctdb_key_data(struct ctdb_key_data *p1,
|
||||
verify_tdb_data(&p1->key, &p2->key);
|
||||
}
|
||||
|
||||
static void fill_ctdb_uint8_array(TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_uint8_array *p)
|
||||
{
|
||||
int i;
|
||||
|
||||
p->num = rand_int(1024);
|
||||
if (p->num > 0) {
|
||||
p->val = talloc_array(mem_ctx, uint8_t, p->num);
|
||||
assert(p->val != NULL);
|
||||
|
||||
for (i=0; i<p->num; i++) {
|
||||
p->val[i] = rand8();
|
||||
}
|
||||
} else {
|
||||
p->val = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void verify_ctdb_uint8_array(struct ctdb_uint8_array *p1,
|
||||
struct ctdb_uint8_array *p2)
|
||||
{
|
||||
int i;
|
||||
|
||||
assert(p1->num == p2->num);
|
||||
for (i=0; i<p1->num; i++) {
|
||||
assert(p1->val[i] == p2->val[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_ctdb_uint64_array(TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_uint64_array *p)
|
||||
{
|
||||
int i;
|
||||
|
||||
p->num = rand_int(1024);
|
||||
if (p->num > 0) {
|
||||
p->val = talloc_array(mem_ctx, uint64_t, p->num);
|
||||
assert(p->val != NULL);
|
||||
|
||||
for (i=0; i<p->num; i++) {
|
||||
p->val[i] = rand64();
|
||||
}
|
||||
} else {
|
||||
p->val = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void verify_ctdb_uint64_array(struct ctdb_uint64_array *p1,
|
||||
struct ctdb_uint64_array *p2)
|
||||
{
|
||||
int i;
|
||||
|
||||
assert(p1->num == p2->num);
|
||||
for (i=0; i<p1->num; i++) {
|
||||
assert(p1->val[i] == p2->val[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_ctdb_db_statistics(TALLOC_CTX *mem_ctx,
|
||||
struct ctdb_db_statistics *p)
|
||||
{
|
||||
@ -1319,8 +1261,6 @@ DEFINE_TEST(struct ctdb_iface_list, ctdb_iface_list);
|
||||
DEFINE_TEST(struct ctdb_public_ip_info, ctdb_public_ip_info);
|
||||
DEFINE_TEST(struct ctdb_statistics_list, ctdb_statistics_list);
|
||||
DEFINE_TEST(struct ctdb_key_data, ctdb_key_data);
|
||||
DEFINE_TEST(struct ctdb_uint8_array, ctdb_uint8_array);
|
||||
DEFINE_TEST(struct ctdb_uint64_array, ctdb_uint64_array);
|
||||
DEFINE_TEST(struct ctdb_db_statistics, ctdb_db_statistics);
|
||||
DEFINE_TEST(struct ctdb_election_message, ctdb_election_message);
|
||||
DEFINE_TEST(struct ctdb_srvid_message, ctdb_srvid_message);
|
||||
@ -1435,8 +1375,6 @@ int main(int argc, char *argv[])
|
||||
TEST_FUNC(ctdb_public_ip_info)();
|
||||
TEST_FUNC(ctdb_statistics_list)();
|
||||
TEST_FUNC(ctdb_key_data)();
|
||||
TEST_FUNC(ctdb_uint8_array)();
|
||||
TEST_FUNC(ctdb_uint64_array)();
|
||||
TEST_FUNC(ctdb_db_statistics)();
|
||||
TEST_FUNC(ctdb_election_message)();
|
||||
TEST_FUNC(ctdb_srvid_message)();
|
||||
|
Loading…
Reference in New Issue
Block a user