From 194ec62165c89a84ad7d36013dd77e981a374c93 Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Wed, 25 Aug 2010 06:07:14 +0000 Subject: cluster/afr: Do not issue blocking locks in self-heal. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Anand V. Avati BUG: 960 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=960 --- xlators/cluster/afr/src/afr-self-heal-common.c | 29 ++------------------- xlators/cluster/afr/src/afr-self-heal-data.c | 31 +++-------------------- xlators/cluster/afr/src/afr-self-heal-entry.c | 31 +++-------------------- xlators/cluster/afr/src/afr-self-heal-metadata.c | 32 +++--------------------- 4 files changed, 11 insertions(+), 112 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index aad259b84..6cf8d52e7 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1359,29 +1359,6 @@ sh_missing_entries_lookup (call_frame_t *frame, xlator_t *this) -int -afr_sh_post_blocking_entrylk_cbk (call_frame_t *frame, xlator_t *this) -{ - afr_internal_lock_t *int_lock = NULL; - afr_local_t *local = NULL; - - local = frame->local; - int_lock = &local->internal_lock; - - if (int_lock->lock_op_ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, - "Blocking entrylks failed."); - afr_sh_missing_entries_done (frame, this); - } else { - - gf_log (this->name, GF_LOG_DEBUG, - "Blocking entrylks done. Proceeding to FOP"); - sh_missing_entries_lookup (frame, this); - } - - return 0; -} - int afr_sh_post_nonblocking_entrylk_cbk (call_frame_t *frame, xlator_t *this) { @@ -1391,12 +1368,10 @@ afr_sh_post_nonblocking_entrylk_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; int_lock = &local->internal_lock; - /* Initiate blocking locks if non-blocking has failed */ if (int_lock->lock_op_ret < 0) { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking entrylks failed. Proceeding to blocking"); - int_lock->lock_cbk = afr_sh_post_blocking_entrylk_cbk; - afr_blocking_lock (frame, this); + "Non blocking entrylks failed."); + afr_sh_missing_entries_done (frame, this); } else { gf_log (this->name, GF_LOG_DEBUG, diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 8e87bc555..8e2cb94ad 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -924,29 +924,6 @@ afr_sh_data_fxattrop (call_frame_t *frame, xlator_t *this) int afr_sh_data_lock_rec (call_frame_t *frame, xlator_t *this); -int -afr_sh_data_post_blocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) -{ - afr_internal_lock_t *int_lock = NULL; - afr_local_t *local = NULL; - - local = frame->local; - int_lock = &local->internal_lock; - - if (int_lock->lock_op_ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, - "Blocking inodelks failed."); - afr_sh_data_done (frame, this); - } else { - - gf_log (this->name, GF_LOG_DEBUG, - "Blocking inodelks done. Proceeding to FOP"); - afr_sh_data_fxattrop (frame, this); - } - - return 0; -} - int afr_sh_data_post_nonblocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) { @@ -956,16 +933,14 @@ afr_sh_data_post_nonblocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; int_lock = &local->internal_lock; - /* Initiate blocking locks if non-blocking has failed */ if (int_lock->lock_op_ret < 0) { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking inodelks failed. Proceeding to blocking"); - int_lock->lock_cbk = afr_sh_data_post_blocking_inodelk_cbk; - afr_blocking_lock (frame, this); + "Non Blocking inodelks failed."); + afr_sh_data_done (frame, this); } else { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking inodelks done. Proceeding to FOP"); + "Non Blocking inodelks done. Proceeding to FOP"); afr_sh_data_fxattrop (frame, this); } diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index bf53fdb67..7aec50aad 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -2366,29 +2366,6 @@ afr_sh_entry_lookup (call_frame_t *frame, xlator_t *this) return 0; } -int -afr_sh_post_blocking_entry_cbk (call_frame_t *frame, xlator_t *this) -{ - afr_internal_lock_t *int_lock = NULL; - afr_local_t *local = NULL; - - local = frame->local; - int_lock = &local->internal_lock; - - if (int_lock->lock_op_ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, - "Blocking entrylks failed."); - afr_sh_entry_done (frame, this); - } else { - - gf_log (this->name, GF_LOG_DEBUG, - "Blocking entrylks done. Proceeding to FOP"); - afr_sh_entry_lookup(frame, this); - } - - return 0; -} - int afr_sh_post_nonblocking_entry_cbk (call_frame_t *frame, xlator_t *this) { @@ -2398,16 +2375,14 @@ afr_sh_post_nonblocking_entry_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; int_lock = &local->internal_lock; - /* Initiate blocking locks if non-blocking has failed */ if (int_lock->lock_op_ret < 0) { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking entrylks failed. Proceeding to blocking"); - int_lock->lock_cbk = afr_sh_post_blocking_entry_cbk; - afr_blocking_lock (frame, this); + "Non Blocking entrylks failed."); + afr_sh_entry_done (frame, this); } else { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking entrylks done. Proceeding to FOP"); + "Non Blocking entrylks done. Proceeding to FOP"); afr_sh_entry_lookup(frame, this); } diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 54972c52b..30820878b 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -670,29 +670,6 @@ afr_sh_metadata_lookup (call_frame_t *frame, xlator_t *this) return 0; } -int -afr_sh_post_blocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) -{ - afr_internal_lock_t *int_lock = NULL; - afr_local_t *local = NULL; - - local = frame->local; - int_lock = &local->internal_lock; - - if (int_lock->lock_op_ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, - "Blocking inodelks failed."); - afr_sh_metadata_done (frame, this); - } else { - - gf_log (this->name, GF_LOG_DEBUG, - "Blocking inodelks done. Proceeding to FOP"); - afr_sh_metadata_lookup (frame, this); - } - - return 0; -} - int afr_sh_post_nonblocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) { @@ -702,23 +679,20 @@ afr_sh_post_nonblocking_inodelk_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; int_lock = &local->internal_lock; - /* Initiate blocking locks if non-blocking has failed */ if (int_lock->lock_op_ret < 0) { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking inodelks failed. Proceeding to blocking"); - int_lock->lock_cbk = afr_sh_post_blocking_inodelk_cbk; - afr_blocking_lock (frame, this); + "Non Blocking inodelks failed."); + afr_sh_metadata_done (frame, this); } else { gf_log (this->name, GF_LOG_DEBUG, - "Non blocking inodelks done. Proceeding to FOP"); + "Non Blocking inodelks done. Proceeding to FOP"); afr_sh_metadata_lookup (frame, this); } return 0; } - int afr_sh_metadata_lock (call_frame_t *frame, xlator_t *this) { -- cgit