summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-helpers.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-16 09:43:27 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-17 11:59:12 -0700
commit0349ec857004428f29b50f3604e5ab126dfb407e (patch)
tree57fddfe66b1d2df91a9a75198e41a795f8412c04 /xlators/protocol/server/src/server-helpers.c
parentd3e9a97b6ef340f827cf55de5340a8bf5c732f3e (diff)
protocol/server: log enhancements
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'xlators/protocol/server/src/server-helpers.c')
-rw-r--r--xlators/protocol/server/src/server-helpers.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 78d850fc7..da3124ff7 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -162,8 +162,6 @@ gf_add_locker (struct _lock_table *table, const char *volume,
new = GF_CALLOC (1, sizeof (struct _locker), gf_server_mt_locker_t);
if (new == NULL) {
- gf_log ("server", GF_LOG_ERROR,
- "failed to allocate memory for \'struct _locker\'");
goto out;
}
INIT_LIST_HEAD (&new->lockers);
@@ -259,8 +257,6 @@ gf_lock_table_new (void)
new = GF_CALLOC (1, sizeof (struct _lock_table), gf_server_mt_lock_table_t);
if (new == NULL) {
- gf_log ("server-protocol", GF_LOG_CRITICAL,
- "failed to allocate memory for new lock table");
goto out;
}
INIT_LIST_HEAD (&new->entrylk_lockers);
@@ -331,8 +327,6 @@ do_lock_table_cleanup (xlator_t *this, server_connection_t *conn,
tmp, &inodelk_lockers, lockers) {
tmp_frame = copy_frame (frame);
if (tmp_frame == NULL) {
- gf_log (this->name, GF_LOG_ERROR,
- "out of memory");
goto out;
}
/*
@@ -483,8 +477,6 @@ do_fd_cleanup (xlator_t *this, server_connection_t *conn, call_frame_t *frame,
if (fd != NULL) {
tmp_frame = copy_frame (frame);
if (tmp_frame == NULL) {
- gf_log (this->name, GF_LOG_ERROR,
- "out of memory");
goto out;
}
@@ -538,7 +530,6 @@ do_connection_cleanup (xlator_t *this, server_connection_t *conn,
frame = create_frame (this, this->ctx->pool);
if (frame == NULL) {
- gf_log (this->name, GF_LOG_ERROR, "out of memory");
goto out;
}
@@ -896,10 +887,12 @@ server_alloc_frame (rpcsvc_request_t *req)
GF_VALIDATE_OR_GOTO ("server", conn, out);
frame = create_frame (conn->this, req->svc->ctx->pool);
- GF_VALIDATE_OR_GOTO ("server", frame, out);
+ if (!frame)
+ goto out;
state = GF_CALLOC (1, sizeof (*state), gf_server_mt_state_t);
- GF_VALIDATE_OR_GOTO ("server", state, out);
+ if (!state)
+ goto out;
if (conn->bound_xl)
state->itable = conn->bound_xl->itable;
@@ -928,7 +921,8 @@ get_frame_from_request (rpcsvc_request_t *req)
GF_VALIDATE_OR_GOTO ("server", req, out);
frame = server_alloc_frame (req);
- GF_VALIDATE_OR_GOTO ("server", frame, out);
+ if (!frame)
+ goto out;
frame->root->op = req->procnum;
frame->root->type = req->type;
@@ -1320,7 +1314,9 @@ server_print_request (call_frame_t *frame)
conf = this->private;
GF_VALIDATE_OR_GOTO ("server", conf, out);
- GF_VALIDATE_OR_GOTO ("server", conf->trace, out);
+
+ if (!conf->trace)
+ goto out;
state = CALL_STATE (frame);