diff options
author | Pranith K <pranithk@gluster.com> | 2011-07-16 08:20:11 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-17 07:45:53 -0700 |
commit | 260edb905171ebed3692eaeca404d13202cd5fd0 (patch) | |
tree | 99eed823b978cd3568acdb938aea07aa1d7c67b2 /xlators/cluster/afr/src/pump.c | |
parent | b43038ee84839fa6b0e6aee037f7d952d8f52b6d (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
Diffstat (limited to 'xlators/cluster/afr/src/pump.c')
-rw-r--r-- | xlators/cluster/afr/src/pump.c | 14 |
1 files changed, 8 insertions, 6 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: |