summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShyamsundarR <srangana@redhat.com>2018-11-29 15:37:23 -0500
committerShyamsundarR <srangana@redhat.com>2018-11-29 15:41:07 -0500
commite74d997f0d7eeb91fe6b5f0f0c3969bf4ac53f9f (patch)
tree50e3e9fcda91efbf54bb30d2083595363c58cd6a
parent95e380eca19b9f0d03a53429535f15556e5724ad (diff)
clang: Fix clang warnings in snapview-server.c
The warning by clang is due to the fact that we check for frame->root to be NULL, but in stack unwind, we ignore the same. If frame is non-NULL then frame->root is non-NULL as frame creation ensures this. Further, across the code we do not check both frame and frame->root for validity. Hence to fix these clang issues, removing the check for frame->root in the various functions. NOTE: Initially clang reported 14 issues in the file, but post commit 6eabefe6 the number reduced to 4, unsure why as that commit does not address this issue. Change-Id: I04b63f2d006a1f95773aae9f904b4bd3d5118e62 Updates: bz#1622665 Signed-off-by: ShyamsundarR <srangana@redhat.com>
-rw-r--r--xlators/features/snapview-server/src/snapview-server.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index 1ce3dcf..7a8e29e 100644
--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -588,7 +588,6 @@ svs_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
GF_VALIDATE_OR_GOTO("svs", this, out);
GF_VALIDATE_OR_GOTO(this->name, this->private, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);
@@ -749,7 +748,6 @@ svs_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, fd, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);
@@ -893,7 +891,6 @@ svs_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO("snap-view-daemon", frame, out);
- GF_VALIDATE_OR_GOTO("snap-view-daemon", frame->root, out);
GF_VALIDATE_OR_GOTO("snap-view-daemon", loc, out);
GF_VALIDATE_OR_GOTO("snap-view-daemon", loc->inode, out);
@@ -1260,7 +1257,6 @@ svs_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
GF_VALIDATE_OR_GOTO("snapview-server", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, fd, out);
root = frame->root;
@@ -1673,7 +1669,6 @@ svs_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, unwind);
GF_VALIDATE_OR_GOTO(this->name, frame, unwind);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, unwind);
GF_VALIDATE_OR_GOTO(this->name, fd, unwind);
GF_VALIDATE_OR_GOTO(this->name, fd->inode, unwind);
@@ -1964,7 +1959,6 @@ svs_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);
@@ -2038,7 +2032,6 @@ svs_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, fd, out);
GF_VALIDATE_OR_GOTO(this->name, fd->inode, out);
@@ -2132,7 +2125,6 @@ svs_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);
@@ -2192,7 +2184,6 @@ svs_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, fd, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);
@@ -2276,7 +2267,6 @@ svs_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, fd, out);
GF_VALIDATE_OR_GOTO(this->name, fd->inode, out);
@@ -2387,7 +2377,6 @@ svs_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
GF_VALIDATE_OR_GOTO("snap-view-daemon", this, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);
@@ -2463,7 +2452,6 @@ svs_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int mask,
GF_VALIDATE_OR_GOTO("svs", this, out);
GF_VALIDATE_OR_GOTO(this->name, this->private, out);
GF_VALIDATE_OR_GOTO(this->name, frame, out);
- GF_VALIDATE_OR_GOTO(this->name, frame->root, out);
GF_VALIDATE_OR_GOTO(this->name, loc, out);
GF_VALIDATE_OR_GOTO(this->name, loc->inode, out);