#include <inode.h>
#include <file.h>
+/* both sys/queue.h (libsysio require it) and portals/lists.h have definition
+ * of 'LIST_HEAD'. undef it to suppress warnings
+ */
+#undef LIST_HEAD
+
#include <portals/api-support.h> /* needed for ptpctl.h */
#include <portals/ptlctl.h> /* needed for parse_dump */
#include <procbridge.h>
ptl_handle_ni_t tcpnal_ni;
-struct task_struct *current;
-struct obd_class_user_state ocus;
+struct task_struct *current;
/* portals interfaces */
ptl_handle_ni_t *
PtlInit();
rc = PtlNIInit(procbridge_interface, 0, 0, 0, &tcpnal_ni);
if (rc != 0) {
- CERROR("ksocknal: PtlNIInit failed: error %d\n", rc);
+ CERROR("TCPNAL: PtlNIInit failed: error %d\n", rc);
PtlFini();
RETURN (rc);
}
return 0;
}
-extern int class_handle_ioctl(struct obd_class_user_state *ocus, unsigned int cmd, unsigned long arg);
+extern int class_handle_ioctl(unsigned int cmd, unsigned long arg);
int lib_ioctl_nalcmd(int dev_id, int opc, void * ptr)
{
ioc->ioc_pbuf1 = ioc->ioc_bulk;
//XXX
- rc = class_handle_ioctl(&ocus, opc, (unsigned long)ptr);
+ rc = class_handle_ioctl(opc, (unsigned long)ptr);
printf ("proccssing ioctl cmd: %x, rc %d\n", opc, rc);
int lllib_init(char *dumpfile)
{
- INIT_LIST_HEAD(&ocus.ocus_conns);
-
if (!g_zconf) {
/* this parse only get my nid from config file
* before initialize portals
} else {
/* XXX need setup mynid before tcpnal initialize */
tcpnal_mynid = ((uint64_t)getpid() << 32) | time(0);
- printf("set tcpnal mynid: %016llx\n", tcpnal_mynid);
+ printf("LibLustre: TCPNAL NID: %016llx\n", tcpnal_mynid);
}
init_current("dummy");
}
#endif
-int liblustre_process_log(struct config_llog_instance *cfg)
+int liblustre_process_log(struct config_llog_instance *cfg, int allow_recov)
{
struct lustre_cfg lcfg;
char *peer = "MDS_PEER_UUID";
if (obd == NULL)
GOTO(out_cleanup, err = -EINVAL);
+ /* Disable initial recovery on this import */
+ err = obd_set_info(obd->obd_self_export,
+ strlen("initial_recov"), "initial_recov",
+ sizeof(allow_recov), &allow_recov);
+
err = obd_connect(&mdc_conn, obd, &mdc_uuid);
if (err) {
CERROR("cannot connect to %s: rc = %d\n",
/* 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"
extern int _sysio_native_init();
+extern unsigned int obd_timeout;
+
/* global variables */
int g_zconf = 0; /* zeroconf or dumpfile */
char *g_zconf_mdsname = NULL; /* mdsname, for zeroconf */
{
char *lustre_path = NULL;
char *target = NULL;
+ char *timeout = NULL;
char *dumpfile = NULL;
char *root_driver = "native";
char *lustre_driver = "llite";
int err;
- srand(time(NULL));
+ /* consider tha case of starting multiple liblustre instances
+ * at a same time on single node.
+ */
+ srand(time(NULL) + getpid());
signal(SIGUSR1, sighandler_USR1);
lustre_path, target);
}
+ timeout = getenv(ENV_LUSTRE_TIMEOUT);
+ if (timeout) {
+ obd_timeout = (unsigned int) atoi(timeout);
+ printf("LibLustre: set obd timeout as %u seconds\n",
+ obd_timeout);
+ }
+
if (_sysio_init() != 0) {
perror("init sysio");
exit(1);