[PVFS2-CVS] commit by pcarns in pvfs2/src/apps/vis: pvfs2-vis.c

CVS commit program cvs at parl.clemson.edu
Mon Mar 8 23:19:01 EST 2004


Update of /projects/cvsroot/pvfs2/src/apps/vis
In directory parlweb:/tmp/cvs-serv22815/src/apps/vis

Modified Files:
	pvfs2-vis.c 
Log Message:
modified PVFS_util_parse_pvfstab to return a const pointer to a tab
structure managed within the library; user no longer responsible for
allocating or freeing any of it


Index: pvfs2-vis.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/vis/pvfs2-vis.c,v
diff -p -u -r1.8 -r1.9
--- pvfs2-vis.c	8 Mar 2004 22:06:36 -0000	1.8
+++ pvfs2-vis.c	9 Mar 2004 04:19:01 -0000	1.9
@@ -68,7 +68,7 @@ int pvfs2_vis_stop(void)
 int pvfs2_vis_start(char* path, int update_interval)
 {
     PVFS_fs_id cur_fs;
-    PVFS_util_tab mnt = {0,NULL};
+    const PVFS_util_tab* tab;
     char pvfs_path[PVFS_NAME_MAX] = {0};
     int i,j;
     int mnt_index = -1;
@@ -95,19 +95,19 @@ int pvfs2_vis_start(char* path, int upda
     }
 
     /* look at pvfstab */
-    ret = PVFS_util_parse_pvfstab(NULL, &mnt);
-    if(ret < 0)
+    tab = PVFS_util_parse_pvfstab(NULL);
+    if(!tab)
     {
-        return(ret);
+        return(-PVFS_ENOENT);
     }
 
     /* see if the destination resides on any of the file systems
      * listed in the pvfstab; find the pvfs fs relative path
      */
-    for(i=0; i<mnt.mntent_count; i++)
+    for(i=0; i<tab->mntent_count; i++)
     {
 	ret = PVFS_util_remove_dir_prefix(path,
-	    mnt.mntent_array[i].mnt_dir, pvfs_path, PVFS_NAME_MAX);
+	    tab->mntent_array[i].mnt_dir, pvfs_path, PVFS_NAME_MAX);
 	if(ret == 0)
 	{
 	    mnt_index = i;
@@ -121,7 +121,7 @@ int pvfs2_vis_start(char* path, int upda
     }
 
     memset(&resp_init, 0, sizeof(resp_init));
-    ret = PVFS_sys_initialize(mnt, 0, &resp_init);
+    ret = PVFS_sys_initialize(*tab, 0, &resp_init);
     if(ret < 0)
     {
 	return(ret);



More information about the PVFS2-CVS mailing list