diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2016-08-22 12:11:24 -0400 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-08-27 04:10:34 -0700 |
commit | 225d8034354a233bbb9f1c6fd86b40562efd0ae9 (patch) | |
tree | f24c0fa24ec0624d4460a0dacdd97a887c77e5ab /xlators/features | |
parent | 6c283f107b646405936520e2549510115bf2ef64 (diff) |
quota: fix unused variable warnings/errors
http://review.gluster.org/14085 fixes a/the "leak" - via the
generated rpc/xdr headers - of pragmas that mask these warnings.
However 14085 won't pass the smoke test until all the warnings are
fixed.
Change-Id: Ic5c1e20468d47ccb5243b8e99f946fd31eb737b8
BUG: 1369124
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/15250
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/quota/src/quota.c | 54 | ||||
-rw-r--r-- | xlators/features/quota/src/quota.h | 4 | ||||
-rw-r--r-- | xlators/features/quota/src/quotad-aggregator.c | 12 | ||||
-rw-r--r-- | xlators/features/quota/src/quotad.c | 2 |
4 files changed, 14 insertions, 58 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 350e8ac8de0..7a84aeb9aba 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -591,9 +591,7 @@ quota_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; int32_t ret = 0; quota_inode_ctx_t *ctx = NULL; - int64_t *object_size = 0; uint64_t value = 0; - data_t *data = NULL; quota_meta_t size = {0,}; local = frame->local; @@ -1251,9 +1249,7 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this) quota_priv_t *priv = NULL; quota_local_t *local = NULL; quota_local_t *par_local = NULL; - char need_validate = 0; char just_validated = 0; - gf_boolean_t hard_limit_exceeded = 0; int64_t delta = 0; int8_t object_delta = 0; uint64_t value = 0; @@ -1395,11 +1391,8 @@ do_quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, int32_t ret = -1; inode_t *parent = NULL; call_frame_t *new_frame = NULL; - quota_local_t *local = NULL; quota_local_t *new_local = NULL; - local = frame->local; - parent = inode_parent (inode, dentry->par, dentry->name); if (parent == NULL) { if (force) @@ -1596,7 +1589,6 @@ quota_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *buf, dict_t *dict, struct iatt *postparent) { quota_local_t *local = NULL; - int32_t ret = 0; inode_t *this_inode = NULL; local = frame->local; @@ -1744,12 +1736,9 @@ quota_writev_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; struct iovec *new_vector = NULL; int32_t new_count = 0; - priv = this->private; - local = frame->local; GF_VALIDATE_OR_GOTO ("quota", local, unwind); @@ -1816,7 +1805,7 @@ quota_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, uint32_t flags, struct iobref *iobref, dict_t *xdata) { quota_priv_t *priv = NULL; - int32_t ret = -1, op_errno = EINVAL; + int32_t op_errno = EINVAL; int32_t parents = 0; int32_t fail_count = 0; uint64_t size = 0; @@ -1845,7 +1834,7 @@ quota_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, frame->local = local; local->loc.inode = inode_ref (fd->inode); - ret = quota_inode_ctx_get (fd->inode, this, &ctx, 0); + (void) quota_inode_ctx_get (fd->inode, this, &ctx, 0); if (ctx == NULL) { gf_msg_debug (this->name, 0, "quota context is NULL on inode" " (%s). If quota is not enabled recently and " @@ -2091,15 +2080,11 @@ quota_create_helper (call_frame_t *frame, xlator_t *this, loc_t *loc, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; local = frame->local; GF_VALIDATE_OR_GOTO ("quota", local, unwind); - priv = this->private; - - if (local->op_ret == -1) { op_errno = local->op_errno; goto unwind; @@ -2340,9 +2325,6 @@ quota_link_helper (call_frame_t *frame, xlator_t *this, loc_t *oldloc, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; - - priv = this->private; local = frame->local; @@ -2561,7 +2543,6 @@ quota_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, dict_t *xdata) { int32_t ret = -1; - int64_t size = 0; quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; quota_dentry_t *old_dentry = NULL, *dentry = NULL; @@ -2575,9 +2556,7 @@ quota_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, GF_VALIDATE_OR_GOTO ("quota", local, out); - if (QUOTA_REG_OR_LNK_FILE (local->oldloc.inode->ia_type)) - size = buf->ia_blocks * 512; - else + if (!QUOTA_REG_OR_LNK_FILE (local->oldloc.inode->ia_type)) goto out; ret = quota_inode_ctx_get (local->oldloc.inode, this, &ctx, 0); @@ -2656,9 +2635,6 @@ quota_rename_helper (call_frame_t *frame, xlator_t *this, loc_t *oldloc, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; - - priv = this->private; local = frame->local; @@ -2953,14 +2929,11 @@ quota_symlink_helper (call_frame_t *frame, xlator_t *this, const char *linkpath, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; local = frame->local; GF_VALIDATE_OR_GOTO ("quota", local, unwind); - priv = this->private; - if (local->op_ret == -1) { op_errno = local->op_errno; goto unwind; @@ -3895,14 +3868,11 @@ quota_mknod_helper (call_frame_t *frame, xlator_t *this, loc_t *loc, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; local = frame->local; GF_VALIDATE_OR_GOTO ("quota", local, unwind); - priv = this->private; - if (local->op_ret == -1) { op_errno = local->op_errno; goto unwind; @@ -4390,7 +4360,6 @@ quota_statfs_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t ret = 0; quota_inode_ctx_t *ctx = NULL; uint64_t value = 0; - data_t *data = NULL; quota_meta_t size = {0,}; local = frame->local; @@ -4445,12 +4414,10 @@ quota_get_limit_dir_continuation (struct list_head *parents, inode_t *inode, { call_frame_t *frame = NULL; xlator_t *this = NULL; - quota_local_t *local = NULL; quota_dentry_t *entry = NULL; inode_t *parent = NULL; frame = data; - local = frame->local; this = THIS; if ((op_ret < 0) || list_empty (parents)) { @@ -4482,7 +4449,6 @@ out: void quota_statfs_continue (call_frame_t *frame, xlator_t *this, inode_t *inode) { - call_stub_t *stub = NULL; quota_local_t *local = frame->local; int ret = -1; @@ -4505,7 +4471,6 @@ quota_get_limit_dir (call_frame_t *frame, inode_t *cur_inode, xlator_t *this) inode_t *parent = NULL; uint64_t value = 0; quota_inode_ctx_t *ctx = NULL; - int ret = -1; quota_local_t *local = frame->local; if (!cur_inode) @@ -4527,9 +4492,9 @@ quota_get_limit_dir (call_frame_t *frame, inode_t *cur_inode, xlator_t *this) parent = inode_parent (inode, 0, NULL); if (!parent) { - ret = quota_build_ancestry - (inode, quota_get_limit_dir_continuation, - (void *)frame); + (void) quota_build_ancestry (inode, + quota_get_limit_dir_continuation, + frame); goto out; } @@ -4802,14 +4767,11 @@ quota_fallocate_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, { quota_local_t *local = NULL; int32_t op_errno = EINVAL; - quota_priv_t *priv = NULL; local = frame->local; GF_VALIDATE_OR_GOTO ("quota", local, unwind); - priv = this->private; - if (local->op_ret == -1) { op_errno = local->op_errno; if (op_errno == ENOENT || op_errno == ESTALE) { @@ -4847,7 +4809,7 @@ int32_t quota_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, off_t offset, size_t len, dict_t *xdata) { - int32_t ret = -1, op_errno = EINVAL; + int32_t op_errno = EINVAL; int32_t parents = 0; int32_t fail_count = 0; quota_local_t *local = NULL; @@ -4878,7 +4840,7 @@ quota_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, frame->local = local; local->loc.inode = inode_ref (fd->inode); - ret = quota_inode_ctx_get (fd->inode, this, &ctx, 0); + (void) quota_inode_ctx_get (fd->inode, this, &ctx, 0); if (ctx == NULL) { gf_msg_debug (this->name, 0, "quota context is NULL on inode" " (%s). If quota is not enabled recently and " diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h index 6f74da789b6..79afb28cfe8 100644 --- a/xlators/features/quota/src/quota.h +++ b/xlators/features/quota/src/quota.h @@ -86,11 +86,9 @@ #define QUOTA_STACK_WIND_TAIL(frame, params...) \ do { \ quota_local_t *_local = NULL; \ - xlator_t *_this = NULL; \ \ if (frame) { \ _local = frame->local; \ - _this = frame->this; \ frame->local = NULL; \ } \ \ @@ -103,10 +101,8 @@ #define QUOTA_STACK_UNWIND(fop, frame, params...) \ do { \ quota_local_t *_local = NULL; \ - xlator_t *_this = NULL; \ if (frame) { \ _local = frame->local; \ - _this = frame->this; \ frame->local = NULL; \ } \ STACK_UNWIND_STRICT (fop, frame, params); \ diff --git a/xlators/features/quota/src/quotad-aggregator.c b/xlators/features/quota/src/quotad-aggregator.c index 82d18ea15e0..428153fa2bd 100644 --- a/xlators/features/quota/src/quotad-aggregator.c +++ b/xlators/features/quota/src/quotad-aggregator.c @@ -182,7 +182,6 @@ quotad_aggregator_getlimit (rpcsvc_request_t *req) gf_cli_req cli_req = {{0}, }; gf_cli_rsp cli_rsp = {0}; gfs3_lookup_req args = {{0,},}; - gfs3_lookup_rsp rsp = {0,}; quotad_aggregator_state_t *state = NULL; xlator_t *this = NULL; dict_t *dict = NULL; @@ -225,8 +224,8 @@ quotad_aggregator_getlimit (rpcsvc_request_t *req) frame = quotad_aggregator_get_frame_from_req (req); if (frame == NULL) { - rsp.op_errno = ENOMEM; - goto err; + cli_rsp.op_errno = ENOMEM; + goto errx; } state = frame->root->state; state->xdata = dict; @@ -258,15 +257,16 @@ quotad_aggregator_getlimit (rpcsvc_request_t *req) ret = qd_nameless_lookup (this, frame, &args, state->xdata, quotad_aggregator_getlimit_cbk); if (ret) { - rsp.op_errno = ret; - goto err; + cli_rsp.op_errno = ret; + goto errx; } return ret; err: - cli_rsp.op_ret = -1; cli_rsp.op_errno = op_errno; +errx: + cli_rsp.op_ret = -1; cli_rsp.op_errstr = ""; quotad_aggregator_getlimit_cbk (this, frame, &cli_rsp); diff --git a/xlators/features/quota/src/quotad.c b/xlators/features/quota/src/quotad.c index dc2665e9622..2c9949fa127 100644 --- a/xlators/features/quota/src/quotad.c +++ b/xlators/features/quota/src/quotad.c @@ -106,11 +106,9 @@ qd_nameless_lookup (xlator_t *this, call_frame_t *frame, gfs3_lookup_req *req, int op_errno = 0, ret = -1; loc_t loc = {0, }; quotad_aggregator_state_t *state = NULL; - quota_priv_t *priv = NULL; xlator_t *subvol = NULL; char *volume_uuid = NULL; - priv = this->private; state = frame->root->state; frame->root->op = GF_FOP_LOOKUP; |