[PVFS2-CVS] commit by pcarns in pvfs2/src/common/misc: pvfs2-util.c

CVS commit program cvs at parl.clemson.edu
Thu Mar 11 17:19:23 EST 2004


Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb:/tmp/cvs-serv5270/src/common/misc

Modified Files:
	pvfs2-util.c 
Log Message:
added hooks to add file systems _after_ system interface initialization, 
updated apps accordingly, made pvfs2-ping more verbose using the extra info
that we now have access to.  still not very robust.  here are some
(temporary) limitations:
- client must initialize all compiled in flowprotocols and bmi modules from
  the beginning, no hooks to init them as we go
- can't remove file systems that have been added
- probably can't yet add file systems that didn't come from parse_fstab() call


Index: pvfs2-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-util.c,v
diff -p -u -r1.36 -r1.37
--- pvfs2-util.c	9 Mar 2004 21:41:30 -0000	1.36
+++ pvfs2-util.c	11 Mar 2004 22:19:23 -0000	1.37
@@ -388,8 +388,9 @@ int PVFS_util_resolve(
 int PVFS_util_init_defaults(void)
 {
     const PVFS_util_tab* tab;
-    PVFS_sysresp_init resp_init;
     int ret = -1;
+    int i;
+    int found_one = 0;
 
     /* use standard system tab files */
     tab = PVFS_util_parse_pvfstab(NULL);
@@ -401,14 +402,38 @@ int PVFS_util_init_defaults(void)
     }
 
     /* initialize pvfs system interface */
-    memset(&resp_init, 0, sizeof(resp_init));
-    ret = PVFS_sys_initialize(*tab, GOSSIP_NO_DEBUG, &resp_init);
+    ret = PVFS_sys_initialize(GOSSIP_NO_DEBUG);
     if(ret < 0)
     {
 	return(ret);
     }
 
-    return(0);
+    /* add in any file systems we found in the fstab */
+    for(i=0; i<tab->mntent_count; i++)
+    {
+	ret = PVFS_sys_fs_add(&tab->mntent_array[i]);
+	if(ret == 0)
+	{
+	    found_one = 1;
+	}
+	else
+	{
+	    gossip_err("WARNING: failed to initialize file system for mount "
+		"point %s in tab file %s\n", tab->mntent_array[i].mnt_dir,
+		tab->tabfile_name);
+	}
+    }
+
+    if(found_one)
+    {
+	return(0);
+    }
+    else
+    {
+	gossip_err("ERROR: could not initialize any file systems in %s.\n",
+	    tab->tabfile_name);
+	return(-PVFS_ENODEV);
+    }
 }
 
 /* PVFS_util_lookup_parent()



More information about the PVFS2-CVS mailing list