Whamcloud - gitweb
LU-1302 llog: introduce llog_open
[fs/lustre-release.git] / lustre / mdc / mdc_request.c
index 8e99fc4..02ef0f2 100644 (file)
@@ -1289,16 +1289,18 @@ static int mdc_changelog_send_thread(void *csdata)
         ctxt = llog_get_context(cs->cs_obd, LLOG_CHANGELOG_REPL_CTXT);
         if (ctxt == NULL)
                 GOTO(out, rc = -ENOENT);
         ctxt = llog_get_context(cs->cs_obd, LLOG_CHANGELOG_REPL_CTXT);
         if (ctxt == NULL)
                 GOTO(out, rc = -ENOENT);
-       rc = llog_create(NULL, ctxt, &llh, NULL, CHANGELOG_CATALOG);
-        if (rc) {
-                CERROR("llog_create() failed %d\n", rc);
-                GOTO(out, rc);
-        }
+       rc = llog_open(NULL, ctxt, &llh, NULL, CHANGELOG_CATALOG,
+                      LLOG_OPEN_EXISTS);
+       if (rc) {
+               CERROR("%s: fail to open changelog catalog: rc = %d\n",
+                      cs->cs_obd->obd_name, rc);
+               GOTO(out, rc);
+       }
        rc = llog_init_handle(NULL, llh, LLOG_F_IS_CAT, NULL);
        rc = llog_init_handle(NULL, llh, LLOG_F_IS_CAT, NULL);
-        if (rc) {
-                CERROR("llog_init_handle failed %d\n", rc);
-                GOTO(out, rc);
-        }
+       if (rc) {
+               CERROR("llog_init_handle failed %d\n", rc);
+               GOTO(out, rc);
+       }
 
        rc = llog_cat_process(NULL, llh, changelog_show_cb, cs, 0, 0);
 
 
        rc = llog_cat_process(NULL, llh, changelog_show_cb, cs, 0, 0);
 
@@ -1312,7 +1314,7 @@ static int mdc_changelog_send_thread(void *csdata)
 out:
         cfs_put_file(cs->cs_fp);
         if (llh)
 out:
         cfs_put_file(cs->cs_fp);
         if (llh)
-               llog_cat_put(NULL, llh);
+               llog_cat_close(NULL, llh);
         if (ctxt)
                 llog_ctxt_put(ctxt);
         if (cs->cs_buf)
         if (ctxt)
                 llog_ctxt_put(ctxt);
         if (cs->cs_buf)