summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-07-16 08:20:11 +0000
committerAnand Avati <avati@gluster.com>2011-07-17 07:45:53 -0700
commit260edb905171ebed3692eaeca404d13202cd5fd0 (patch)
tree99eed823b978cd3568acdb938aea07aa1d7c67b2
parentb43038ee84839fa6b0e6aee037f7d952d8f52b6d (diff)
PUMP: set pump lk_owner,pid to frame->root
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3182 (Afr self-heal should happen with out big lock) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3182
-rw-r--r--xlators/cluster/afr/src/pump.c14
-rw-r--r--xlators/cluster/afr/src/pump.h3
2 files changed, 8 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c
index e7ff4651da2..3adac9502f4 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 394e6eab753..d69db936899 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, ".."))