summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2016-08-22 12:15:22 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-08-29 10:30:51 -0700
commitc204f452dfd9907a0d32f35294a0805701a6d993 (patch)
tree9e7ee5857eae50827528c7252a72339899259703 /xlators/storage/posix
parentb231acedb8696ef298a405ffedd36dba8a7183be (diff)
posix: 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: Ibb3057cc072097434350c1dd2139b18610295825 BUG: 1369124 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/15257 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c6
-rw-r--r--xlators/storage/posix/src/posix.c22
2 files changed, 10 insertions, 18 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 36cee49696c..75895136155 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -696,7 +696,6 @@ static void
_handle_list_xattr (dict_t *xattr_req, const char *real_path, int fdnum,
posix_xattr_filler_t *filler)
{
- int ret = -1;
ssize_t size = 0;
char *list = NULL;
int32_t list_offset = 0;
@@ -742,7 +741,7 @@ _handle_list_xattr (dict_t *xattr_req, const char *real_path, int fdnum,
if (dict_get (filler->xattr, key))
goto next;
- ret = _posix_xattr_get_set_from_backend (filler, key);
+ (void) _posix_xattr_get_set_from_backend (filler, key);
next:
remaining_size -= strlen (key) + 1;
list_offset += strlen (key) + 1;
@@ -1928,11 +1927,8 @@ posix_fsyncer_process (xlator_t *this, call_stub_t *stub, gf_boolean_t do_fsync)
{
struct posix_fd *pfd = NULL;
int ret = -1;
- struct posix_private *priv = NULL;
int op_errno = 0;
- priv = this->private;
-
ret = posix_fd_ctx_get (stub->args.fd, this, &pfd, &op_errno);
if (ret < 0) {
gf_msg (this->name, GF_LOG_ERROR, op_errno,
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 6f9b2c0aee0..8478e64683e 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1421,7 +1421,7 @@ posix_mkdir (call_frame_t *frame, xlator_t *this,
void *uuid_req = NULL;
ssize_t size = 0;
dict_t *xdata_rsp = NULL;
- void *disk_xattr = NULL, *arg_xattr = NULL;
+ void *disk_xattr = NULL;
data_t *arg_data = NULL;
char pgfid[GF_UUID_BUF_SIZE] = {0};
@@ -1553,7 +1553,6 @@ posix_mkdir (call_frame_t *frame, xlator_t *this,
if ((arg_data->len != size)
|| (memcmp (arg_data->data, disk_xattr, size))) {
- int ret = 0;
gf_msg (this->name, GF_LOG_INFO, EIO,
P_MSG_PREOP_CHECK_FAILED,
"mkdir (%s/%s): failing preop of "
@@ -1576,8 +1575,8 @@ posix_mkdir (call_frame_t *frame, xlator_t *this,
goto out;
}
- ret = dict_set_int8 (xdata_rsp,
- GF_PREOP_CHECK_FAILED, 1);
+ op_errno = dict_set_int8 (xdata_rsp,
+ GF_PREOP_CHECK_FAILED, 1);
goto out;
}
@@ -1696,7 +1695,6 @@ posix_move_gfid_to_unlink (xlator_t *this, uuid_t gfid, loc_t *loc)
{
char *unlink_path = NULL;
char *gfid_path = NULL;
- struct stat stbuf = {0, };
int ret = 0;
struct posix_private *priv_posix = NULL;
@@ -1735,7 +1733,6 @@ posix_unlink_gfid_handle_and_entry (xlator_t *this, const char *real_path,
loc_t *loc, gf_boolean_t get_link_count,
dict_t *rsp_dict)
{
- int fd_count = 0;
int32_t ret = 0;
struct iatt prebuf = {0,};
gf_boolean_t locked = _gf_false;
@@ -1879,13 +1876,9 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
struct iatt postparent = {0,};
char *pgfid_xattr_key = NULL;
int32_t nlink_samepgfid = 0;
- int32_t unlink_if_linkto = 0;
int32_t check_open_fd = 0;
int32_t skip_unlink = 0;
int32_t fdstat_requested = 0;
- int32_t ctr_link_req = 0;
- ssize_t xattr_size = -1;
- int32_t is_dht_linkto_file = 0;
dict_t *unwind_dict = NULL;
void *uuid = NULL;
char uuid_str[GF_UUID_BUF_SIZE] = {0};
@@ -3887,6 +3880,12 @@ posix_xattr_get_real_filename (call_frame_t *frame, xlator_t *this, loc_t *loc,
if (!real_path) {
return -ESTALE;
}
+ if (op_ret == -1) {
+ gf_msg (this->name, GF_LOG_ERROR, errno, P_MSG_LSTAT_FAILED,
+ "posix_xattr_get_real_filename (lstat) on %s failed",
+ real_path);
+ return -errno;
+ }
fd = sys_opendir (real_path);
if (!fd)
@@ -3971,11 +3970,9 @@ posix_links_in_same_directory (char *dirpath, int count, inode_t *leaf_inode,
int type, dict_t *xdata, int32_t *op_errno)
{
int op_ret = -1;
- inode_t *linked_inode = NULL;
gf_dirent_t *gf_entry = NULL;
xlator_t *this = NULL;
struct posix_private *priv = NULL;
- char *tempv = NULL;
DIR *dirp = NULL;
struct dirent *entry = NULL;
struct dirent scratch[2] = {{0,},};
@@ -6801,7 +6798,6 @@ init (xlator_t *this)
data_t *tmp_data = NULL;
struct stat buf = {0,};
gf_boolean_t tmp_bool = 0;
- int dict_ret = 0;
int ret = 0;
int op_ret = -1;
ssize_t size = -1;