diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2011-09-07 20:03:24 -0400 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-09-07 23:48:01 -0700 |
commit | 694ef54978f382507a5127ce66da7770929ba2c2 (patch) | |
tree | b98ee679c8d5f4b3556c0bf9af44e6b9729c2881 /xlators/storage/posix/src/posix.c | |
parent | 81530d227deb52af38c7df770aef2200b9de539f (diff) |
Eliminate many "var set but not used" warnings with newer gcc.
This fixes ~200 such warnings, but leaves three categories untouched.
(1) Rpcgen code.
(2) Macros which set variables in the outer (calling function) scope.
(3) Variables which are set via function calls which may have side effects.
Change-Id: I6554555f78ed26134251504b038da7e94adacbcd
BUG: 2550
Reviewed-on: http://review.gluster.com/371
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index f816128f4cf..49a874b6dc2 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1837,7 +1837,6 @@ posix_open (call_frame_t *frame, xlator_t *this, int32_t _fd = -1; struct posix_fd *pfd = NULL; struct posix_private *priv = NULL; - char was_present = 1; gid_t gid = 0; struct iatt stbuf = {0, }; @@ -1867,9 +1866,6 @@ posix_open (call_frame_t *frame, xlator_t *this, flags |= O_DIRECT; op_ret = posix_lstat_with_gfid (this, real_path, &stbuf); - if ((op_ret == -1) && (errno == ENOENT)) { - was_present = 0; - } _fd = open (real_path, flags, 0); if (_fd == -1) { @@ -1959,7 +1955,6 @@ posix_readv (call_frame_t *frame, xlator_t *this, struct iovec vec = {0,}; struct posix_fd * pfd = NULL; struct iatt stbuf = {0,}; - int align = 1; int ret = -1; VALIDATE_OR_GOTO (frame, out); @@ -1985,10 +1980,6 @@ posix_readv (call_frame_t *frame, xlator_t *this, goto out; } - if (pfd->flags & O_DIRECT) { - align = 4096; /* align to page boundary */ - } - iobuf = iobuf_get2 (this->ctx->iobuf_pool, size); if (!iobuf) { op_errno = ENOMEM; @@ -2281,7 +2272,6 @@ posix_flush (call_frame_t *frame, xlator_t *this, { int32_t op_ret = -1; int32_t op_errno = 0; - struct posix_fd * pfd = NULL; int ret = -1; uint64_t tmp_pfd = 0; @@ -2296,7 +2286,6 @@ posix_flush (call_frame_t *frame, xlator_t *this, "pfd is NULL on fd=%p", fd); goto out; } - pfd = (struct posix_fd *)(long)tmp_pfd; op_ret = 0; @@ -2879,7 +2868,6 @@ posix_fsyncdir (call_frame_t *frame, xlator_t *this, { int32_t op_ret = -1; int32_t op_errno = 0; - struct posix_fd * pfd = NULL; int ret = -1; uint64_t tmp_pfd = 0; @@ -2894,7 +2882,6 @@ posix_fsyncdir (call_frame_t *frame, xlator_t *this, "pfd is NULL, fd=%p", fd); goto out; } - pfd = (struct posix_fd *)(long)tmp_pfd; op_ret = 0; @@ -3501,7 +3488,6 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, int real_path_len = -1; char *entry_path = NULL; int entry_path_len = -1; - struct posix_private *priv = NULL; struct iatt stbuf = {0, }; char base_path[PATH_MAX] = {0,}; gf_dirent_t *tmp_entry = NULL; @@ -3513,8 +3499,6 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, INIT_LIST_HEAD (&entries.list); - priv = this->private; - ret = fd_ctx_get (fd, this, &tmp_pfd); if (ret < 0) { gf_log (this->name, GF_LOG_WARNING, |