[PVFS2-CVS] commit by pcarns in pvfs2/src/apps/vis: pvfs2-vis.c
CVS commit program
cvs at parl.clemson.edu
Tue Mar 9 15:36:29 EST 2004
Update of /projects/cvsroot/pvfs2/src/apps/vis
In directory parlweb:/tmp/cvs-serv26932
Modified Files:
pvfs2-vis.c
Log Message:
converted vis tool backend to use PVFS_util_resolve()
Index: pvfs2-vis.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/vis/pvfs2-vis.c,v
diff -p -u -r1.9 -r1.10
--- pvfs2-vis.c 9 Mar 2004 04:19:01 -0000 1.9
+++ pvfs2-vis.c 9 Mar 2004 20:36:29 -0000 1.10
@@ -71,7 +71,6 @@ int pvfs2_vis_start(char* path, int upda
const PVFS_util_tab* tab;
char pvfs_path[PVFS_NAME_MAX] = {0};
int i,j;
- int mnt_index = -1;
PVFS_sysresp_init resp_init;
PVFS_credentials creds;
int ret = -1;
@@ -101,25 +100,6 @@ int pvfs2_vis_start(char* path, int upda
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<tab->mntent_count; i++)
- {
- ret = PVFS_util_remove_dir_prefix(path,
- tab->mntent_array[i].mnt_dir, pvfs_path, PVFS_NAME_MAX);
- if(ret == 0)
- {
- mnt_index = i;
- break;
- }
- }
-
- if(mnt_index == -1)
- {
- return(-PVFS_ENOENT);
- }
-
memset(&resp_init, 0, sizeof(resp_init));
ret = PVFS_sys_initialize(*tab, 0, &resp_init);
if(ret < 0)
@@ -127,7 +107,13 @@ int pvfs2_vis_start(char* path, int upda
return(ret);
}
- cur_fs = resp_init.fsid_list[mnt_index];
+ /* translate local path into pvfs2 relative path */
+ ret = PVFS_util_resolve(path,
+ &cur_fs, pvfs_path, PVFS_NAME_MAX);
+ if(ret < 0)
+ {
+ return(-PVFS_ENOENT);
+ }
creds.uid = getuid();
creds.gid = getgid();
More information about the PVFS2-CVS
mailing list