Re-work of the original patch, this patch now handles a single-server
case as discussed in the last thread.
Is this what everyone was wanting?

Compiles and tests fine.

~Kyle


Index: src/io/description/dist-twod-stripe.c
===================================================================
RCS file: /anoncvs/pvfs2/src/io/description/dist-twod-stripe.c,v
retrieving revision 1.6
diff -a -u -p -r1.6 dist-twod-stripe.c
--- src/io/description/dist-twod-stripe.c       7 Jul 2008 14:25:27 -0000       
1.6
+++ src/io/description/dist-twod-stripe.c       10 Jul 2008 23:30:05 -0000
@@ -71,13 +71,16 @@ static PVFS_offset logical_to_physical_o
     num_groups = dparam->num_groups;
     strip_size = dparam->strip_size;

-    if(num_groups > server_ct || num_groups == 0 || server_ct == 0 )
+    if( num_groups == 0 || server_ct == 0 )
     {
         gossip_err("%s: Invalid num_groups/server_ct options: "
                    "gr:%d server:%d\n",
                    __func__, num_groups, server_ct);
     }

+    if(num_groups > server_ct )
+        num_groups = server_ct;
+
     /* size of all groups that are of equal size: all groups
      * except when server_ct doesnt divide evenly into num_groups */
     small_group_size = server_ct / num_groups;
@@ -190,7 +193,7 @@ static PVFS_offset physical_to_logical_o
     PVFS_size global_stripes = 0;
     uint32_t num_groups = dparam->num_groups;

-    if(num_groups > server_ct || num_groups == 0 || server_ct == 0 )
+    if( num_groups == 0 || server_ct == 0 )
     {
         gossip_err(
             "%s: Invalid num_groups/server_ct options: "
@@ -198,6 +201,9 @@ static PVFS_offset physical_to_logical_o
             __func__,num_groups,server_ct);
     }

+    if(num_groups > server_ct)
+        num_groups = server_ct;
+
     /* if we are a server in the last group, make sure things are happy */
     if(server_nr >= (num_groups-1)*(small_group_size))
     {
@@ -334,7 +340,7 @@ static PVFS_offset next_mapped_offset(vo
         return physical_to_logical_offset(params,fd,0);
     }

-    if(num_groups > server_ct || num_groups == 0 || server_ct == 0 )
+    if( num_groups == 0 || server_ct == 0 )
     {
         gossip_err("%s: Invalid num_groups/server_ct options: "
                    "gr:%d server:%d\n",
@@ -342,7 +348,8 @@ static PVFS_offset next_mapped_offset(vo
                    num_groups,
                    server_ct);
     }
-
+    if(num_groups > server_ct)
+        num_groups = server_ct;
     total_stripes += global_stripes * factor;

     /* if we are a server in the last group, make sure things are happy */




-- 
Kyle Schochenmaier

Attachment: dist2d.patch
Description: Binary data

_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to