summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-callback.c
diff options
context:
space:
mode:
authoryatip <ypadia@redhat.com>2020-02-20 14:14:43 +0530
committerAmar Tumballi <amar@kadalu.io>2020-03-03 11:56:10 +0000
commit1b0e1cfd7dcede3c4075094b6e14ef9af384a7ec (patch)
tree19834c041f9ff92b1b8a643ae5536e276f396962 /xlators/protocol/client/src/client-callback.c
parentd0ac63e462a71c267436d0bbc8fa638c39b9c69f (diff)
protocol/server: structure logging
Convert all gf_msg() to gf_smsg() Updates: #657 Change-Id: Ic54b03f05e2766c87f50df0b3a66803b5519fad9 Signed-off-by: yatip <ypadia@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client-callback.c')
0 files changed, 0 insertions, 0 deletions
summary='diff' class='diff'>
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 0131feaa075..afff0517e7f 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -3813,3 +3813,37 @@ afr_set_low_priority (call_frame_t *frame)
{
frame->root->pid = LOW_PRIO_PROC_PID;
}
+
+int
+afr_child_fd_ctx_set (xlator_t *this, fd_t *fd, int32_t child,
+ int flags, int32_t wbflags)
+{
+ int ret = 0;
+ uint64_t ctx = 0;
+ afr_fd_ctx_t *fd_ctx = NULL;
+
+ GF_ASSERT (fd && fd->inode);
+ ret = afr_fd_ctx_set (this, fd);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "could not set fd ctx for fd=%p", fd);
+ goto out;
+ }
+
+ ret = fd_ctx_get (fd, this, &ctx);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "could not get fd ctx for fd=%p", fd);
+ goto out;
+ }
+
+ fd_ctx = (afr_fd_ctx_t *)(long) ctx;
+ fd_ctx->opened_on[child] = AFR_FD_OPENED;
+ if (!IA_ISDIR (fd->inode->ia_type)) {
+ fd_ctx->flags = flags;
+ fd_ctx->wbflags = wbflags;
+ }
+ ret = 0;
+out:
+ return ret;
+}
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index 57f0a03fa6a..f2e6760cfd7 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -229,20 +229,31 @@ afr_opendir_cbk (call_frame_t *frame, void *cookie,
int32_t up_children_count = 0;
int ret = -1;
int call_count = -1;
+ int32_t child_index = 0;