From: Yang Sheng Date: Mon, 8 Oct 2018 15:01:01 +0000 (+0800) Subject: LU-11453 class: use INIT_LIST_HEAD_RCU instead INIT_LIST_HEAD X-Git-Tag: 2.12.0-RC1~159 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=68bc3984975bb72f730d8a8ab7aa2d836e50abe5 LU-11453 class: use INIT_LIST_HEAD_RCU instead INIT_LIST_HEAD Use INIT_LIST_HEAD_RCU to avoid compiler optimization too much in some case. Signed-off-by: Yang Sheng Change-Id: I66b340ac3147d2cb911a2b7d3e210c6847047dac Reviewed-on: https://review.whamcloud.com/33317 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Tested-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index c94af9a..3c44552 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -478,7 +478,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource) lprocfs_counter_incr(ldlm_res_to_ns(resource)->ns_stats, LDLM_NSS_LOCKS); - INIT_LIST_HEAD(&lock->l_handle.h_link); + INIT_LIST_HEAD_RCU(&lock->l_handle.h_link); class_handle_hash(&lock->l_handle, &lock_handle_ops); lu_ref_init(&lock->l_reference); diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 28d0656..2597f43 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -63,7 +63,7 @@ struct mdt_file_data *mdt_mfd_new(const struct mdt_export_data *med) OBD_ALLOC_PTR(mfd); if (mfd != NULL) { - INIT_LIST_HEAD(&mfd->mfd_open_handle.h_link); + INIT_LIST_HEAD_RCU(&mfd->mfd_open_handle.h_link); mfd->mfd_open_handle.h_owner = med; INIT_LIST_HEAD(&mfd->mfd_list); class_handle_hash(&mfd->mfd_open_handle, &mfd_open_handle_ops); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 1325398..84a8ce1 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -1106,7 +1106,7 @@ struct obd_export *__class_new_export(struct obd_device *obd, spin_lock_init(&export->exp_uncommitted_replies_lock); INIT_LIST_HEAD(&export->exp_uncommitted_replies); INIT_LIST_HEAD(&export->exp_req_replay_queue); - INIT_LIST_HEAD(&export->exp_handle.h_link); + INIT_LIST_HEAD_RCU(&export->exp_handle.h_link); INIT_LIST_HEAD(&export->exp_hp_rpcs); INIT_LIST_HEAD(&export->exp_reg_rpcs); class_handle_hash(&export->exp_handle, &export_handle_ops); @@ -1360,7 +1360,7 @@ struct obd_import *class_new_import(struct obd_device *obd) atomic_set(&imp->imp_replay_inflight, 0); atomic_set(&imp->imp_inval_count, 0); INIT_LIST_HEAD(&imp->imp_conn_list); - INIT_LIST_HEAD(&imp->imp_handle.h_link); + INIT_LIST_HEAD_RCU(&imp->imp_handle.h_link); class_handle_hash(&imp->imp_handle, &import_handle_ops); init_imp_at(&imp->imp_at);