Whamcloud - gitweb
merge b_devel into b_eq:
authorphil <phil>
Fri, 28 Nov 2003 22:12:49 +0000 (22:12 +0000)
committerphil <phil>
Fri, 28 Nov 2003 22:12:49 +0000 (22:12 +0000)
 - fixes from alex, tian, eeb
 - small differences in opinion

lustre/include/linux/lustre_log.h
lustre/ptlrpc/recov_thread.c

index 2060036..4a7b124 100644 (file)
@@ -95,7 +95,7 @@ int llog_cat_process(struct llog_handle *cat_llh, llog_cb_t cb, void *data);
 int llog_setup(struct obd_device *obd, int index, struct obd_device *disk_obd,
                int count,  struct llog_logid *logid, struct llog_operations *op);
 int llog_cleanup(struct llog_ctxt *);
-int llog_precleanup(struct llog_ctxt *);
+int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp);
 int llog_add(struct llog_ctxt *ctxt,
                         struct llog_rec_hdr *rec, struct lov_stripe_md *lsm,
                         struct llog_cookie *logcookies, int numcookies);
@@ -132,6 +132,7 @@ int llog_handle_connect(struct ptlrpc_request *req);
 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_sync(struct llog_ctxt *ctxt, struct obd_export *exp);
 int llog_repl_connect(struct llog_ctxt *ctxt, int count, 
                       struct llog_logid *logid, struct llog_ctxt_gen *gen);
 
@@ -157,7 +158,7 @@ struct llog_operations {
         int (*lop_setup)(struct obd_device *obd, int ctxt_idx, 
                          struct obd_device *disk_obd, int count, 
                          struct llog_logid *logid);
-        int (*lop_precleanup)(struct llog_ctxt *ctxt);
+        int (*lop_sync)(struct llog_ctxt *ctxt, struct obd_export *exp);
         int (*lop_cleanup)(struct llog_ctxt *ctxt);
         int (*lop_add)(struct llog_ctxt *ctxt, struct llog_rec_hdr *rec, 
                        struct lov_stripe_md *lsm, 
index 5dd9d29..74aa72b 100644 (file)
@@ -182,6 +182,28 @@ out:
 }
 EXPORT_SYMBOL(llog_obd_repl_cancel);
 
+int llog_obd_repl_sync(struct llog_ctxt *ctxt, struct obd_export *exp)
+{
+        int rc = 0;
+        ENTRY;
+
+        LASSERT(ctxt->loc_llcd);
+
+        if (exp && (ctxt->loc_imp == exp->exp_imp_reverse)) {
+                CWARN("import will be destroyed, put llcd %p\n", 
+                      ctxt->loc_llcd);
+                llcd_put(ctxt->loc_llcd);
+                ctxt->loc_llcd = NULL;
+                up(&ctxt->loc_sem);
+        } else {
+                up(&ctxt->loc_sem);
+                rc = llog_cancel(ctxt, NULL, 0, NULL, OBD_LLOG_FL_SENDNOW);
+        }
+
+        RETURN(rc);
+}
+EXPORT_SYMBOL(llog_obd_repl_sync);
+
 static int log_commit_thread(void *arg)
 {
         struct llog_commit_master *lcm = arg;
@@ -494,7 +516,7 @@ static int log_process_thread(void *args)
                 CWARN("no callback function for recovery\n");
 
         CDEBUG(D_HA, "send to llcd :%p forcibly\n", ctxt->loc_llcd);
-        llog_cancel(ctxt, NULL, 0, NULL, OBD_LLOG_FL_SENDNOW);
+        llog_sync(ctxt, NULL);
 out:
         rc = llog_cat_put(llh);
         if (rc)