diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-mgmt.c | 41 |
1 files changed, 12 insertions, 29 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); |