From: Alexander.Zarochentev Date: Thu, 25 Feb 2010 08:32:58 +0000 (-0800) Subject: b=17660 remove unnecessary spinlock wrappings X-Git-Tag: 1.10.0.38~20 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=76dd8b2623d52bb14deea6999b0495f38b3f8321 b=17660 remove unnecessary spinlock wrappings Read access to obd_recovering is atomic and doesn't need to be protected by a spinlock. i=tappro i=adilger --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index ff17a56..63e7b90 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2759,7 +2759,6 @@ static int mdt_filter_recovery_request(struct ptlrpc_request *req, static int mdt_recovery(struct mdt_thread_info *info) { struct ptlrpc_request *req = mdt_info_req(info); - int recovering; struct obd_device *obd; ENTRY; @@ -2820,10 +2819,7 @@ static int mdt_recovery(struct mdt_thread_info *info) obd = req->rq_export->exp_obd; /* Check for aborted recovery... */ - cfs_spin_lock_bh(&obd->obd_processing_task_lock); - recovering = obd->obd_recovering; - cfs_spin_unlock_bh(&obd->obd_processing_task_lock); - if (unlikely(recovering)) { + if (unlikely(obd->obd_recovering)) { int rc; int should_process; DEBUG_REQ(D_INFO, req, "Got new replay"); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 28f3deb..7751869 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -2001,8 +2001,6 @@ int ost_handle(struct ptlrpc_request *req) req_capsule_init(&req->rq_pill, req, RCL_SERVER); if (lustre_msg_get_opc(req->rq_reqmsg) != OST_CONNECT) { - int recovering; - if (!class_connected_export(req->rq_export)) { CDEBUG(D_HA,"operation %d on unconnected OST from %s\n", lustre_msg_get_opc(req->rq_reqmsg), @@ -2014,10 +2012,7 @@ int ost_handle(struct ptlrpc_request *req) obd = req->rq_export->exp_obd; /* Check for aborted recovery. */ - cfs_spin_lock_bh(&obd->obd_processing_task_lock); - recovering = obd->obd_recovering; - cfs_spin_unlock_bh(&obd->obd_processing_task_lock); - if (recovering) { + if (obd->obd_recovering) { rc = ost_filter_recovery_request(req, obd, &should_process); if (rc || !should_process)