From 260edb905171ebed3692eaeca404d13202cd5fd0 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Sat, 16 Jul 2011 08:20:11 +0000 Subject: PUMP: set pump lk_owner,pid to frame->root Signed-off-by: Pranith Kumar K Signed-off-by: Anand Avati BUG: 3182 (Afr self-heal should happen with out big lock) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3182 --- xlators/cluster/afr/src/pump.c | 14 ++++++++------ xlators/cluster/afr/src/pump.h | 3 --- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c index e7ff4651d..3adac9502 100644 --- a/xlators/cluster/afr/src/pump.c +++ b/xlators/cluster/afr/src/pump.c @@ -29,6 +29,7 @@ #include "afr-common.c" #include "defaults.c" +static uint64_t pump_pid = 0; static int pump_mark_start_pending (xlator_t *this) { @@ -425,7 +426,7 @@ gf_pump_traverse_directory (loc_t *loc) GF_ASSERT (loc->inode); - fd = fd_create (loc->inode, PUMP_PID); + fd = fd_create (loc->inode, pump_pid); if (!fd) { gf_log (this->name, GF_LOG_ERROR, "Failed to create fd for %s", loc->path); @@ -804,21 +805,22 @@ pump_start (call_frame_t *pump_frame, xlator_t *this) priv = this->private; pump_priv = priv->pump_private; - if (!pump_frame->root->lk_owner) - pump_frame->root->lk_owner = PUMP_LK_OWNER; + pump_frame->root->lk_owner = (uint64_t) (unsigned long)pump_frame->root; + pump_pid = (uint64_t) (unsigned long)pump_frame->root; ret = synctask_new (pump_priv->env, pump_task, pump_task_completion, pump_frame, NULL); if (ret == -1) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_ERROR, "starting pump failed"); pump_change_state (this, PUMP_STATE_ABORT); goto out; } - gf_log (this->name, GF_LOG_TRACE, - "setting pump as started"); + gf_log (this->name, GF_LOG_DEBUG, + "setting pump as started lk_owner: %"PRIu64" %"PRIu64, + pump_frame->root->lk_owner, pump_pid); priv->use_afr_in_pump = 1; out: diff --git a/xlators/cluster/afr/src/pump.h b/xlators/cluster/afr/src/pump.h index 394e6eab7..d69db9368 100644 --- a/xlators/cluster/afr/src/pump.h +++ b/xlators/cluster/afr/src/pump.h @@ -26,9 +26,6 @@ #define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect" #define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect" -#define PUMP_PID 696969 -#define PUMP_LK_OWNER 696969 - #define IS_ROOT_PATH(path) (!strcmp (path, "/")) #define IS_ENTRY_CWD(entry) (!strcmp (entry, ".")) #define IS_ENTRY_PARENT(entry) (!strcmp (entry, "..")) -- cgit