[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/io/description:
dist-twod-stripe.c dist-varstrip-parser.c
CVS commit program
cvs at parl.clemson.edu
Thu Aug 7 12:30:21 EDT 2008
Update of /projects/cvsroot/pvfs2-1/src/io/description
In directory parlweb1:/tmp/cvs-serv6370/src/io/description
Modified Files:
Tag: small-file-branch
dist-twod-stripe.c dist-varstrip-parser.c
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: dist-twod-stripe.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/description/dist-twod-stripe.c,v
diff -p -u -r1.3.6.2 -r1.3.6.3
--- dist-twod-stripe.c 24 Jun 2008 15:01:52 -0000 1.3.6.2
+++ dist-twod-stripe.c 7 Aug 2008 16:30:20 -0000 1.3.6.3
@@ -4,6 +4,15 @@
*
* See COPYING in top-level directory.
*/
+/* twod-stripe will take all of the servers in the filesystem and
+ * partition them into num_groups groups. Data will then be striped to
+ * each group before we move onto the next group. The strip_factor will
+ * determine how many chunks of strip_size are written to each server
+ * in each group before we transition to the next group.
+ * The striping on the group level is done round-robin in the same
+ * fashion as simple-stripe
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -62,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;
@@ -181,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: "
@@ -189,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))
{
@@ -325,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",
@@ -333,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 */
Index: dist-varstrip-parser.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/description/dist-varstrip-parser.c,v
diff -p -u -r1.3 -r1.3.38.1
--- dist-varstrip-parser.c 27 May 2006 23:50:23 -0000 1.3
+++ dist-varstrip-parser.c 7 Aug 2008 16:30:20 -0000 1.3.38.1
@@ -7,6 +7,7 @@
#include "dist-varstrip-parser.h"
#include "pvfs2-dist-varstrip.h"
+#include "gossip.h"
#include <stdlib.h>
#include <stdio.h>
@@ -145,6 +146,12 @@ int PINT_dist_strips_parse(
*count = 0;
*strips = 0;
+ if(!input || strlen(input) == 0)
+ {
+ gossip_err("Error: missing manditory parameters to varstrip_dist distribution.\n");
+ return(-1);
+ }
+
if (strlen(input) < PVFS_DIST_VARSTRIP_MAX_STRIPS_STRING_LENGTH - 1)
{
strcpy(inp, input);
@@ -152,6 +159,7 @@ int PINT_dist_strips_parse(
else
{
/* input string too long, abort */
+ gossip_err("Error: varstrip_dist distribution parameters too long.\n");
return -1;
}
@@ -160,6 +168,7 @@ int PINT_dist_strips_parse(
if (!(*strips))
{
/* allocation failed, abort */
+ gossip_err("Error: unable to parse varstrip_dist distribution parameters.\n");
return -1;
}
More information about the Pvfs2-cvs
mailing list