[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/apps/admin: pvfs2-genconfig

CVS commit program cvs at parl.clemson.edu
Thu Aug 7 12:30:15 EDT 2008


Update of /projects/cvsroot/pvfs2-1/src/apps/admin
In directory parlweb1:/tmp/cvs-serv6370/src/apps/admin

Modified Files:
      Tag: small-file-branch
	pvfs2-genconfig 
Log Message:
merge trunk updates down to small-file-branch.  Passes basic tests but needs
some double checking of pint-cached-config and sys-create conflicts.


Index: pvfs2-genconfig
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/apps/admin/pvfs2-genconfig,v
diff -p -u -r1.77.2.5 -r1.77.2.6
--- pvfs2-genconfig	1 Aug 2008 18:53:02 -0000	1.77.2.5
+++ pvfs2-genconfig	7 Aug 2008 16:30:14 -0000	1.77.2.6
@@ -38,6 +38,7 @@ my $opt_first_handle = '';
 my $opt_last_handle = '';
 my $opt_root_handle = '';
 my $opt_fsid = '';
+my $opt_fsname = '';
 my $opt_default_num_dfiles = '';
 my $opt_default_flow_buffer_size = '';
 my $opt_default_flow_buffer_count = '';
@@ -145,16 +146,17 @@ sub parse_hostlist
     # hostb
     # hostc{1,2,3}
     #
-    @components = $inputline =~ /(?:,?[ ]*([^{,]+(?:{[^}]+})?))/g;
+    @components = $inputline =~ /(?:,?[ ]*([^{,]+(?:{[^}]+})?[^,]*))/g;
     foreach my $comp (@components)
     {
         # if we've got a component that has {..}, then expand.
         # match the prefix (hostname) and curly brackets
-        if($comp =~ /([^{]+){([^}]+)}/)
+        if($comp =~ /([^{]+){([^}]+)}(.*)$/)
         {
             my $prefix = $1;
             my $ranges = $2;
-            
+            my $suffix = $3;
+
             # split the ranges string on the commas
             foreach my $r (split(/,/, $ranges))
             {
@@ -168,7 +170,7 @@ sub parse_hostlist
                     my ($s, $f) = $r =~ /([0-9]+)-([0-9]+)/; 
                     for(my $i = $s; $i <= $f; ++$i)
                     {
-                        push @hosts, "$prefix$i";
+                        push @hosts, "$prefix$i$suffix";
                     }
                 }
             }
@@ -530,6 +532,7 @@ Usage: pvfs2-genconfig [OPTIONS] <fs.con
      --last-handle  <NUM>              last handle value to reserve
      --root-handle  <NUM>              handle value to reserve for root object
      --fsid         <NUM>              fs identifier value
+     --fsname <STRING>                 fs name
      --default-num-dfiles <NUM>        number of datafiles to use per file
                                        (defaults to number of I/O servers)
      --flow-buffer-size <NUM>          set flowbuffersize in bytes            
@@ -698,6 +701,17 @@ sub get_fsid
     return $fsid;
 }
 
+sub get_fsname
+{
+    my $fsname;
+    if ($opt_fsname) {
+        $fsname = $opt_fsname;
+    } else {
+        $fsname = "pvfs2-fs";
+    }
+    return $fsname;
+}
+
 sub get_last_handle
 {
     my $last_handle;
@@ -1351,6 +1365,7 @@ GetOptions('protocol=s'    => \$opt_prot
     'flow-buffer-count=i'=> \$opt_default_flow_buffer_count,
     'root-handle=i' => \$opt_root_handle,
     'fsid=i'        => \$opt_fsid,
+    'fsname=s'      => \$opt_fsname,
     'trusted=i'        => \$opt_security,
     'server-job-timeout=i' => \$opt_server_job_timeout,
     'client-job-timeout=i' => \$opt_client_job_timeout,
@@ -1535,6 +1550,7 @@ my $default_flow_buffer_size = get_defau
 my $default_flow_buffer_count = get_default_flow_buffer_count();
 my $root_handle = get_root_handle();
 my $fsid = get_fsid();
+my $fsname = get_fsname();
 my $server_job_timeout = get_server_job_timeout();
 my $client_job_timeout = get_client_job_timeout();
 
@@ -1558,7 +1574,7 @@ if ($opt_security == 1) 
         $opt_trusted_network, $opt_trusted_netmask);
 }
 emit_aliases($output_target);
-emit_filesystem($output_target, "pvfs2-fs", $fsid, $root_handle, 
+emit_filesystem($output_target, $fsname , $fsid, $root_handle, 
     $last_handle, $first_handle, $meta_count + $io_count, $default_num_dfiles, $default_flow_buffer_size, $default_flow_buffer_count);
 
 if ($opt_metaspec) {



More information about the Pvfs2-cvs mailing list