Whamcloud - gitweb
b=17660 remove unnecessary spinlock wrappings
authorAlexander.Zarochentev <alexander.zarochentev@sun.com>
Thu, 25 Feb 2010 08:32:58 +0000 (00:32 -0800)
committerRobert Read <rread@sun.com>
Thu, 25 Feb 2010 08:32:58 +0000 (00:32 -0800)
Read access to obd_recovering is atomic and doesn't need to be protected
by a spinlock.

i=tappro
i=adilger

lustre/mdt/mdt_handler.c
lustre/ost/ost_handler.c

index ff17a56..63e7b90 100644 (file)
@@ -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");
index 28f3deb..7751869 100644 (file)
@@ -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)