diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-mgmt.c | 41 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 45 |
2 files changed, 55 insertions, 31 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c index 403e13e3678..8d344aa7b9a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c @@ -310,11 +310,8 @@ gd_mgmt_v3_lock_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } - if (!iov) { - gf_log (this->name, GF_LOG_ERROR, "iov is NULL"); - op_errno = EINVAL; - goto out; - } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_lock_rsp); @@ -525,10 +522,8 @@ gd_mgmt_v3_pre_validate_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } - if (!iov) { - gf_log (this->name, GF_LOG_ERROR, "iov is NULL"); - op_errno = EINVAL; - } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_pre_val_rsp); @@ -793,11 +788,8 @@ gd_mgmt_v3_brick_op_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } - if (!iov) { - gf_log (this->name, GF_LOG_ERROR, "iov is NULL"); - op_errno = EINVAL; - goto out; - } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_brick_op_rsp); @@ -985,11 +977,8 @@ gd_mgmt_v3_commit_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } - if (!iov) { - gf_log (this->name, GF_LOG_ERROR, "iov is NULL"); - op_errno = EINVAL; - goto out; - } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_commit_rsp); @@ -1216,11 +1205,8 @@ gd_mgmt_v3_post_validate_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } - if (!iov) { - gf_log (this->name, GF_LOG_ERROR, "iov is NULL"); - op_errno = EINVAL; - goto out; - } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_post_val_rsp); @@ -1410,11 +1396,8 @@ gd_mgmt_v3_unlock_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } - if (!iov) { - gf_log (this->name, GF_LOG_ERROR, "iov is NULL"); - op_errno = EINVAL; - goto out; - } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_unlock_rsp); diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 357c0164a6d..1de9e4603a2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -324,9 +324,11 @@ gd_syncop_mgmt_v3_lock_cbk_fn (struct rpc_req *req, struct iovec *iov, call_frame_t *frame = NULL; int op_ret = -1; int op_errno = -1; + xlator_t *this = NULL; + this = THIS; + GF_ASSERT (this); GF_ASSERT(req); - GF_ASSERT(iov); GF_ASSERT(myframe); frame = myframe; @@ -340,6 +342,9 @@ gd_syncop_mgmt_v3_lock_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_lock_rsp); if (ret < 0) @@ -413,9 +418,11 @@ gd_syncop_mgmt_v3_unlock_cbk_fn (struct rpc_req *req, struct iovec *iov, call_frame_t *frame = NULL; int op_ret = -1; int op_errno = -1; + xlator_t *this = NULL; + this = THIS; + GF_ASSERT (this); GF_ASSERT(req); - GF_ASSERT(iov); GF_ASSERT(myframe); frame = myframe; @@ -429,6 +436,9 @@ gd_syncop_mgmt_v3_unlock_cbk_fn (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_v3_unlock_rsp); if (ret < 0) @@ -503,6 +513,10 @@ _gd_syncop_mgmt_lock_cbk (struct rpc_req *req, struct iovec *iov, call_frame_t *frame = NULL; int op_ret = -1; int op_errno = -1; + xlator_t *this = NULL; + + this = THIS; + GF_ASSERT (this); frame = myframe; args = frame->local; @@ -515,6 +529,9 @@ _gd_syncop_mgmt_lock_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_cluster_lock_rsp); if (ret < 0) @@ -573,6 +590,10 @@ _gd_syncop_mgmt_unlock_cbk (struct rpc_req *req, struct iovec *iov, call_frame_t *frame = NULL; int op_ret = -1; int op_errno = -1; + xlator_t *this = NULL; + + this = THIS; + GF_ASSERT (this); frame = myframe; args = frame->local; @@ -584,6 +605,9 @@ _gd_syncop_mgmt_unlock_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_cluster_unlock_rsp); if (ret < 0) @@ -645,6 +669,8 @@ _gd_syncop_stage_op_cbk (struct rpc_req *req, struct iovec *iov, int op_errno = -1; this = THIS; + GF_ASSERT (this); + frame = myframe; args = frame->local; peerinfo = frame->cookie; @@ -655,6 +681,9 @@ _gd_syncop_stage_op_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_stage_op_rsp); if (ret < 0) @@ -766,6 +795,10 @@ _gd_syncop_brick_op_cbk (struct rpc_req *req, struct iovec *iov, gd1_mgmt_brick_op_rsp rsp = {0,}; int ret = -1; call_frame_t *frame = NULL; + xlator_t *this = NULL; + + this = THIS; + GF_ASSERT (this); frame = myframe; args = frame->local; @@ -780,6 +813,9 @@ _gd_syncop_brick_op_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, args->op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); if (ret < 0) @@ -902,6 +938,8 @@ _gd_syncop_commit_op_cbk (struct rpc_req *req, struct iovec *iov, int type = GF_QUOTA_OPTION_TYPE_NONE; this = THIS; + GF_ASSERT (this); + frame = myframe; args = frame->local; peerinfo = frame->cookie; @@ -912,6 +950,9 @@ _gd_syncop_commit_op_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, iov, out, op_errno, + EINVAL); + ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_commit_op_rsp); if (ret < 0) { |