MXS-2013 Remove all CHK_-macros
This commit is contained in:
@ -51,8 +51,6 @@ void Backend::close(close_type type)
|
||||
|
||||
if (in_use())
|
||||
{
|
||||
CHK_DCB(m_dcb);
|
||||
|
||||
/** Clean operation counter in bref and in SERVER */
|
||||
if (is_waiting_result())
|
||||
{
|
||||
@ -85,8 +83,6 @@ bool Backend::execute_session_command()
|
||||
return false;
|
||||
}
|
||||
|
||||
CHK_DCB(m_dcb);
|
||||
|
||||
SSessionCommand& sescmd = m_session_commands.front();
|
||||
GWBUF *buffer = sescmd->deep_copy_buffer();
|
||||
bool rval = false;
|
||||
|
||||
@ -88,7 +88,6 @@ gwbuf_alloc(unsigned int size)
|
||||
rval->properties = NULL;
|
||||
rval->gwbuf_type = GWBUF_TYPE_UNDEFINED;
|
||||
rval->server = NULL;
|
||||
CHK_GWBUF(rval);
|
||||
retblock:
|
||||
if (rval == NULL)
|
||||
{
|
||||
@ -232,7 +231,6 @@ gwbuf_free(GWBUF *buf)
|
||||
|
||||
while (buf)
|
||||
{
|
||||
CHK_GWBUF(buf);
|
||||
nextbuf = buf->next;
|
||||
gwbuf_free_one(buf);
|
||||
buf = nextbuf;
|
||||
@ -311,7 +309,6 @@ gwbuf_clone_one(GWBUF *buf)
|
||||
rval->gwbuf_type = buf->gwbuf_type;
|
||||
rval->tail = rval;
|
||||
rval->next = NULL;
|
||||
CHK_GWBUF(rval);
|
||||
#if defined(BUFFER_TRACE)
|
||||
gwbuf_add_to_hashtable(rval);
|
||||
#endif
|
||||
@ -378,7 +375,6 @@ static GWBUF *gwbuf_clone_portion(GWBUF *buf,
|
||||
{
|
||||
GWBUF* clonebuf;
|
||||
|
||||
CHK_GWBUF(buf);
|
||||
ss_dassert(start_offset + length <= GWBUF_LENGTH(buf));
|
||||
|
||||
if ((clonebuf = (GWBUF *)MXS_MALLOC(sizeof(GWBUF))) == NULL)
|
||||
@ -396,7 +392,6 @@ static GWBUF *gwbuf_clone_portion(GWBUF *buf,
|
||||
clonebuf->hint = NULL;
|
||||
clonebuf->next = NULL;
|
||||
clonebuf->tail = clonebuf;
|
||||
CHK_GWBUF(clonebuf);
|
||||
#if defined(BUFFER_TRACE)
|
||||
gwbuf_add_to_hashtable(clonebuf);
|
||||
#endif
|
||||
@ -582,7 +577,6 @@ gwbuf_append(GWBUF *head, GWBUF *tail)
|
||||
{
|
||||
return head;
|
||||
}
|
||||
CHK_GWBUF(head);
|
||||
head->tail->next = tail;
|
||||
head->tail = tail->tail;
|
||||
|
||||
@ -594,7 +588,6 @@ gwbuf_consume(GWBUF *head, unsigned int length)
|
||||
{
|
||||
while (head && length > 0)
|
||||
{
|
||||
CHK_GWBUF(head);
|
||||
unsigned int buflen = GWBUF_LENGTH(head);
|
||||
|
||||
GWBUF_CONSUME(head, length);
|
||||
@ -623,7 +616,6 @@ gwbuf_length(const GWBUF *head)
|
||||
|
||||
if (head)
|
||||
{
|
||||
CHK_GWBUF(head);
|
||||
}
|
||||
while (head)
|
||||
{
|
||||
@ -649,9 +641,7 @@ GWBUF *
|
||||
gwbuf_rtrim(GWBUF *head, unsigned int n_bytes)
|
||||
{
|
||||
GWBUF *rval = head;
|
||||
CHK_GWBUF(head);
|
||||
GWBUF_RTRIM(head, n_bytes);
|
||||
CHK_GWBUF(head);
|
||||
|
||||
if (GWBUF_EMPTY(head))
|
||||
{
|
||||
@ -666,7 +656,6 @@ void gwbuf_set_type(GWBUF* buf, uint32_t type)
|
||||
/** Set type consistenly to all buffers on the list */
|
||||
while (buf != NULL)
|
||||
{
|
||||
CHK_GWBUF(buf);
|
||||
buf->gwbuf_type |= type;
|
||||
buf = buf->next;
|
||||
}
|
||||
@ -677,7 +666,6 @@ void gwbuf_add_buffer_object(GWBUF* buf,
|
||||
void* data,
|
||||
void (*donefun_fp)(void *))
|
||||
{
|
||||
CHK_GWBUF(buf);
|
||||
buffer_object_t* newb = (buffer_object_t *)MXS_MALLOC(sizeof(buffer_object_t));
|
||||
MXS_ABORT_IF_NULL(newb);
|
||||
|
||||
@ -699,8 +687,6 @@ void gwbuf_add_buffer_object(GWBUF* buf,
|
||||
|
||||
void* gwbuf_get_buffer_object_data(GWBUF* buf, bufobj_id_t id)
|
||||
{
|
||||
CHK_GWBUF(buf);
|
||||
|
||||
buffer_object_t* bo = buf->sbuf->bufobj;
|
||||
|
||||
while (bo != NULL && bo->bo_id != id)
|
||||
|
||||
@ -223,7 +223,6 @@ dcb_alloc(dcb_role_t role, SERV_LISTENER *listener)
|
||||
static void
|
||||
dcb_final_free(DCB *dcb)
|
||||
{
|
||||
CHK_DCB(dcb);
|
||||
ss_info_dassert(dcb->state == DCB_STATE_DISCONNECTED ||
|
||||
dcb->state == DCB_STATE_ALLOC,
|
||||
"dcb not in DCB_STATE_DISCONNECTED not in DCB_STATE_ALLOC state.");
|
||||
@ -235,7 +234,6 @@ dcb_final_free(DCB *dcb)
|
||||
*/
|
||||
MXS_SESSION *local_session = dcb->session;
|
||||
dcb->session = NULL;
|
||||
CHK_SESSION(local_session);
|
||||
if (SESSION_STATE_DUMMY != local_session->state)
|
||||
{
|
||||
if (dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER)
|
||||
@ -577,8 +575,6 @@ int dcb_read(DCB *dcb,
|
||||
return dcb_read_SSL(dcb, head);
|
||||
}
|
||||
|
||||
CHK_DCB(dcb);
|
||||
|
||||
if (dcb->fd <= 0)
|
||||
{
|
||||
MXS_ERROR("Read failed, dcb is closed.");
|
||||
@ -740,8 +736,6 @@ dcb_read_SSL(DCB *dcb, GWBUF **head)
|
||||
int nsingleread = 0, nreadtotal = 0;
|
||||
int start_length = gwbuf_length(*head);
|
||||
|
||||
CHK_DCB(dcb);
|
||||
|
||||
if (dcb->fd <= 0)
|
||||
{
|
||||
MXS_ERROR("Read failed, dcb is closed.");
|
||||
@ -1102,8 +1096,6 @@ static void log_illegal_dcb(DCB *dcb)
|
||||
*/
|
||||
void dcb_close(DCB *dcb)
|
||||
{
|
||||
CHK_DCB(dcb);
|
||||
|
||||
#if defined(SS_DEBUG)
|
||||
RoutingWorker* current = RoutingWorker::get_current();
|
||||
RoutingWorker* owner = static_cast<RoutingWorker*>(dcb->poll.owner);
|
||||
@ -1314,7 +1306,6 @@ dcb_maybe_add_persistent(DCB *dcb)
|
||||
{
|
||||
MXS_SESSION *local_session = dcb->session;
|
||||
session_set_dummy(dcb);
|
||||
CHK_SESSION(local_session);
|
||||
if (SESSION_STATE_DUMMY != local_session->state)
|
||||
{
|
||||
session_unlink_backend_dcb(local_session, dcb);
|
||||
@ -2047,11 +2038,9 @@ dcb_persistent_clean_count(DCB *dcb, int id, bool cleanall)
|
||||
DCB *persistentdcb, *nextdcb;
|
||||
DCB *disposals = NULL;
|
||||
|
||||
CHK_SERVER(server);
|
||||
persistentdcb = server->persistent[id];
|
||||
while (persistentdcb)
|
||||
{
|
||||
CHK_DCB(persistentdcb);
|
||||
nextdcb = persistentdcb->nextpersistent;
|
||||
if (cleanall
|
||||
|| persistentdcb-> dcb_errhandle_called
|
||||
@ -3000,8 +2989,6 @@ static uint32_t dcb_process_poll_events(DCB *dcb, uint32_t events)
|
||||
ss_dassert(owner == RoutingWorker::get_current() ||
|
||||
dcb->dcb_role == DCB_ROLE_SERVICE_LISTENER);
|
||||
|
||||
CHK_DCB(dcb);
|
||||
|
||||
uint32_t rc = MXS_POLL_NOP;
|
||||
|
||||
/* It isn't obvious that this is impossible */
|
||||
@ -3371,8 +3358,6 @@ dcb_session_check(DCB *dcb, const char *function)
|
||||
/** DCB Sanity checks */
|
||||
static inline void dcb_sanity_check(DCB* dcb)
|
||||
{
|
||||
CHK_DCB(dcb);
|
||||
|
||||
if (dcb->state == DCB_STATE_DISCONNECTED || dcb->state == DCB_STATE_UNDEFINED)
|
||||
{
|
||||
MXS_ERROR("[poll_add_dcb] Error : existing state of dcb %p "
|
||||
@ -3626,7 +3611,6 @@ int poll_remove_dcb(DCB *dcb)
|
||||
{
|
||||
int dcbfd, rc = 0;
|
||||
struct epoll_event ev;
|
||||
CHK_DCB(dcb);
|
||||
|
||||
/*< It is possible that dcb has already been removed from the set */
|
||||
if (dcb->state == DCB_STATE_NOPOLLING)
|
||||
|
||||
@ -514,7 +514,6 @@ void hashtable_get_stats(void* table,
|
||||
if (table != NULL)
|
||||
{
|
||||
ht = (HASHTABLE *)table;
|
||||
CHK_HASHTABLE(ht);
|
||||
hashtable_read_lock(ht);
|
||||
|
||||
for (i = 0; i < ht->hashsize; i++)
|
||||
|
||||
@ -518,8 +518,6 @@ GWBUF* modutil_get_next_MySQL_packet(GWBUF** p_readbuf)
|
||||
|
||||
if (readbuf)
|
||||
{
|
||||
CHK_GWBUF(readbuf);
|
||||
|
||||
size_t totalbuflen = gwbuf_length(readbuf);
|
||||
if (totalbuflen >= MYSQL_HEADER_LEN)
|
||||
{
|
||||
@ -781,7 +779,6 @@ void modutil_reply_parse_error(DCB* backend_dcb,
|
||||
char* errstr,
|
||||
uint32_t flags)
|
||||
{
|
||||
CHK_DCB(backend_dcb);
|
||||
modutil_reply_routing_error(backend_dcb, 1064, "42000", errstr, flags);
|
||||
}
|
||||
|
||||
@ -798,7 +795,6 @@ void modutil_reply_auth_error(DCB* backend_dcb,
|
||||
char* errstr,
|
||||
uint32_t flags)
|
||||
{
|
||||
CHK_DCB(backend_dcb);
|
||||
modutil_reply_routing_error(backend_dcb, 1045, "28000", errstr, flags);
|
||||
}
|
||||
|
||||
@ -821,7 +817,6 @@ static void modutil_reply_routing_error(DCB* backend_dcb,
|
||||
uint32_t flags)
|
||||
{
|
||||
GWBUF* buf;
|
||||
CHK_DCB(backend_dcb);
|
||||
|
||||
buf = modutil_create_mysql_err_msg(1, 0, error, state, errstr);
|
||||
MXS_FREE(errstr);
|
||||
|
||||
@ -228,7 +228,6 @@ static MXS_SESSION* session_alloc_body(SERVICE* service, DCB* client_dcb,
|
||||
}
|
||||
atomic_add(&service->stats.n_sessions, 1);
|
||||
atomic_add(&service->stats.n_current, 1);
|
||||
CHK_SESSION(session);
|
||||
|
||||
// Store the session in the client DCB even if the session creation fails.
|
||||
// It will be freed later on when the DCB is closed.
|
||||
@ -365,7 +364,6 @@ static void session_free(MXS_SESSION *session)
|
||||
|
||||
static void session_final_free(MXS_SESSION *session)
|
||||
{
|
||||
CHK_SESSION(session);
|
||||
ss_dassert(session->refcount == 0);
|
||||
|
||||
session->state = SESSION_STATE_TO_BE_FREED;
|
||||
|
||||
Reference in New Issue
Block a user