#include <sys/types.h>
#include <sys/queue.h>
+#ifdef HAVE_XTIO_H
+#include <xtio.h>
+#endif
#include <sysio.h>
#include <fs.h>
#include <mount.h>
#include <inode.h>
+#ifdef HAVE_FILE_H
#include <file.h>
+#endif
+
+/* env variables */
+#define ENV_LUSTRE_MNTPNT "LIBLUSTRE_MOUNT_POINT"
+#define ENV_LUSTRE_MNTTGT "LIBLUSTRE_MOUNT_TARGET"
+#define ENV_LUSTRE_TIMEOUT "LIBLUSTRE_TIMEOUT"
+#define ENV_LUSTRE_DUMPFILE "LIBLUSTRE_DUMPFILE"
+#define ENV_LUSTRE_DEBUG_MASK "LIBLUSTRE_DEBUG_MASK"
+#define ENV_LUSTRE_DEBUG_SUBSYS "LIBLUSTRE_DEBUG_SUBSYS"
+#define ENV_LUSTRE_NAL_NAME "LIBLUSTRE_NAL_NAME"
#ifdef REDSTORM
#define CSTART_INIT
struct llog_ctxt *ctxt;
ptl_nid_t nid = 0;
int nal, err, rc = 0;
+ char *nal_name;
ENTRY;
generate_random_uuid(uuid);
RETURN(-EINVAL);
}
- nal = ptl_name2nal(LIBLUSTRE_NAL_NAME);
+ nal_name = getenv(ENV_LUSTRE_NAL_NAME);
+ if (!nal_name)
+ nal_name = "tcp";
+ nal = ptl_name2nal(nal_name);
if (nal <= 0) {
- CERROR("Can't parse NAL %s\n", LIBLUSTRE_NAL_NAME);
+ CERROR("Can't parse NAL %s\n", nal_name);
RETURN(-EINVAL);
}
LCFG_INIT(lcfg, LCFG_ADD_UUID, name);
err = class_process_config(&lcfg);
if (err < 0)
GOTO(out_detach, err);
-
+
obd = class_name2obd(name);
if (obd == NULL)
GOTO(out_cleanup, err = -EINVAL);
g_zconf_mdsname, err);
GOTO(out_cleanup, err);
}
-
+
exp = class_conn2export(&mdc_conn);
-
+
ctxt = exp->exp_obd->obd_llog_ctxt[LLOG_CONFIG_REPL_CTXT];
rc = class_config_process_llog(ctxt, g_zconf_profile, cfg);
if (rc)
out:
if (rc == 0)
rc = err;
-
+
RETURN(rc);
}
if ((s = strchr(buf, ':'))) {
*mdsnid = buf;
*s = '\0';
-
+
while (*++s == '/')
;
*mdsname = s;
* or in the apps themselves. The NAMESPACE_STRING specifying
* the initial set of fs ops (creates, mounts, etc.) is passed
* as an environment variable.
- *
+ *
* _sysio_init();
* _sysio_incore_init();
* _sysio_native_init();
err = lllib_init();
if (err) {
perror("init llite driver");
- }
+ }
return err;
}
-/* env variables */
-#define ENV_LUSTRE_MNTPNT "LIBLUSTRE_MOUNT_POINT"
-#define ENV_LUSTRE_MNTTGT "LIBLUSTRE_MOUNT_TARGET"
-#define ENV_LUSTRE_TIMEOUT "LIBLUSTRE_TIMEOUT"
-#define ENV_LUSTRE_DUMPFILE "LIBLUSTRE_DUMPFILE"
-#define ENV_LUSTRE_DEBUG_MASK "LIBLUSTRE_DEBUG_MASK"
-#define ENV_LUSTRE_DEBUG_SUBSYS "LIBLUSTRE_DEBUG_SUBSYS"
-
extern int _sysio_native_init();
extern unsigned int obd_timeout;
-static char *lustre_path = NULL;
+char *lustre_path = NULL;
/* global variables */
char *g_zconf_mdsname = NULL; /* mdsname, for zeroconf */
portal_subsystem_debug =
(unsigned int) strtol(debug_subsys, NULL, 0);
-#ifndef CSTART_INIT
+
+#ifdef INIT_SYSIO
/* initialize libsysio & mount rootfs */
- if (_sysio_init()) {
- perror("init sysio");
- exit(1);
- }
+ if (_sysio_init()) {
+ perror("init sysio");
+ exit(1);
+ }
_sysio_native_init();
- err = _sysio_mount_root(root_path, root_driver, mntflgs, NULL);
- if (err) {
- perror(root_driver);
- exit(1);
- }
+ err = _sysio_mount_root(root_path, root_driver, mntflgs, NULL);
+ if (err) {
+ perror(root_driver);
+ exit(1);
+ }
if (_sysio_lustre_init())
- exit(1);
-#endif
+ exit(1);
+#endif /* INIT_SYSIO */
err = mount("/", lustre_path, lustre_driver, mntflgs, NULL);
- if (err) {
- errno = -err;
- perror(lustre_driver);
- exit(1);
- }
+ if (err) {
+ errno = -err;
+ perror(lustre_driver);
+ exit(1);
+ }
}
void __liblustre_cleanup_(void)
* liblutre. this delima lead to another hack in
* libsysio/src/file_hack.c FIXME
*/
+#ifdef INIT_SYSIO
_sysio_shutdown();
cleanup_lib_portals();
PtlFini();
+#else
+ /*
+ * don't do any libsysio or low level portals cleanups
+ * platform framework does it
+ */
+ cleanup_lib_portals();
+#endif
}