Whamcloud - gitweb
- struct obd should be 64bits aligned
[fs/lustre-release.git] / lustre / ptlrpc / recov_thread.c
index d28b0b6..305789f 100644 (file)
@@ -133,9 +133,8 @@ EXPORT_SYMBOL(llcd_send);
  * log record for the deletion.  The commit callback calls this
  * function
  */
-int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
-                         struct lov_stripe_md *lsm, int count,
-                         struct llog_cookie *cookies, int flags)
+int llog_obd_repl_cancel(struct llog_ctxt *ctxt, int count,
+                         struct llog_cookie *cookies, int flags, void *data)
 {
         struct llog_canceld_ctxt *llcd;
         int rc = 0;
@@ -143,6 +142,11 @@ int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
 
         LASSERT(ctxt);
 
+        if (ctxt->loc_imp == NULL) {
+                CWARN("no import for ctxt %p\n", ctxt);
+                RETURN(0);
+        }
+
         if (count == 0 || cookies == NULL) {
                 down(&ctxt->loc_sem);
                 if (ctxt->loc_llcd == NULL || !(flags & OBD_LLOG_FL_SENDNOW))
@@ -199,7 +203,7 @@ int llog_obd_repl_sync(struct llog_ctxt *ctxt, struct obd_export *exp)
                 }
                 up(&ctxt->loc_sem);
         } else {
-                rc = llog_cancel(ctxt, NULL, 0, NULL, OBD_LLOG_FL_SENDNOW);
+                rc = llog_cancel(ctxt, 0, NULL, OBD_LLOG_FL_SENDNOW, NULL);
         }
 
         RETURN(rc);
@@ -227,8 +231,9 @@ static int log_commit_thread(void *arg)
         SIGNAL_MASK_UNLOCK(current, flags);
 
         spin_lock(&lcm->lcm_thread_lock);
-        THREAD_NAME(current->comm, "ll_log_commit_%d",
-                    atomic_read(&lcm->lcm_thread_total));
+
+        THREAD_NAME(current->comm, sizeof(current->comm) - 1,
+                    "ll_log_comt_%02d", atomic_read(&lcm->lcm_thread_total));
         atomic_inc(&lcm->lcm_thread_total);
         spin_unlock(&lcm->lcm_thread_lock);
         unlock_kernel();
@@ -363,9 +368,9 @@ static int log_commit_thread(void *arg)
                                 ptlrpc_req_finished(request);
                                 continue;
                         }
+                        up(&llcd->llcd_ctxt->loc_sem);
                         rc = ptlrpc_queue_wait(request);
                         ptlrpc_req_finished(request);
-                        up(&llcd->llcd_ctxt->loc_sem);
 
                         /* If the RPC failed, we put this and the remaining
                          * messages onto the resend list for another time. */
@@ -509,7 +514,7 @@ static int log_process_thread(void *args)
         SIGNAL_MASK_UNLOCK(current, flags);
         unlock_kernel();
 
-        rc = llog_create(ctxt, &llh, &logid, NULL);
+        rc = llog_open(ctxt, &llh, &logid, NULL, 0);
         if (rc) {
                 CERROR("llog_create failed %d\n", rc);
                 RETURN(rc);
@@ -561,7 +566,8 @@ static int llog_recovery_generic(struct llog_ctxt *ctxt, void *handle,void *arg)
 }
 
 int llog_repl_connect(struct llog_ctxt *ctxt, int count,
-                      struct llog_logid *logid, struct llog_gen *gen)
+                      struct llog_logid *logid, struct llog_gen *gen,
+                      struct obd_uuid *uuid)
 {
         struct llog_canceld_ctxt *llcd;
         int rc;
@@ -595,9 +601,8 @@ EXPORT_SYMBOL(llog_repl_connect);
 
 #else /* !__KERNEL__ */
 
-int llog_obd_repl_cancel(struct llog_ctxt *ctxt,
-                         struct lov_stripe_md *lsm, int count,
-                         struct llog_cookie *cookies, int flags)
+int llog_obd_repl_cancel(struct llog_ctxt *ctxt, int count,
+                         struct llog_cookie *cookies, int flags, void *data)
 {
         return 0;
 }