mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
ctdb-daemon: Rename struct ctdb_control_iface_info to ctdb_iface
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
417077c8a7
commit
c4e9d616ae
@ -2844,7 +2844,7 @@ int ctdb_ctrl_get_public_ip_info(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
info = (struct ctdb_control_public_ip_info *)outdata.dptr;
|
info = (struct ctdb_control_public_ip_info *)outdata.dptr;
|
||||||
len += info->num*sizeof(struct ctdb_control_iface_info);
|
len += info->num*sizeof(struct ctdb_iface);
|
||||||
|
|
||||||
if (len > outdata.dsize) {
|
if (len > outdata.dsize) {
|
||||||
DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get public ip info "
|
DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get public ip info "
|
||||||
@ -2907,7 +2907,7 @@ int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ifaces = (struct ctdb_control_get_ifaces *)outdata.dptr;
|
ifaces = (struct ctdb_control_get_ifaces *)outdata.dptr;
|
||||||
len += ifaces->num*sizeof(struct ctdb_control_iface_info);
|
len += ifaces->num*sizeof(struct ctdb_iface);
|
||||||
|
|
||||||
if (len > outdata.dsize) {
|
if (len > outdata.dsize) {
|
||||||
DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces "
|
DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get ifaces "
|
||||||
@ -2940,7 +2940,7 @@ int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
int ctdb_ctrl_set_iface_link(struct ctdb_context *ctdb,
|
int ctdb_ctrl_set_iface_link(struct ctdb_context *ctdb,
|
||||||
struct timeval timeout, uint32_t destnode,
|
struct timeval timeout, uint32_t destnode,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
const struct ctdb_control_iface_info *info)
|
const struct ctdb_iface *info)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
TDB_DATA indata;
|
TDB_DATA indata;
|
||||||
|
@ -388,7 +388,7 @@ int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
int ctdb_ctrl_set_iface_link(struct ctdb_context *ctdb,
|
int ctdb_ctrl_set_iface_link(struct ctdb_context *ctdb,
|
||||||
struct timeval timeout, uint32_t destnode,
|
struct timeval timeout, uint32_t destnode,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
const struct ctdb_control_iface_info *info);
|
const struct ctdb_iface *info);
|
||||||
|
|
||||||
int ctdb_ctrl_modflags(struct ctdb_context *ctdb,
|
int ctdb_ctrl_modflags(struct ctdb_context *ctdb,
|
||||||
struct timeval timeout,
|
struct timeval timeout,
|
||||||
|
@ -988,7 +988,7 @@ struct ctdb_transdb {
|
|||||||
|
|
||||||
#define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000
|
#define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000
|
||||||
|
|
||||||
struct ctdb_control_iface_info {
|
struct ctdb_iface {
|
||||||
char name[CTDB_IFACE_SIZE+2];
|
char name[CTDB_IFACE_SIZE+2];
|
||||||
uint16_t link_state;
|
uint16_t link_state;
|
||||||
uint32_t references;
|
uint32_t references;
|
||||||
@ -998,12 +998,12 @@ struct ctdb_control_public_ip_info {
|
|||||||
struct ctdb_public_ip ip;
|
struct ctdb_public_ip ip;
|
||||||
uint32_t active_idx;
|
uint32_t active_idx;
|
||||||
uint32_t num;
|
uint32_t num;
|
||||||
struct ctdb_control_iface_info ifaces[1];
|
struct ctdb_iface ifaces[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ctdb_control_get_ifaces {
|
struct ctdb_control_get_ifaces {
|
||||||
uint32_t num;
|
uint32_t num;
|
||||||
struct ctdb_control_iface_info ifaces[1];
|
struct ctdb_iface ifaces[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -664,7 +664,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
|||||||
return ctdb_control_get_ifaces(ctdb, c, outdata);
|
return ctdb_control_get_ifaces(ctdb, c, outdata);
|
||||||
|
|
||||||
case CTDB_CONTROL_SET_IFACE_LINK_STATE:
|
case CTDB_CONTROL_SET_IFACE_LINK_STATE:
|
||||||
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_control_iface_info));
|
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_iface));
|
||||||
return ctdb_control_set_iface_link(ctdb, c, indata);
|
return ctdb_control_set_iface_link(ctdb, c, indata);
|
||||||
|
|
||||||
case CTDB_CONTROL_GET_STAT_HISTORY:
|
case CTDB_CONTROL_GET_STAT_HISTORY:
|
||||||
|
@ -3286,7 +3286,7 @@ static bool interfaces_have_changed(struct ctdb_context *ctdb,
|
|||||||
/* See if interface names or link states have changed */
|
/* See if interface names or link states have changed */
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < rec->ifaces->num; i++) {
|
for (i = 0; i < rec->ifaces->num; i++) {
|
||||||
struct ctdb_control_iface_info * iface = &rec->ifaces->ifaces[i];
|
struct ctdb_iface * iface = &rec->ifaces->ifaces[i];
|
||||||
if (strcmp(iface->name, ifaces->ifaces[i].name) != 0) {
|
if (strcmp(iface->name, ifaces->ifaces[i].name) != 0) {
|
||||||
DEBUG(DEBUG_NOTICE,
|
DEBUG(DEBUG_NOTICE,
|
||||||
("Interface in slot %d changed: %s => %s\n",
|
("Interface in slot %d changed: %s => %s\n",
|
||||||
|
@ -3273,7 +3273,7 @@ int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
len = offsetof(struct ctdb_control_public_ip_info, ifaces) +
|
len = offsetof(struct ctdb_control_public_ip_info, ifaces) +
|
||||||
num*sizeof(struct ctdb_control_iface_info);
|
num*sizeof(struct ctdb_iface);
|
||||||
info = talloc_zero_size(outdata, len);
|
info = talloc_zero_size(outdata, len);
|
||||||
CTDB_NO_MEMORY(ctdb, info);
|
CTDB_NO_MEMORY(ctdb, info);
|
||||||
|
|
||||||
@ -3299,7 +3299,7 @@ int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
info->num = i;
|
info->num = i;
|
||||||
len = offsetof(struct ctdb_control_public_ip_info, ifaces) +
|
len = offsetof(struct ctdb_control_public_ip_info, ifaces) +
|
||||||
i*sizeof(struct ctdb_control_iface_info);
|
i*sizeof(struct ctdb_iface);
|
||||||
|
|
||||||
outdata->dsize = len;
|
outdata->dsize = len;
|
||||||
outdata->dptr = (uint8_t *)info;
|
outdata->dptr = (uint8_t *)info;
|
||||||
@ -3322,7 +3322,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
||||||
num*sizeof(struct ctdb_control_iface_info);
|
num*sizeof(struct ctdb_iface);
|
||||||
ifaces = talloc_zero_size(outdata, len);
|
ifaces = talloc_zero_size(outdata, len);
|
||||||
CTDB_NO_MEMORY(ctdb, ifaces);
|
CTDB_NO_MEMORY(ctdb, ifaces);
|
||||||
|
|
||||||
@ -3335,7 +3335,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
ifaces->num = i;
|
ifaces->num = i;
|
||||||
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
||||||
i*sizeof(struct ctdb_control_iface_info);
|
i*sizeof(struct ctdb_iface);
|
||||||
|
|
||||||
outdata->dsize = len;
|
outdata->dsize = len;
|
||||||
outdata->dptr = (uint8_t *)ifaces;
|
outdata->dptr = (uint8_t *)ifaces;
|
||||||
@ -3347,11 +3347,11 @@ int32_t ctdb_control_set_iface_link(struct ctdb_context *ctdb,
|
|||||||
struct ctdb_req_control_old *c,
|
struct ctdb_req_control_old *c,
|
||||||
TDB_DATA indata)
|
TDB_DATA indata)
|
||||||
{
|
{
|
||||||
struct ctdb_control_iface_info *info;
|
struct ctdb_iface *info;
|
||||||
struct ctdb_interface *iface;
|
struct ctdb_interface *iface;
|
||||||
bool link_up = false;
|
bool link_up = false;
|
||||||
|
|
||||||
info = (struct ctdb_control_iface_info *)indata.dptr;
|
info = (struct ctdb_iface *)indata.dptr;
|
||||||
|
|
||||||
if (info->name[CTDB_IFACE_SIZE] != '\0') {
|
if (info->name[CTDB_IFACE_SIZE] != '\0') {
|
||||||
int len = strnlen(info->name, CTDB_IFACE_SIZE);
|
int len = strnlen(info->name, CTDB_IFACE_SIZE);
|
||||||
|
@ -556,7 +556,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
||||||
num*sizeof(struct ctdb_control_iface_info);
|
num*sizeof(struct ctdb_iface);
|
||||||
ifaces = talloc_zero_size(outdata, len);
|
ifaces = talloc_zero_size(outdata, len);
|
||||||
CTDB_NO_MEMORY(ctdb, ifaces);
|
CTDB_NO_MEMORY(ctdb, ifaces);
|
||||||
|
|
||||||
@ -574,7 +574,7 @@ int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
|
|||||||
}
|
}
|
||||||
ifaces->num = i;
|
ifaces->num = i;
|
||||||
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
len = offsetof(struct ctdb_control_get_ifaces, ifaces) +
|
||||||
i*sizeof(struct ctdb_control_iface_info);
|
i*sizeof(struct ctdb_iface);
|
||||||
|
|
||||||
outdata->dsize = len;
|
outdata->dsize = len;
|
||||||
outdata->dptr = (uint8_t *)ifaces;
|
outdata->dptr = (uint8_t *)ifaces;
|
||||||
|
@ -3182,7 +3182,7 @@ static int control_setifacelink(struct ctdb_context *ctdb, int argc, const char
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
|
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
|
||||||
struct ctdb_control_iface_info info;
|
struct ctdb_iface info;
|
||||||
|
|
||||||
ZERO_STRUCT(info);
|
ZERO_STRUCT(info);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user