Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / liblustre / llite_lib.c
index 8adbb45..9aa5498 100644 (file)
 #include <sys/stat.h>
 #include <sys/queue.h>
 
+#include <sysio.h>
 #ifdef HAVE_XTIO_H
 #include <xtio.h>
 #endif
-#include <sysio.h>
 #include <fs.h>
 #include <mount.h>
 #include <inode.h>
@@ -44,6 +44,7 @@
  * of 'LIST_HEAD'. undef it to suppress warnings
  */
 #undef LIST_HEAD
+#include <liblustre.h>
 #include <lnet/lnetctl.h>     /* needed for parse_dump */
 
 #include "lutil.h"
@@ -56,6 +57,7 @@ static int lllib_init(void)
             init_obdclass() ||
             ptlrpc_init() ||
             mgc_init() ||
+            lmv_init() ||
             mdc_init() ||
             lov_init() ||
             osc_init())
@@ -84,7 +86,7 @@ int liblustre_process_log(struct config_llog_instance *cfg,
         struct obd_connect_data *ocd = NULL;
         ENTRY;
 
-        generate_random_uuid(uuid);
+        ll_generate_random_uuid(uuid);
         class_uuid_unparse(uuid, &mgc_uuid);
 
         nid = libcfs_str2nid(mgsnid);
@@ -155,10 +157,13 @@ int liblustre_process_log(struct config_llog_instance *cfg,
         if (ocd == NULL)
                 GOTO(out_cleanup, rc = -ENOMEM);
 
-        ocd->ocd_connect_flags = OBD_CONNECT_VERSION;
+        ocd->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_FID;
+#ifdef LIBLUSTRE_POSIX_ACL
+        ocd->ocd_connect_flags |= OBD_CONNECT_ACL;
+#endif
         ocd->ocd_version = LUSTRE_VERSION_CODE;
 
-        rc = obd_connect(&mgc_conn, obd, &mgc_uuid, ocd);
+        rc = obd_connect(NULL, &mgc_conn, obd, &mgc_uuid, ocd, NULL);
         if (rc) {
                 CERROR("cannot connect to %s at %s: rc = %d\n",
                        LUSTRE_MGS_OBDNAME, mgsnid, rc);
@@ -167,9 +172,10 @@ int liblustre_process_log(struct config_llog_instance *cfg,
 
         exp = class_conn2export(&mgc_conn);
 
-        ctxt = exp->exp_obd->obd_llog_ctxt[LLOG_CONFIG_REPL_CTXT];
+        ctxt = llog_get_context(exp->exp_obd, LLOG_CONFIG_REPL_CTXT);
         cfg->cfg_flags |= CFG_F_COMPAT146;
         rc = class_config_parse_llog(ctxt, profile, cfg);
+        llog_ctxt_put(ctxt);
         if (rc) {
                 CERROR("class_config_parse_llog failed: rc = %d\n", rc);
         }
@@ -189,7 +195,7 @@ out_cleanup:
         err = class_process_config(lcfg);
         lustre_cfg_free(lcfg);
         if (err)
-                CERROR("mdc_cleanup failed: rc = %d\n", err);
+                CERROR("md_cleanup failed: rc = %d\n", err);
 
 out_detach:
         lustre_cfg_bufs_reset(&bufs, name);
@@ -197,7 +203,7 @@ out_detach:
         err = class_process_config(lcfg);
         lustre_cfg_free(lcfg);
         if (err)
-                CERROR("mdc_detach failed: rc = %d\n", err);
+                CERROR("md_detach failed: rc = %d\n", err);
 
 out_del_uuid:
         lustre_cfg_bufs_reset(&bufs, name);
@@ -307,9 +313,7 @@ char *lustre_path = NULL;
 void __liblustre_setup_(void)
 {
         char *target = NULL;
-        char *root_driver = "native";
         char *lustre_driver = "lustre";
-        char *root_path = "/";
         unsigned mntflgs = 0;
         int err;
 
@@ -336,7 +340,7 @@ void __liblustre_setup_(void)
         }
         _sysio_native_init();
 
-        err = _sysio_mount_root(root_path, root_driver, mntflgs, NULL);
+        err = _sysio_mount_root("/", "native", mntflgs, NULL);
         if (err) {
                 fprintf(stderr, "sysio mount failed: %s\n", strerror(errno));
                 exit(1);