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

CVS commit program cvs at parl.clemson.edu
Tue Mar 30 14:25:25 EST 2004


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

Modified Files:
	pvfs2-util.c 
Log Message:
- some vfs cleanups/naming consistency changes
- added full support for dynamic vfs mounts.  this means that pvfs2-client has
  absolutely NO dependence on a pvfs2tab file, as a pvfs2 server and fs_name
  MUST be specified at mount time.  An example of what this looks like is the
  following:

  mount -t pvfs2 tcp://lain.mcs.anl.gov:3334/pvfs2-fs /tmp/mnt

  This line contacts the server, resolves the file system information matching
  the name pvfs2-fs and mounts it locally on the vfs mount point /tmp/mnt.
  Running 'mount' now reports the fs as something like:

  tcp://lain.mcs.anl.gov:3334/pvfs2-fs on /tmp/mnt type pvfs2 (rw)
- this stuff needs more testing, and it breaks the old way of kernel mounting
  (documentation updates forthcoming)


Index: pvfs2-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/common/misc/pvfs2-util.c,v
diff -p -u -r1.45 -r1.46
--- pvfs2-util.c	24 Mar 2004 23:10:31 -0000	1.45
+++ pvfs2-util.c	30 Mar 2004 19:25:25 -0000	1.46
@@ -1132,11 +1132,20 @@ static int copy_mntent(
 
     if (dest_mntent && src_mntent)
     {
+        memset(dest_mntent, 0, sizeof(struct PVFS_sys_mntent));
+
         dest_mntent->pvfs_config_server =
             strdup(src_mntent->pvfs_config_server);
         dest_mntent->pvfs_fs_name = strdup(src_mntent->pvfs_fs_name);
-        dest_mntent->mnt_dir = strdup(src_mntent->mnt_dir);
-        dest_mntent->mnt_opts = strdup(src_mntent->mnt_opts);
+
+        if (src_mntent->mnt_dir)
+        {
+            dest_mntent->mnt_dir = strdup(src_mntent->mnt_dir);
+        }
+        if (src_mntent->mnt_opts)
+        {
+            dest_mntent->mnt_opts = strdup(src_mntent->mnt_opts);
+        }
         dest_mntent->flowproto = src_mntent->flowproto;
         dest_mntent->encoding = src_mntent->encoding;
         dest_mntent->fs_id = src_mntent->fs_id;



More information about the PVFS2-CVS mailing list