[PVFS2-CVS] commit by slang in pvfs2/src/io/description: dist-varstrip-parser.c dist-varstrip-parser.h dist-varstrip.c dist-basic.c dist-simple-stripe.c module.mk.in pint-dist-utils.c pint-dist-utils.h pint-distribution.h pint-request.c pint-request.h pvfs-distribution.h pvfs-request.c

CVS commit program cvs at parl.clemson.edu
Thu Aug 25 17:38:24 EDT 2005


Update of /projects/cvsroot/pvfs2/src/io/description
In directory parlweb:/tmp/cvs-serv7520/src/io/description

Modified Files:
      Tag: slang-event-changes-branch
	dist-basic.c dist-simple-stripe.c module.mk.in 
	pint-dist-utils.c pint-dist-utils.h pint-distribution.h 
	pint-request.c pint-request.h pvfs-distribution.h 
	pvfs-request.c 
Added Files:
      Tag: slang-event-changes-branch
	dist-varstrip-parser.c dist-varstrip-parser.h dist-varstrip.c 
Log Message:
updates to my event changes to bring them inline with trunk


--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ dist-varstrip-parser.c	2005-08-25 16:38:24.000000000 -0400
@@ -0,0 +1,211 @@
+/*
+ * (C) 2005 Frederik Grll <frederik.gruell at web.de>
+ *
+ * See COPYING in top-level directory.
+ */
+
+
+#include "dist-varstrip-parser.h"
+#include "pvfs2-dist-varstrip.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+static int strips_parse_elem(char* inp, const PVFS_offset *prev_offset,
+                             const PVFS_size *prev_size, unsigned *server_nr,
+                             PVFS_offset *offset, PVFS_size *size);
+
+static PINT_dist_strips* strips_alloc_mem(const char* inp);
+
+void PINT_dist_strips_free_mem(PINT_dist_strips **strips)
+{
+    if (*strips)
+    {
+        free(*strips);
+        *strips = 0;
+    }
+    return;
+}
+
+
+static int strips_parse_elem(
+    char* inp, const PVFS_offset *prev_offset,
+    const PVFS_size *prev_size, unsigned *server_nr,
+    PVFS_offset *offset, PVFS_size *size)
+{
+    char *s_server, *s_size;
+    unsigned i_server;
+    PVFS_size i_size;
+
+    if (prev_offset != NULL && prev_size != NULL) 
+    {
+        s_server = strtok(NULL, ":");
+    }
+    else
+    {
+        s_server = strtok(inp, ":");
+    }
+
+    if (s_server != NULL)
+    {
+        i_server = atoi(s_server);
+        *server_nr = i_server;
+    }
+    else
+    {
+        return 1;
+    }
+
+    if (prev_offset != NULL && prev_size != NULL) 
+    {
+        *offset = (*prev_offset) + (*prev_size);
+    }
+    else
+    {
+        *offset = 0;
+    }
+
+    s_size = strtok(NULL, ";");
+    if (s_size != NULL)
+    {
+        i_size = atoll(s_size);
+        if (i_size > 0)
+        {
+            if (strlen(s_size) > 1)
+            {
+                switch (s_size[strlen(s_size) - 1])
+                {
+                    case 'k':
+                    case 'K':
+                        i_size *= 1024;
+                        break;
+                    case 'm':
+                    case 'M':
+                        i_size *= (1024 * 1024);
+                        break;
+                    case 'g':
+                    case 'G':
+                        i_size *= (1024 * 1024 * 1024);
+                        break;
+                }
+            }
+            *size = i_size;
+        }
+        else
+        {
+            return -1;
+        }
+    }
+    else
+    {
+        return -1;
+    }
+
+    return 0;
+}
+
+
+static PINT_dist_strips* strips_alloc_mem(const char* inp)
+{
+    int i, count = 0;
+    /* count ":" to allocate enough memory */
+    for (i = 0; i < strlen(inp); i++)
+    {
+        if (inp[i] == ':')
+        {
+            count++;
+        }
+    }  
+
+    if (!count)
+    {
+        /* no ";" found, abort */
+        return (PINT_dist_strips*) NULL;
+    }
+
+    /* allocate array of struct slicing */
+    return (PINT_dist_strips*) (malloc(sizeof(PINT_dist_strips) * count));
+}
+
+/*
+ * parse hint to array of struct slicing
+ * input sytax: {<datafile number>:<strip size>[K|M|G];}+
+ */
+int PINT_dist_strips_parse(
+    const char *input, PINT_dist_strips **strips, unsigned *count)  
+{
+    char inp[PVFS_DIST_VARSTRIP_MAX_STRIPS_STRING_LENGTH];
+    PINT_dist_strips *strips_elem;
+    PVFS_size *prev_size   = NULL;
+    PVFS_offset *prev_offset = NULL;
+    int i;
+
+    *count = 0;
+    *strips = 0;
+
+    if (strlen(input) < PVFS_DIST_VARSTRIP_MAX_STRIPS_STRING_LENGTH - 1)
+    {
+        strcpy(inp, input);
+    }
+    else
+    {
+        /* input string too long, abort */
+        return -1;
+    }
+
+    *strips = strips_alloc_mem(inp);
+
+    if (!(*strips))        
+    {
+        /* allocation failed, abort */
+        return -1;
+    }
+
+    for (i = 0;; i++)
+    {
+        strips_elem = (*strips) + i;
+        switch (
+            strips_parse_elem(
+                inp, prev_offset, prev_size, &(strips_elem->server_nr),
+                &(strips_elem->offset), &(strips_elem->size)))
+        {
+            case 0:     
+                /* do next element */
+                prev_offset = &(strips_elem->offset);
+                prev_size   = &(strips_elem->size);
+                break;
+            case -1:
+                /* an error occured */
+                PINT_dist_strips_free_mem(strips);
+                *count = 0;
+                return -1;
+                break;
+            case 1:
+                /* finished */
+                *count = i;
+                if (*count == 0)    
+                {         
+                    /* 0 elements, abort */
+                    PINT_dist_strips_free_mem(strips);
+                    return -1;
+                }
+                else
+                {
+                    return 0;
+                }
+                break;
+        }
+    }
+}
+
+/*
+ * Local variables:
+ *  mode: c
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ dist-varstrip-parser.h	2005-08-25 16:38:24.000000000 -0400
@@ -0,0 +1,35 @@
+/*
+ * (C) 2005 Frederik Grüll <frederik.gruell at web.de>
+ *
+ * See COPYING in top-level directory.
+ */
+
+#ifndef PVFS_DIST_VARSTRIP_PARSER_H
+#define PVFS_DIST_VARSTRIP_PARSER_H
+
+#include "pvfs2-types.h"
+
+struct PINT_dist_strips_s
+{
+    unsigned int server_nr;
+    PVFS_offset offset;
+    PVFS_size size;
+};
+
+typedef struct PINT_dist_strips_s PINT_dist_strips;
+
+void PINT_dist_strips_free_mem(PINT_dist_strips **strip);
+int PINT_dist_strips_parse(
+    const char *input, PINT_dist_strips **strip, unsigned *count);
+
+#endif
+
+/*
+ * Local variables:
+ *  mode: c
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */

--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ dist-varstrip.c	2005-08-25 16:38:25.000000000 -0400
@@ -0,0 +1,440 @@
+/*
+ * (C) 2005 Tobias Eberle <tobias.eberle at gmx.de>
+ *
+ * See COPYING in top-level directory.
+ */       
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#define __PINT_REQPROTO_ENCODE_FUNCS_C
+#include "pint-distribution.h"
+#include "pint-dist-utils.h"
+#include "pvfs2-dist-varstrip.h"
+#include "dist-varstrip-parser.h"
+
+#include "pvfs2-debug.h"
+#include "gossip.h"
+
+static PVFS_offset logical_to_physical_offset(void* params,
+                                              PINT_request_file_data* fd,
+                                              PVFS_offset logical_offset)
+{
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+    /* parse parameter */
+    PINT_dist_strips *strips;
+    uint32_t ui_count, ii, ui_stripe_nr;
+    PVFS_size ui_stripe_size;
+    int32_t server_nr = fd->server_nr;
+    
+    if (PINT_dist_strips_parse(
+            varstrip_params->strips, &strips, &ui_count) == -1)
+    {
+        return -1;
+    }
+    
+    /* stripe size */
+    ui_stripe_size = strips[ui_count - 1].offset + 
+        strips[ui_count - 1].size;
+    ui_stripe_nr = logical_offset / ui_stripe_size;
+    /* search my strips */
+    for(ii = 0; ii < ui_count; ii++)
+    {
+        if (strips[ii].server_nr == server_nr)
+        {
+            if ((logical_offset >= (ui_stripe_nr * ui_stripe_size) + 
+                                   strips[ii].offset) &&
+                (logical_offset <= (ui_stripe_nr * ui_stripe_size) + 
+                                   strips[ii].offset + strips[ii].size - 1))
+            {
+                unsigned int jj;
+                PVFS_offset ui_offset_in_strips;
+                
+                /* get size of all strips in the stripe of this server */
+                /* and get the size of all strips of this server that are */
+                /* before the current Strips */
+                PVFS_size ui_size_of_all_my_strips_in_stripe = 0;
+                PVFS_size ui_size_of_my_strips_before_current = 0;
+                for (jj = 0; jj < ui_count; jj++)
+                {
+                    if (strips[jj].server_nr == server_nr)
+                    {
+                        ui_size_of_all_my_strips_in_stripe += strips[jj].size;
+                        if (jj < ii)
+                        {
+                            ui_size_of_my_strips_before_current += 
+                                strips[jj].size;
+                        }
+                    }
+                }
+                
+                ui_offset_in_strips = logical_offset - 
+                    (ui_stripe_nr * ui_stripe_size) - strips[ii].offset;
+                
+                PINT_dist_strips_free_mem(&strips);
+                return ui_stripe_nr * ui_size_of_all_my_strips_in_stripe + 
+                       ui_size_of_my_strips_before_current + 
+                       ui_offset_in_strips;
+            }
+        }
+        /* try next */
+    }
+    gossip_err("logical_to_physical: todo\n");
+    /*
+     * todo: logical offsets that do not belong to the current server
+     *       I dont know if it is really neccessary to implement this.
+     *       In practice I have never seen this error string.
+     */
+    PINT_dist_strips_free_mem(&strips);
+    return 0;
+}
+
+static PVFS_offset physical_to_logical_offset(void* params,
+                                              PINT_request_file_data* fd,
+                                              PVFS_offset physical_offset)
+{
+    /* parse parameter */
+    PINT_dist_strips *strips;
+    unsigned int ui_count, jj, ui_stripe_nr, ii;
+    uint32_t server_nr = fd->server_nr;
+    PVFS_size ui_size_of_strips_in_stripe = 0;
+    PVFS_offset ui_physical_offset_in_stripe;
+    PVFS_offset ui_offset_in_stripe = 0;
+
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+
+    if (PINT_dist_strips_parse(
+            varstrip_params->strips, &strips, &ui_count) == -1)
+    {
+        return -1;
+    }
+    
+    /* to what stripe belongs that physical offset? */
+    /* must get size of strips of this server in one stripe first */
+    for (jj = 0; jj < ui_count; jj++)
+    {
+        if (strips[jj].server_nr == server_nr)
+        {
+            ui_size_of_strips_in_stripe += strips[jj].size;
+        }
+    }
+    ui_stripe_nr = physical_offset / ui_size_of_strips_in_stripe;
+
+    /* now get the Strips number in the 
+     * stripe the physical offset belongs to */
+    ui_physical_offset_in_stripe = 
+        physical_offset - ui_stripe_nr * ui_size_of_strips_in_stripe;
+    for(ii = 0; ii < ui_count; ii++)
+    {
+        if (strips[ii].server_nr == server_nr)
+        {
+            if (ui_physical_offset_in_stripe < 
+                ui_offset_in_stripe + strips[ii].size)
+            {
+                /* found! */
+                PVFS_offset logical_offset = ui_stripe_nr * 
+                    (strips[ui_count - 1].offset + strips[ui_count - 1].size) + 
+                    strips[ii].offset + 
+                    (ui_physical_offset_in_stripe - ui_offset_in_stripe);
+                PINT_dist_strips_free_mem(&strips);
+                return logical_offset;
+            }
+            else
+            {
+                ui_offset_in_stripe += strips[ii].size;
+            }
+        }
+        /* try next */
+    }
+    /* error! */
+    gossip_err("ERROR in varstrip distribution in "
+               "function physical_to_logical: no fitting strip found!\n");
+    PINT_dist_strips_free_mem(&strips);
+    return -1;
+}
+
+static PVFS_offset next_mapped_offset(void* params,
+                                      PINT_request_file_data* fd,
+                                      PVFS_offset logical_offset)
+{
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+    /* parse parameter */
+    PINT_dist_strips *strips;
+    unsigned int ui_count, ii, ui_stripe_nr;
+    uint32_t server_nr = fd->server_nr;
+    PVFS_size ui_stripe_size;
+    PVFS_offset ui_offset_in_stripe;
+
+    if (PINT_dist_strips_parse(
+            varstrip_params->strips, &strips, &ui_count) == -1)
+    {
+        return -1;
+    }
+
+    /* get number of stripes */
+    ui_stripe_size = 
+        strips[ui_count - 1].offset +
+        strips[ui_count - 1].size;
+    ui_stripe_nr = logical_offset / ui_stripe_size;
+
+    /* get offset in stripe */
+    ui_offset_in_stripe = 
+        logical_offset - (ui_stripe_nr * ui_stripe_size);
+
+    /* get Strips number */
+    ii = 0;
+    for(ii = 0; ii < ui_count; ii++)
+    {
+        if ((ui_offset_in_stripe >= strips[ii].offset) &&
+            (ui_offset_in_stripe <= strips[ii].offset + strips[ii].size - 1))
+        {
+            /* found! */
+            break;
+        }
+    }
+    if (strips[ii].server_nr == server_nr)
+    {
+        /* logical offset is part of my Strips */
+        PINT_dist_strips_free_mem(&strips);
+        return logical_offset;
+    }
+    else
+    {
+        /* search my next Strips */
+        unsigned int jj;
+        for (jj = ii + 1; jj < ui_count; jj++)
+        {
+            if (strips[jj].server_nr == server_nr)
+            {
+                /* found! */
+                PVFS_offset ui_next_mapped_offset = 
+                    ui_stripe_nr * ui_stripe_size + strips[jj].offset;
+                PINT_dist_strips_free_mem(&strips);
+                return ui_next_mapped_offset;
+            }
+        }
+        /* not found! */
+        /* -> next stripe */
+        ui_stripe_nr++;
+        for (jj = 0; jj < ui_count; jj++)
+        {
+            if (strips[jj].server_nr == server_nr)
+            {
+                PVFS_offset ui_next_mapped_offset = 
+                    ui_stripe_nr * ui_stripe_size + strips[jj].offset;
+                PINT_dist_strips_free_mem(&strips);
+                return ui_next_mapped_offset;
+            }
+        }
+    }
+    /* huh? this is an error */
+    PINT_dist_strips_free_mem(&strips);
+    gossip_err("ERROR in varstrip distribution in "
+               "next_mapped_offset: Did not find my next offset\n");
+    return -1;
+}
+
+static PVFS_size contiguous_length(void* params,
+                                   PINT_request_file_data* fd,
+                                   PVFS_offset physical_offset)
+{
+    PVFS_varstrip_params* varstrip_params;
+    /* convert to a logical offset */
+     
+    /* parse parameter */
+    PINT_dist_strips *strips;
+    PVFS_offset ui_offset_in_stripe, logical_offset;
+    unsigned int ui_count, ii, ui_stripe_nr, ui_stripe_size;
+
+    logical_offset = physical_to_logical_offset(
+        params, fd, physical_offset);
+    
+    varstrip_params = (PVFS_varstrip_params*)params;
+
+    if (PINT_dist_strips_parse(
+            varstrip_params->strips, &strips, &ui_count) == -1)
+    {
+        return -1;
+    }
+    
+    /* get number of stripes */
+    ui_stripe_size = strips[ui_count - 1].offset +
+        strips[ui_count - 1].size;
+    ui_stripe_nr = logical_offset / ui_stripe_size;
+    /* get offset in stripe */
+    ui_offset_in_stripe = logical_offset - (ui_stripe_nr * ui_stripe_size);
+    /* get Strips */
+    for(ii = 0; ii < ui_count; ii++)
+    {
+        if ((ui_offset_in_stripe >= strips[ii].offset) &&
+            (ui_offset_in_stripe <= strips[ii].offset + strips[ii].size - 1))
+        {
+            /* found! */
+            PVFS_size ui_contiguous_length = strips[ii].offset + 
+                strips[ii].size - ui_offset_in_stripe;
+            PINT_dist_strips_free_mem(&strips);
+            
+            return ui_contiguous_length;
+        }
+    }
+    /* error! */
+    gossip_err("ERROR in varstrip distribution in "
+               "function contiguous_length: no fitting strip found\n");
+    PINT_dist_strips_free_mem(&strips);
+    return 0;
+}
+
+static PVFS_size logical_file_size(void* params,
+                                   uint32_t server_ct,
+                                   PVFS_size *psizes)
+{
+    PVFS_size ui_file_size = 0;
+    uint32_t ii;
+    
+    if (!psizes)
+        return -1;
+    for (ii = 0; ii < server_ct; ii++)
+    {
+        ui_file_size += psizes[ii];
+    }
+    return ui_file_size;
+}
+
+static int get_num_dfiles(void* params,
+                          uint32_t num_servers_requested,
+                          uint32_t num_dfiles_requested)
+{
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+    /* parse parameter */
+    PINT_dist_strips *strips;
+    unsigned int i_highest_data_file_number = 0;
+    unsigned int ii, ui_count;
+
+    if (PINT_dist_strips_parse(
+            varstrip_params->strips, &strips, &ui_count) == -1)
+    {
+        /* error */
+        return -1;
+    }
+    /* get highest requested data file number */
+    for (ii = 0; ii < ui_count; ii++)
+    {
+        if (strips[ii].server_nr > i_highest_data_file_number)
+        {
+            i_highest_data_file_number = strips[ii].server_nr;
+        }
+    }
+    /* are all data file numbers available in string? */
+    for (ii = 0; ii < i_highest_data_file_number; ii++)
+    {
+        int b_found = 0;
+        unsigned int jj;
+        for (jj = 0; jj < ui_count; jj++)
+        {
+            if (strips[jj].server_nr == ii)
+            {
+                b_found = 1;
+                break;
+            }
+        }
+        if (!b_found)
+        {
+            gossip_err("ERROR in varstrip distribution: The strip "
+                       "partitioning string must contain all data "
+                       "file numbers from 0 to the highest one specified!\n");
+            return -1;
+        }
+    }
+    PINT_dist_strips_free_mem(&strips);
+    i_highest_data_file_number++;
+    if (i_highest_data_file_number > num_servers_requested)
+    {
+        gossip_err("ERROR in varstrip distribution: There are more "
+                   "data files specified in strip partitioning string "
+                   "than servers available!\n");
+        return -1;
+    }
+    return i_highest_data_file_number;
+}
+
+/* its like the default one but assures that last character is \0
+ * we need null terminated strings!
+ */
+static int set_param(const char* dist_name, void* params,
+                    const char* param_name, void* value)
+{
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+    if (strcmp(param_name, "strips") == 0)
+    {
+        if (strlen((char *)value) == 0)
+        {
+            gossip_err("ERROR: Parameter 'strips' empty!\n");
+        }
+        else
+        {
+            if (strlen((char *)value) > 
+                PVFS_DIST_VARSTRIP_MAX_STRIPS_STRING_LENGTH)
+            {
+                gossip_err("ERROR: Parameter 'strips' too long!\n");
+            }
+            else
+            {
+                strcpy(varstrip_params->strips, (char *)value);
+            }
+        }
+    }
+    return 0;
+}
+
+
+static void encode_params(char **pptr, void* params)
+{
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+    encode_string(pptr, &varstrip_params->strips);
+}
+
+static void decode_params(char **pptr, void* params)
+{
+    PVFS_varstrip_params* varstrip_params = (PVFS_varstrip_params*)params;
+    decode_here_string(pptr, varstrip_params->strips);
+}
+
+static void registration_init(void* params)
+{
+    PINT_dist_register_param(PVFS_DIST_VARSTRIP_NAME, "strips",
+            PVFS_varstrip_params, strips);
+}
+
+
+static PVFS_varstrip_params varstrip_params = { "\0" };
+
+static PINT_dist_methods varstrip_methods = {
+    logical_to_physical_offset,
+    physical_to_logical_offset,
+    next_mapped_offset,
+    contiguous_length,
+    logical_file_size,
+    get_num_dfiles,
+    set_param,
+    encode_params,
+    decode_params,
+    registration_init
+};
+
+PINT_dist varstrip_dist = {
+    PVFS_DIST_VARSTRIP_NAME,
+    roundup8(PVFS_DIST_VARSTRIP_NAME_SIZE), /* name size */
+    roundup8(sizeof(PVFS_varstrip_params)), /* param size */
+    &varstrip_params,
+    &varstrip_methods
+};
+
+/*
+ * Local variables:
+ *  mode: c
+ *  c-indent-level: 4
+ *  c-varstrip-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */

Index: dist-basic.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/dist-basic.c,v
diff -p -u -r1.7 -r1.7.6.1
--- dist-basic.c	6 Aug 2004 18:26:53 -0000	1.7
+++ dist-basic.c	25 Aug 2005 20:38:24 -0000	1.7.6.1
@@ -17,32 +17,28 @@
 /* in this distribution all data is stored on a single server */
 
 static PVFS_offset logical_to_physical_offset(void* params,
-                                              uint32_t server_nr,
-                                              uint32_t server_ct,
+                                              PINT_request_file_data* fd,
                                               PVFS_offset logical_offset)
 {
     return logical_offset;
 }
 
 static PVFS_offset physical_to_logical_offset(void* params,
-                                              uint32_t server_nr,
-                                              uint32_t server_ct,
+                                              PINT_request_file_data* fd,
                                               PVFS_offset physical_offset)
 {
     return physical_offset;
 }
 
 static PVFS_offset next_mapped_offset(void* params,
-                                      uint32_t server_nr,
-                                      uint32_t server_ct,
+                                      PINT_request_file_data* fd,
                                       PVFS_offset logical_offset)
 {
     return logical_offset;
 }
 
 static PVFS_size contiguous_length(void* params,
-                                   uint32_t server_nr,
-                                   uint32_t server_ct,
+                                   PINT_request_file_data* fd,
                                    PVFS_offset physical_offset)
 {
     return CONTIGBLOCKSZ;

Index: dist-simple-stripe.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/dist-simple-stripe.c,v
diff -p -u -r1.7 -r1.7.6.1
--- dist-simple-stripe.c	6 Aug 2004 18:26:54 -0000	1.7
+++ dist-simple-stripe.c	25 Aug 2005 20:38:24 -0000	1.7.6.1
@@ -14,14 +14,15 @@
 #include "pvfs2-dist-simple-stripe.h"
 
 static PVFS_offset logical_to_physical_offset (void* params,
-                                               uint32_t server_nr,
-                                               uint32_t server_ct,
+                                               PINT_request_file_data* fd,
                                                PVFS_offset logical_offset)
 {
     PVFS_offset ret_offset = 0;
     int full_stripes = 0;
     PVFS_size leftover = 0;
     PVFS_simple_stripe_params* dparam = (PVFS_simple_stripe_params*)params;
+    uint32_t server_nr = fd->server_nr;
+    uint32_t server_ct = fd->server_ct;
     
     /* how many complete stripes are in there? */
     full_stripes = logical_offset / (dparam->strip_size*server_ct);
@@ -41,11 +42,12 @@ static PVFS_offset logical_to_physical_o
 }
 
 static PVFS_offset physical_to_logical_offset (void* params,
-                                               uint32_t server_nr,
-                                               uint32_t server_ct,
+                                               PINT_request_file_data* fd,
                                                PVFS_offset physical_offset)
 {
     PVFS_simple_stripe_params* dparam = (PVFS_simple_stripe_params*)params;
+    uint32_t server_nr = fd->server_nr;
+    uint32_t server_ct = fd->server_ct;
     PVFS_size strips_div = physical_offset / dparam->strip_size;
     PVFS_size strips_mod = physical_offset % dparam->strip_size;
     PVFS_offset acc = 0;
@@ -65,14 +67,15 @@ static PVFS_offset physical_to_logical_o
 }
 
 static PVFS_offset next_mapped_offset (void* params,
-                                       uint32_t server_nr,
-                                       uint32_t server_ct,
+                                       PINT_request_file_data* fd,
                                        PVFS_offset logical_offset)
 {
     PVFS_offset diff; /* distance of loff from beginning of strip in this stripe */
     PVFS_size   stripe_size; /* not to be confused with strip size */
     PVFS_offset server_starting_offset; /* offset of strip from start of stripe */
     PVFS_simple_stripe_params* dparam = (PVFS_simple_stripe_params*)params;
+    uint32_t server_nr = fd->server_nr;
+    uint32_t server_ct = fd->server_ct;
 
     server_starting_offset = server_nr * dparam->strip_size;
     stripe_size = server_ct * dparam->strip_size;
@@ -90,8 +93,7 @@ static PVFS_offset next_mapped_offset (v
 }
 
 static PVFS_size contiguous_length(void* params,
-                                   uint32_t server_nr,
-                                   uint32_t server_ct,
+                                   PINT_request_file_data* fd,
                                    PVFS_offset physical_offset)
 {
     PVFS_simple_stripe_params* dparam = (PVFS_simple_stripe_params*)params;
@@ -107,13 +109,19 @@ static PVFS_size logical_file_size(void*
     PVFS_size tmp_max = 0;
     int s = 0;
     PVFS_simple_stripe_params* dparam = (PVFS_simple_stripe_params*)params;
+    PINT_request_file_data file_data;
 
     if (!psizes)
         return -1;
+
+    /* Initialize file data struct */
+    memset(&file_data, 0, sizeof(file_data));
+    file_data.server_ct = server_ct;
+    
     for (s = 0; s < server_ct; s++)
     {
-        tmp_max = physical_to_logical_offset(dparam,
-                                             s, server_ct, psizes[s]);
+        file_data.server_nr = s;
+        tmp_max = physical_to_logical_offset(dparam, &file_data, psizes[s]);
         if(tmp_max > max)
             max = tmp_max;
     }
@@ -134,14 +142,14 @@ static void decode_lebf(char **pptr, voi
 
 static void registration_init(void* params)
 {
-    PINT_dist_register_param("simple_stripe", "strip_size",
+    PINT_dist_register_param(PVFS_DIST_SIMPLE_STRIPE_NAME, "strip_size",
                              PVFS_simple_stripe_params, strip_size);
 
 }
     
 
 static PVFS_simple_stripe_params simple_stripe_params = {
-	65536 /* strip size */
+    PVFS_DIST_SIMPLE_STRIPE_DEFAULT_STRIP_SIZE /* strip size */
 };
 
 static PINT_dist_methods simple_stripe_methods = {
@@ -159,7 +167,7 @@ static PINT_dist_methods simple_stripe_m
 
 PINT_dist simple_stripe_dist = {
     PVFS_DIST_SIMPLE_STRIPE_NAME,
-    roundup8(PVFS_DIST_SIMPLE_STRIPE_NAME_SIZE),   /* name size */
+    roundup8(PVFS_DIST_SIMPLE_STRIPE_NAME_SIZE), /* name size */
     roundup8(sizeof(PVFS_simple_stripe_params)), /* param size */
     &simple_stripe_params,
     &simple_stripe_methods

Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/module.mk.in,v
diff -p -u -r1.4 -r1.4.8.1
--- module.mk.in	17 May 2004 15:57:03 -0000	1.4
+++ module.mk.in	25 Aug 2005 20:38:24 -0000	1.4.8.1
@@ -5,7 +5,9 @@ LIBSRC += \
 	$(DIR)/pint-distribution.c \
 	$(DIR)/pint-dist-utils.c \
 	$(DIR)/dist-basic.c \
-	$(DIR)/dist-simple-stripe.c
+	$(DIR)/dist-simple-stripe.c \
+	$(DIR)/dist-varstrip-parser.c \
+	$(DIR)/dist-varstrip.c
 
 SERVERSRC += \
 	$(DIR)/pvfs-request.c \
@@ -13,5 +15,7 @@ SERVERSRC += \
 	$(DIR)/pint-distribution.c \
 	$(DIR)/pint-dist-utils.c \
 	$(DIR)/dist-basic.c \
-	$(DIR)/dist-simple-stripe.c
+	$(DIR)/dist-simple-stripe.c \
+	$(DIR)/dist-varstrip-parser.c \
+	$(DIR)/dist-varstrip.c
 

Index: pint-dist-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pint-dist-utils.c,v
diff -p -u -r1.5 -r1.5.4.1
--- pint-dist-utils.c	3 Mar 2005 21:05:25 -0000	1.5
+++ pint-dist-utils.c	25 Aug 2005 20:38:24 -0000	1.5.4.1
@@ -8,11 +8,13 @@
 #include <stdio.h>
 #include <string.h>
 #include "pvfs2-dist-simple-stripe.h"
+#include "pvfs2-dist-varstrip.h"
 #include "pint-dist-utils.h"
 
 /* Default distributions */
 extern PINT_dist basic_dist;
 extern PINT_dist simple_stripe_dist;
+extern PINT_dist varstrip_dist;
 
 /* Struct for determining how to set a distribution parameter by name */
 typedef struct PINT_dist_param_offset_s
@@ -53,15 +55,20 @@ static PINT_dist_param_offset* PINT_get_
 }
 
 /* PINT_dist_initialize implementation */
-int PINT_dist_initialize(void)
+int PINT_dist_initialize(server_configuration_s* server_config)
 {
+    int ret = 0;
+    
     /* Register the basic distribution */
     PINT_register_distribution(&basic_dist);    
     
+    /* Register the varstrip distribution */
+    PINT_register_distribution(&varstrip_dist);
+    
     /* Register the simple stripe distribution */
     PINT_register_distribution(&simple_stripe_dist);    
-    
-    return 0;
+
+    return ret;
 }
 
 /* PINT_dist_finalize implementation */

Index: pint-dist-utils.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pint-dist-utils.h,v
diff -p -u -r1.3 -r1.3.6.1
--- pint-dist-utils.h	28 Jul 2004 14:32:41 -0000	1.3
+++ pint-dist-utils.h	25 Aug 2005 20:38:24 -0000	1.3.6.1
@@ -8,12 +8,13 @@
 #define __PINT_DIST_UTILS_H
 
 #include "pint-distribution.h"
+#include "server-config.h"
 
 /**
  * Perform initialization tasks for distributions
  *   - register the default distributions
  */
-int PINT_dist_initialize(void);
+int PINT_dist_initialize(server_configuration_s* server_config);
 
 /**
  * Perform cleanup actions before exiting

Index: pint-distribution.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pint-distribution.h,v
diff -p -u -r1.11 -r1.11.6.1
--- pint-distribution.h	2 Dec 2004 18:11:18 -0000	1.11
+++ pint-distribution.h	25 Aug 2005 20:38:24 -0000	1.11.6.1
@@ -7,47 +7,44 @@
 #ifndef __PINT_DISTRIBUTION_H
 #define __PINT_DISTRIBUTION_H
 
+#include "pint-request.h"
 #include "pvfs2-types.h"
 
 /* Distribution table size limits */
 #define PINT_DIST_NAME_SZ 32
 
 /* Distribution functions that must be supplied by each dist implmentation */
-typedef struct PINT_dist_methods_s {
-
+typedef struct PINT_dist_methods_s
+{
     /* Returns the physical storage offset for a logical file offset */
     PVFS_offset (*logical_to_physical_offset)(void* params,
-                                              uint32_t server_nr,
-                                              uint32_t server_ct,
+                                              PINT_request_file_data* rf_data,
                                               PVFS_offset logical_offset);
     
     /* Returns the logical file offset for a given physical storage offset */
     PVFS_offset (*physical_to_logical_offset)(void* params,
-                                              uint32_t server_nr,
-                                              uint32_t server_ct,
+                                              PINT_request_file_data* rf_data,
                                               PVFS_offset physical_offset);
 
     /* Returns the next physical offset for the file on server_nr given an
      * arbitraty logical offset (i.e. an offset anywhere in the file) */
     PVFS_offset (*next_mapped_offset)(void* params,
-                                      uint32_t server_nr,
-                                      uint32_t server_ct,
+                                      PINT_request_file_data* rf_data,
                                       PVFS_offset logical_offset);
 
     /* Returns the contiguous length of file data starting at physical_offset*/
     PVFS_size (*contiguous_length)(void* params,
-                                   uint32_t server_nr,
-                                   uint32_t server_ct,
+                                   PINT_request_file_data* rf_data,
                                    PVFS_offset physical_offset);
 
     /* Returns the logical file size */
     PVFS_size (*logical_file_size)(void* params,
-                                   uint32_t server_ct,
+                                   uint32_t num_handles,
                                    PVFS_size *psizes);
 
     /* Returns the number of data file objects to use for a file */
     int (*get_num_dfiles)(void* params,
-                          uint32_t num_servers_requested,
+                          uint32_t num_servers_available,
                           uint32_t num_dfiles_requested);
 
     /* Sets the parameter designated by name to the given value */

Index: pint-request.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pint-request.c,v
diff -p -u -r1.50 -r1.50.2.1
--- pint-request.c	27 May 2005 19:27:04 -0000	1.50
+++ pint-request.c	25 Aug 2005 20:38:24 -0000	1.50.2.1
@@ -4,6 +4,7 @@
  * See COPYING in top-level directory.
  */       
 
+#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -13,7 +14,7 @@
 #include <pint-request.h>
 #include <pint-distribution.h>
 
-static int PINT_Request_disp(PINT_Request *request);
+static int PINT_request_disp(PINT_Request *request);
 
 /* this macro is only used in this file to add a segment to the
  * result list.
@@ -58,10 +59,9 @@ do { \
 /* chunks are done.  Returns the number of bytes processed.  It */
 /* is assumed caller we retry if this is less than the total bytes */
 /* in the request */
-
-int PINT_Process_request(PINT_Request_state *req,
+int PINT_process_request(PINT_Request_state *req,
 	PINT_Request_state *mem,
-	PINT_Request_file_data *rfdata,
+	PINT_request_file_data *rfdata,
 	PINT_Request_result *result,
 	int mode)
 {
@@ -70,26 +70,26 @@ int PINT_Process_request(PINT_Request_st
 	PVFS_offset  contig_offset; /* temp for offset of a contig region */
 	PVFS_size    contig_size;   /* temp for size of a contig region */
 	PVFS_size    retval;        /* return value from calls to distribute */
-	gossip_debug(GOSSIP_REQUEST_DEBUG,"PINT_Process_request\n");
+	gossip_debug(GOSSIP_REQUEST_DEBUG,"PINT_process_request\n");
 	/* do very basic error checking here */
 	if (!req)
 	{
-		gossip_lerr("PINT_Process_request: Bad PINT_Request_state!\n");
+		gossip_lerr("PINT_process_request: Bad PINT_Request_state!\n");
 		return -1;
 	}
 	if (!result || !result->segmax || !result->bytemax)
 	{
-		gossip_lerr("PINT_Process_request: NULL segmax or bytemax!\n");
+		gossip_lerr("PINT_process_request: NULL segmax or bytemax!\n");
 		return -1;
 	}
 	if (result->segs >= result->segmax || result->bytes >= result->bytemax)
 	{
-		gossip_lerr("PINT_Process_request: no segments or bytes requested!\n");
+		gossip_lerr("PINT_process_request: no segments or bytes requested!\n");
 		return -1;
 	}
 	if (!PINT_IS_CKSIZE(mode) && (!result->offset_array || !result->size_array))
 	{
-		gossip_lerr("PINT_Process_request: NULL offset or size array!\n");
+		gossip_lerr("PINT_process_request: NULL offset or size array!\n");
 		return -1;
 	}
 	/* initialize some variables */
@@ -98,7 +98,7 @@ int PINT_Process_request(PINT_Request_st
 	if (req->start_offset == -1)
 	{
 		/* this indicates we already finished the request */
-		gossip_lerr("PINT_Process_request: start offset -1!\n");
+		gossip_lerr("PINT_process_request: start offset -1!\n");
 		return 0;
 	}
 #endif
@@ -222,7 +222,7 @@ int PINT_Process_request(PINT_Request_st
 			gossip_debug(GOSSIP_REQUEST_DEBUG,"\tbasic type or contiguous data\n");
 			contig_offset = req->cur[req->lvl].rq->offset +
 					req->cur[req->lvl].chunk_offset + req->bytes +
-					PINT_Request_disp(req->cur[req->lvl].rq);
+					PINT_request_disp(req->cur[req->lvl].rq);
 			contig_size = (req->cur[req->lvl].maxel *
 					req->cur[req->lvl].rq->aggregate_size) - req->bytes;
 			lvl_flag = 1;
@@ -240,7 +240,7 @@ int PINT_Process_request(PINT_Request_st
 												  req->cur[req->lvl].rqbase->lb)) +
 				req->cur[req->lvl].rq->offset + (req->cur[req->lvl].rq->stride *
 						req->cur[req->lvl].blk) + req->bytes +
-				PINT_Request_disp(req->cur[req->lvl].rq);
+				PINT_request_disp(req->cur[req->lvl].rq);
 			contig_size = (req->cur[req->lvl].rq->ereq->aggregate_size *
 					req->cur[req->lvl].rq->num_ereqs) - req->bytes;
 			lvl_flag = 0;
@@ -252,7 +252,7 @@ int PINT_Process_request(PINT_Request_st
 			if (!req->cur[req->lvl].rq->ereq ||
 					req->lvl+1 >= req->cur[0].rqbase->depth)
 			{
-				gossip_lerr("PINT_Process_request exceeded request depth - possibly corrupted request or request state\n");
+				gossip_lerr("PINT_process_request exceeded request depth - possibly corrupted request or request state\n");
 				return -1;
 			}
 			req->cur[req->lvl+1].el = 0;
@@ -350,9 +350,21 @@ int PINT_Process_request(PINT_Request_st
 			else
 			{
 				/* we process the whole thing at once */
-				gossip_debug(GOSSIP_REQUEST_DEBUG,"\tcalling distribute\n");
-				retval = PINT_Distribute(contig_offset, sz,
-						rfdata, mem, result, &req->eof_flag, mode);
+				gossip_debug(GOSSIP_REQUEST_DEBUG,
+                                             "\tcalling distribute\n");
+				retval = PINT_distribute(contig_offset, sz,
+                                                         rfdata, mem, result,
+                                                         &req->eof_flag, mode);
+
+                                if (-1 == retval)
+                                {
+                                    gossip_debug(GOSSIP_REQUEST_DEBUG,
+                                                 "\tDistribute returned -1\n");
+                                    req->type_offset = req->final_offset;
+                                    result->segs = 0;
+                                    result->bytes = 0;
+                                    return 0;
+                                }
 			}
 		}
 		/*** AFTER CALLING DISTRIBUTE ***/
@@ -474,7 +486,7 @@ int PINT_Process_request(PINT_Request_st
 
 /* this function runs down the ereq list and adds up the offsets */
 /* present in the request records */
-static int PINT_Request_disp(PINT_Request *request)
+static int PINT_request_disp(PINT_Request *request)
 {
 	int disp = 0;
 	PINT_Request *r;
@@ -488,7 +500,7 @@ static int PINT_Request_disp(PINT_Reques
 
 /* This function creates a request state and sets it up to begin */
 /* processing a request */
-struct PINT_Request_state *PINT_New_request_state (PINT_Request *request)
+struct PINT_Request_state *PINT_new_request_state(PINT_Request *request)
 {
 	struct PINT_Request_state *req;
 	int32_t rqdepth;
@@ -531,15 +543,19 @@ struct PINT_Request_state *PINT_New_requ
 }
 
 /* This function frees request state structures */
-void PINT_Free_request_state (PINT_Request_state *req)
+void PINT_free_request_state (PINT_Request_state *req)
 {
 	free(req->cur);
 	free(req);
 }
 
-/* This function should return the byte displacement from the input argument
- * offset to the last byte in the segment processed regardless of
- * whether that byte is in the current distribution or not.
+/**
+ * Returns:
+ *     - If the distribute finds file data on the server, then the byte
+ *       displacement from the input argument offset to the last byte
+ *       in the segment processed regardless of whether that byte is in
+ *       the current distribution or not
+ *     - -1 if there is no distribution data available on the server
  * Inputs:
  * 	- offset and size are the contiguous region in logical file
  * 	space we are to process
@@ -558,187 +574,230 @@ void PINT_Free_request_state (PINT_Reque
  * 	segment offsets are computed based on buffer offset in
  * 	offset_array[*segs]
  */
-PVFS_size PINT_Distribute(PVFS_offset offset, PVFS_size size,
-		PINT_Request_file_data *rfdata, PINT_Request_state *mem,
-		PINT_Request_result *result, PVFS_boolean *eof_flag, int mode)
-{
-	PVFS_offset orig_offset;
-	PVFS_size   orig_size;
-   PVFS_offset loff;    /* next logical offset within requested region */
-   PVFS_offset diff;    /* difference between loff and offset of region */
-   PVFS_offset poff;    /* physical offste corresponding to loff */
-   PVFS_size   sz;      /* number of bytes in requested region after loff */
-   PVFS_size   fraglen; /* length of physical strip contiguous on server */
-
-	gossip_debug(GOSSIP_REQUEST_DEBUG,"\tPINT_Distribute\n");
-	gossip_debug(GOSSIP_REQUEST_DEBUG,
-			"\t\tof %lld sz %lld ix %d sm %d by %lld bm %lld "
-			"fsz %lld exfl %d\n",
-			Ld(offset), Ld(size), result->segs, result->segmax, Ld(result->bytes),
-			Ld(result->bytemax),
-			Ld(rfdata->fsize), rfdata->extend_flag);
-	orig_offset = offset;
-	orig_size = size;
-	*eof_flag = 0;
-	/* check if we have maxed out result */
-	if ((!PINT_IS_CKSIZE(mode) && (result->segs >= result->segmax)) ||
-			result->bytes >= result->bytemax || size == 0)
-	{
-		/* not an error, but we didn't process any bytes */
-		gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\trequested zero segs or zero bytes\n");
-		return 0;
-	}
-	/* verify some critical pointers */
-	if (!rfdata || !rfdata->dist || !rfdata->dist->methods ||
-			!rfdata->dist->params)
-	{
-		if (!rfdata)
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata is NULL\n");
-		else if (!rfdata->dist)
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata->dist is NULL\n");
-		else if (!rfdata->dist->methods)
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata->dist->methods is NULL\n");
-		else if (!rfdata->dist->params)
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata->dist->params is NULL\n");
-		gossip_lerr("Bad Distribution! Bailing out!\n");
-		return 0;
-	}
-	/* find next logical offset on this server */
-   loff = (*rfdata->dist->methods->next_mapped_offset)
-			(rfdata->dist->params, rfdata->server_nr, rfdata->server_ct, offset);
-	/* make sure loff is still within requested region */
-   while ((diff = loff - offset) < size)
-   {
-		gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tbegin iteration loff: %lld\n", Ld(loff));
-		/* find physical offset for this loff */
-      poff = (*rfdata->dist->methods->logical_to_physical_offset)
-				(rfdata->dist->params, rfdata->server_nr, rfdata->server_ct, loff);
-		/* find how much of requested region remains after loff */
-      sz = size - diff;
-		/* find how much data after loff/poff is on this server */
-      fraglen = (*rfdata->dist->methods->contiguous_length)
-				(rfdata->dist->params, rfdata->server_nr, rfdata->server_ct, poff);
-		/* compare that amount to amount of data in requested region */
-      if (sz > fraglen && rfdata->server_ct != 1)
-		{
-			/* frag extends beyond this strip */
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tfrag extends beyond strip\n");
-			sz = fraglen;
-		}
-		/* check to see if exceeds bytemax */
-		if (result->bytes + sz > result->bytemax)
-		{
-			/* contiguous segment extends beyond byte limit */
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tsegment exceeds byte limit\n");
-			sz = result->bytemax - result->bytes;
-		}
-		/* check to se if exceeds end of file */
-		if (poff+sz > rfdata->fsize)
-		{
-			/* check for append */
-			if (rfdata->extend_flag)
-			{
+PVFS_size PINT_distribute(PVFS_offset offset,
+                          PVFS_size size,
+                          PINT_request_file_data *rfdata,
+                          PINT_Request_state *mem,
+                          PINT_Request_result *result,
+                          PVFS_boolean *eof_flag,
+                          int mode)
+{
+    PVFS_offset orig_offset;
+    PVFS_size   orig_size;
+    PVFS_offset loff;    /* next logical offset within requested region */
+    PVFS_offset diff;    /* difference between loff and offset of region */
+    PVFS_offset poff;    /* physical offste corresponding to loff */
+    PVFS_size   sz;      /* number of bytes in requested region after loff */
+    PVFS_size   fraglen; /* length of physical strip contiguous on server */
+
+    gossip_debug(GOSSIP_REQUEST_DEBUG,"\tPINT_distribute\n");
+    gossip_debug(GOSSIP_REQUEST_DEBUG,
+                 "\t\tof %lld sz %lld ix %d sm %d by %lld bm %lld "
+                 "fsz %lld exfl %d\n",
+                 Ld(offset), Ld(size), result->segs, result->segmax,
+                 Ld(result->bytes),
+                 Ld(result->bytemax),
+                 Ld(rfdata->fsize), rfdata->extend_flag);
+    orig_offset = offset;
+    orig_size = size;
+    *eof_flag = 0;
+    
+    /* check if we have maxed out result */
+    if ((!PINT_IS_CKSIZE(mode) && (result->segs >= result->segmax)) ||
+        result->bytes >= result->bytemax || size == 0)
+    {
+        /* not an error, but we didn't process any bytes */
+        gossip_debug(GOSSIP_REQUEST_DEBUG,
+                     "\t\trequested zero segs or zero bytes\n");
+        return 0;
+    }
+    
+    /* verify some critical pointers */
+    if (!rfdata || !rfdata->dist || !rfdata->dist->methods ||
+        !rfdata->dist->params)
+    {
+        if (!rfdata)
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata is NULL\n");
+        else if (!rfdata->dist)
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata->dist is NULL\n");
+        else if (!rfdata->dist->methods)
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata->dist->methods is NULL\n");
+        else if (!rfdata->dist->params)
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"rfdata->dist->params is NULL\n");
+        gossip_lerr("Bad Distribution! Bailing out!\n");
+        return 0;
+    }
+    
+    /* find next logical offset on this server */
+    loff = (*rfdata->dist->methods->next_mapped_offset)(rfdata->dist->params,
+                                                        rfdata,
+                                                        offset);
+
+    /* If there is no data on this server, immediately return */
+    if (-1 == loff)
+    {
+        return -1;
+    }
+    
+    /* make sure loff is still within requested region */
+    while ((diff = loff - offset) < size)
+    {
+        gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tbegin iteration loff: %lld\n",
+                     Ld(loff));
+        
+        /* find physical offset for this loff */
+        poff = (*rfdata->dist->methods->logical_to_physical_offset)
+            (rfdata->dist->params,
+             rfdata,
+             loff);
+        
+        /* find how much of requested region remains after loff */
+        sz = size - diff;
+        
+        /* find how much data after loff/poff is on this server */
+        fraglen = (*rfdata->dist->methods->contiguous_length)
+            (rfdata->dist->params,
+             rfdata,
+             poff);
+        
+        /* compare that amount to amount of data in requested region */
+        if (sz > fraglen && rfdata->server_ct != 1)
+        {
+            /* frag extends beyond this strip */
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tfrag extends beyond strip\n");
+            sz = fraglen;
+        }
+        /* check to see if exceeds bytemax */
+        if (result->bytes + sz > result->bytemax)
+        {
+            /* contiguous segment extends beyond byte limit */
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tsegment exceeds byte limit\n");
+            sz = result->bytemax - result->bytes;
+        }
+        /* check to se if exceeds end of file */
+        if (poff+sz > rfdata->fsize)
+        {
+            /* check for append */
+            if (rfdata->extend_flag)
+            {
          	/* update the file size info */
-				gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tfile being extended\n");
-				rfdata->fsize = poff + sz;
-			}
-			else
-			{
-				/* hit end of file */
-				gossip_debug(GOSSIP_REQUEST_DEBUG,
-						"\t\thit end of file: po %lld sz %lld fsz %lld\n",
-						Ld(poff), Ld(sz), Ld(rfdata->fsize));
-				*eof_flag = 1;
-				sz = rfdata->fsize - poff;
-				if (sz <= 0)
-				{
-					/* not even any more bytes before EOF */
-					gossip_debug(GOSSIP_REQUEST_DEBUG,
-							"\t\tend of file and no more bytes\n");
-					break;
-				}
-			}
-		}
-		/* process a segment */
-		if (PINT_IS_CLIENT(mode))
-		{
-			poff = result->offset_array[result->segs] + diff;
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"\tclient lstof %lld diff %lld sgof %lld\n",
-					Ld(result->offset_array[result->segs]), Ld(diff), Ld(poff));
-		}
-		/* else poff is the offset of the segment */
-		if (PINT_IS_CLIENT(mode) && mem)
-		{
-			/* call request processor to decode request type */
-			/* sequential offset is offset_array[*segs] */
-			/* size is sz */
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"**********CALL***PROCESS*********\n");
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tsegment of %lld sz %lld\n", Ld(poff), Ld(sz));
-			PINT_REQUEST_STATE_SET_TARGET(mem, poff);
-			PINT_REQUEST_STATE_SET_FINAL(mem, poff + sz);
-			PINT_Process_request (mem, NULL, rfdata, result, mode|PINT_MEMREQ);
-			sz = mem->type_offset - poff;
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"*****RETURN***FROM***PROCESS*****\n");
-		}
-		else
-		{
-			PINT_ADD_SEGMENT(result, poff, sz, mode);
-		}
-		/* this is used by client code */
-		if (PINT_IS_CLIENT(mode) && result->segs < result->segmax)
-		{
-			result->offset_array[result->segs] =
-				result->offset_array[result->segs - 1] + 
-				result->size_array[result->segs - 1];
-		}
-      /* prepare for next iteration */
-      loff  += sz;
-      size  -= loff - offset;
-      offset = loff;
-		/* find next logical offset on this server */
-      loff = (*rfdata->dist->methods->next_mapped_offset)
-				(rfdata->dist->params, rfdata->server_nr, rfdata->server_ct, offset);
-		gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tend iteration\n");
-		/* see if we are finished */
-		if (result->bytes >= result->bytemax ||
-				(!PINT_IS_CKSIZE(mode) && (result->segs >= result->segmax)))
-		{
-			gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tdone with segments or bytes\n");
-			break;
-		}
-   }
-	gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tfinished\n");
-	gossip_debug(GOSSIP_REQUEST_DEBUG,
-			"\t\t\tof %lld sz %lld sg %d sm %d by %lld bm %lld\n",
-			Ld(offset), Ld(size), result->segs, result->segmax, Ld(result->bytes),
-			Ld(result->bytemax));
-	/* find physical offset for this loff */
-   poff = (*rfdata->dist->methods->logical_to_physical_offset)
-			(rfdata->dist->params, rfdata->server_nr, rfdata->server_ct, loff);
-	gossip_debug(GOSSIP_REQUEST_DEBUG,
-	  "\t\t\tnext loff: %lld next poff: %lld\n", Ld(loff), Ld(poff));
-
-	if (poff >= rfdata->fsize && !rfdata->extend_flag)
-	{
-		/* end of file - thus end of request */
-		*eof_flag = 1;
-		gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\t\t[return value] %lld (EOF)\n",
-				Ld(orig_size));
-		return orig_size;
-	}
-	if (loff >= orig_offset + orig_size)
-	{
-		gossip_debug(GOSSIP_REQUEST_DEBUG,
-		  "\t\t\t(return value) %lld%s\n", Ld(orig_size),
-		  *eof_flag ? " (EOF)" : "");
-		return orig_size;
-	}
-	else
-	{
-		gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\t\treturn value %lld%s\n",
-			Ld(offset - orig_offset), *eof_flag ? " (EOF)" : "");
-		return (offset - orig_offset);
-	}
+                gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tfile being extended\n");
+                rfdata->fsize = poff + sz;
+            }
+            else
+            {
+                /* hit end of file */
+                gossip_debug(GOSSIP_REQUEST_DEBUG,
+                             "\t\thit end of file: po %lld sz %lld fsz %lld\n",
+                             Ld(poff), Ld(sz), Ld(rfdata->fsize));
+                *eof_flag = 1;
+                sz = rfdata->fsize - poff;
+                if (sz <= 0)
+                {
+                    /* not even any more bytes before EOF */
+                    gossip_debug(GOSSIP_REQUEST_DEBUG,
+                                 "\t\tend of file and no more bytes\n");
+                    break;
+                }
+            }
+        }
+        /* process a segment */
+        if (PINT_IS_CLIENT(mode))
+        {
+            poff = result->offset_array[result->segs] + diff;
+            gossip_debug(GOSSIP_REQUEST_DEBUG,
+                         "\tclient lstof %lld diff %lld sgof %lld\n",
+                         Ld(result->offset_array[result->segs]), Ld(diff),
+                         Ld(poff));
+        }
+        /* else poff is the offset of the segment */
+        if (PINT_IS_CLIENT(mode) && mem)
+        {
+            gossip_debug(GOSSIP_REQUEST_DEBUG,
+                         "**********CALL***PROCESS*********\n");
+            gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tsegment of %lld sz %lld\n",
+                         Ld(poff), Ld(sz));
+
+            /* call request processor to decode request type */
+            /* sequential offset is offset_array[*segs] */
+            /* size is sz */
+            PINT_REQUEST_STATE_SET_TARGET(mem, poff);
+            PINT_REQUEST_STATE_SET_FINAL(mem, poff + sz);
+            PINT_process_request(mem, NULL, rfdata, result, mode|PINT_MEMREQ);
+            sz = mem->type_offset - poff;
+            
+            gossip_debug(GOSSIP_REQUEST_DEBUG,
+                         "*****RETURN***FROM***PROCESS*****\n");
+        }
+        else
+        {
+            PINT_ADD_SEGMENT(result, poff, sz, mode);
+        }
+        /* this is used by client code */
+        if (PINT_IS_CLIENT(mode) && result->segs < result->segmax)
+        {
+            result->offset_array[result->segs] =
+                result->offset_array[result->segs - 1] + 
+                result->size_array[result->segs - 1];
+        }
+        /* prepare for next iteration */
+        loff  += sz;
+        size  -= loff - offset;
+        offset = loff;
+        /* find next logical offset on this server */
+        loff = (*rfdata->dist->methods->next_mapped_offset)
+            (rfdata->dist->params,
+             rfdata,
+             offset);
+        assert(-1 != loff);
+        
+        gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tend iteration\n");
+        /* see if we are finished */
+        if (result->bytes >= result->bytemax ||
+            (!PINT_IS_CKSIZE(mode) && (result->segs >= result->segmax)))
+        {
+            gossip_debug(GOSSIP_REQUEST_DEBUG,
+                         "\t\tdone with segments or bytes\n");
+            break;
+        }
+    }
+    
+    gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\tfinished\n");
+    gossip_debug(GOSSIP_REQUEST_DEBUG,
+                 "\t\t\tof %lld sz %lld sg %d sm %d by %lld bm %lld\n",
+                 Ld(offset), Ld(size), result->segs, result->segmax,
+                 Ld(result->bytes),
+                 Ld(result->bytemax));
+    
+    /* find physical offset for this loff */
+    poff = (*rfdata->dist->methods->logical_to_physical_offset)
+        (rfdata->dist->params, rfdata, loff);
+    
+    gossip_debug(GOSSIP_REQUEST_DEBUG,
+                 "\t\t\tnext loff: %lld next poff: %lld\n",
+                 Ld(loff), Ld(poff));
+    
+    if (poff >= rfdata->fsize && !rfdata->extend_flag)
+    {
+        /* end of file - thus end of request */
+        *eof_flag = 1;
+        gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\t\t[return value] %lld (EOF)\n",
+                     Ld(orig_size));
+        return orig_size;
+    }
+    if (loff >= orig_offset + orig_size)
+    {
+        gossip_debug(GOSSIP_REQUEST_DEBUG,
+                     "\t\t\t(return value) %lld%s\n", Ld(orig_size),
+                     *eof_flag ? " (EOF)" : "");
+        return orig_size;
+    }
+    else
+    {
+        gossip_debug(GOSSIP_REQUEST_DEBUG,"\t\t\treturn value %lld%s\n",
+                     Ld(offset - orig_offset), *eof_flag ? " (EOF)" : "");
+        return (offset - orig_offset);
+    }
 }
 
 /* Function: PINT_Request_commit
@@ -750,14 +809,14 @@ PVFS_size PINT_Distribute(PVFS_offset of
  * offsets must reflect the current offsets and then write each struct 
  * to the contiguous memory region
  */
-int PINT_Request_commit(PINT_Request *region, PINT_Request *node)
+int PINT_request_commit(PINT_Request *region, PINT_Request *node)
 {
-	int32_t index = 0;
-	PINT_Do_Request_commit(region, node, &index, 0);
-	return 0;
+    int32_t index = 0;
+    PINT_do_request_commit(region, node, &index, 0);
+    return 0;
 }
 
-int PINT_Do_clear_commit(PINT_Request *node, int32_t depth)
+int PINT_do_clear_commit(PINT_Request *node, int32_t depth)
 {
 	if (node == NULL)
 		return -1;
@@ -769,16 +828,16 @@ int PINT_Do_clear_commit(PINT_Request *n
 
 	if (node->ereq)
 	{
-		PINT_Do_clear_commit(node->ereq, depth+1);
+		PINT_do_clear_commit(node->ereq, depth+1);
 	}
 	if (node->sreq)
 	{
-		PINT_Do_clear_commit(node->sreq, depth+1);
+		PINT_do_clear_commit(node->sreq, depth+1);
 	}
 	return 0;
 }
 
-PINT_Request *PINT_Do_Request_commit(PINT_Request *region, PINT_Request *node,
+PINT_Request *PINT_do_request_commit(PINT_Request *region, PINT_Request *node,
 		int32_t *index, int32_t depth)
 {
 	int node_was_committed = 0;
@@ -813,7 +872,7 @@ PINT_Request *PINT_Do_Request_commit(PIN
 	if (node->ereq)
 	{
 		region[node->committed].ereq =
-				PINT_Do_Request_commit(region, node->ereq, index, depth+1);
+				PINT_do_request_commit(region, node->ereq, index, depth+1);
 	}
 	else
 	{
@@ -824,7 +883,7 @@ PINT_Request *PINT_Do_Request_commit(PIN
 	if (node->sreq)
 	{
 		region[node->committed].sreq =
-				PINT_Do_Request_commit(region, node->sreq, index, depth+1);
+				PINT_do_request_commit(region, node->sreq, index, depth+1);
 	}
 	else
 	{
@@ -834,7 +893,7 @@ PINT_Request *PINT_Do_Request_commit(PIN
 	if (depth == 0)
 	{
 		gossip_debug(GOSSIP_REQUEST_DEBUG,"clearing tree\n");
-		PINT_Do_clear_commit(node, 0);
+		PINT_do_clear_commit(node, 0);
 		/* this indicates the region is packed */
 		region->committed = -1;
 		/* if the original request was committed, this restores that */
@@ -851,7 +910,7 @@ PINT_Request *PINT_Do_Request_commit(PIN
 /* This function converts pointers to array indexes for transport
  * The input Request MUST be committed
  */
-int PINT_Request_encode(struct PINT_Request *req)
+int PINT_request_encode(struct PINT_Request *req)
 {
 	int r;
 	if (!PINT_REQUEST_IS_PACKED(req))
@@ -873,7 +932,7 @@ int PINT_Request_encode(struct PINT_Requ
 /* This function coverts array indexes back to pointers after transport
  * The input Request MUST be committed
  */
-int PINT_Request_decode(struct PINT_Request *req)
+int PINT_request_decode(struct PINT_Request *req)
 {
 	int r;
 	if (!PINT_REQUEST_IS_PACKED(req))
@@ -894,18 +953,18 @@ int PINT_Request_decode(struct PINT_Requ
 }
     
 
-void PINT_Dump_packed_request(PINT_Request *req)
+void PINT_dump_packed_request(PINT_Request *req)
 {
 	int i;
 	if (!PINT_REQUEST_IS_PACKED(req))
 		return;
 	for (i = 0; i < PINT_REQUEST_NEST_SIZE(req)+1; i++)
 	{
-		PINT_Dump_request(req+i);
+		PINT_dump_request(req+i);
 	}
 }
 
-void PINT_Dump_request(PINT_Request *req)
+void PINT_dump_request(PINT_Request *req)
 {
 	gossip_debug(GOSSIP_REQUEST_DEBUG,"**********************\n");
 	gossip_debug(GOSSIP_REQUEST_DEBUG,"address:\t%p\n",req);
@@ -925,3 +984,14 @@ void PINT_Dump_request(PINT_Request *req
 	gossip_debug(GOSSIP_REQUEST_DEBUG,"sreq:\t\t%p\n",req->sreq);
 	gossip_debug(GOSSIP_REQUEST_DEBUG,"**********************\n");
 }
+
+
+/*
+ * Local variables:
+ *  mode: c
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */

Index: pint-request.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pint-request.h,v
diff -p -u -r1.28 -r1.28.6.1
--- pint-request.h	2 Dec 2004 18:14:45 -0000	1.28
+++ pint-request.h	25 Aug 2005 20:38:24 -0000	1.28.6.1
@@ -7,10 +7,12 @@
 #ifndef __PINT_REQUEST_H
 #define __PINT_REQUEST_H
 
-#include "pint-distribution.h"
-#include <pvfs2-types.h>
+#include "pvfs2-types.h"
 
-/* modes for PINT_Process_request  and PINT_Distribute */
+/* Forward declarations */
+struct PINT_dist_s;
+
+/* modes for PINT_Process_request  and PINT_distribute */
 #define PINT_SERVER                000001
 #define PINT_CLIENT                000002
 #define PINT_CKSIZE                000004
@@ -74,9 +76,13 @@ typedef struct PINT_Request {
 	encode_int32_t(pptr, &(rp+i)->refcount); \
 	encode_skip4(pptr,); \
 	/* These pointers have been encoded already, just write as ints */ \
-	encode_uint32_t(pptr, (u_int32_t*) &(rp+i)->ereq); \
-	encode_uint32_t(pptr, (u_int32_t*) &(rp+i)->sreq); \
-    } \
+	{ u_int32_t encti = (u_int32_t)(uintptr_t) (rp+i)->ereq; \
+		encode_uint32_t(pptr, &encti); \
+	}\
+	{ u_int32_t encti = (u_int32_t)(uintptr_t) (rp+i)->sreq; \
+		encode_uint32_t(pptr, &encti); \
+	}\
+    }\
 } while (0);
 #define decode_PVFS_Request(pptr,rp) do { int i; \
     for (i=0; i == 0 || i<=(rp)->num_nested_req; i++) { \
@@ -94,8 +100,14 @@ typedef struct PINT_Request {
 	decode_int32_t(pptr, &(rp+i)->refcount); \
 	decode_skip4(pptr,); \
 	/* put integer offsets into pointers, let PINT_Request_decode fix */ \
-	decode_uint32_t(pptr, (u_int32_t*) &(rp+i)->ereq); \
-	decode_uint32_t(pptr, (u_int32_t*) &(rp+i)->sreq); \
+	{ u_int32_t encti; \
+		decode_uint32_t(pptr, &encti); \
+		(rp+i)->ereq = (PINT_Request *)(uintptr_t) encti; \
+	}\
+	{ u_int32_t encti; \
+		decode_uint32_t(pptr, &encti); \
+		(rp+i)->sreq = (PINT_Request *)(uintptr_t) encti; \
+	}\
     } \
 } while (0);
 #endif
@@ -129,56 +141,56 @@ typedef struct PINT_Request_state { 
  */
 
 typedef struct PINT_Request_result {
-	PVFS_offset  *offset_array;/* array of offsets for each segment output */
-	PVFS_size    *size_array;  /* array of sizes for each segment output */
-	int32_t      segmax;       /* maximum number of segments to output */
-	int32_t      segs;         /* number of segments output */
-	PVFS_size    bytemax;      /* maximum number of bytes to output */
-	PVFS_size    bytes;        /* number of bytes output */
+    PVFS_offset  *offset_array;/* array of offsets for each segment output */
+    PVFS_size    *size_array;  /* array of sizes for each segment output */
+    int32_t      segmax;       /* maximum number of segments to output */
+    int32_t      segs;         /* number of segments output */
+    PVFS_size    bytemax;      /* maximum number of bytes to output */
+    PVFS_size    bytes;        /* number of bytes output */
 } PINT_Request_result;
 
-typedef struct PINT_Request_file_data {
-	PVFS_size    fsize;			/* actual size of local storage object */
-	uint32_t     server_nr;		/* ordinal number of THIS server for this file */
-	uint32_t     server_ct;		/* number of servers for this file */
-	PINT_dist    *dist;			/* dist struct for the file */
-	PVFS_boolean extend_flag;	/* if zero, file will not be extended */
-} PINT_Request_file_data;
+typedef struct PINT_request_file_data_s {
+    PVFS_size    fsize;         /* actual size of local storage object */
+    uint32_t     server_nr;     /* ordinal number of THIS server for this file */
+    uint32_t     server_ct;     /* number of servers for this file */
+    struct PINT_dist_s *dist;   /* dist struct for the file */
+    PVFS_boolean extend_flag;   /* if zero, file will not be extended */
+} PINT_request_file_data;
 
-struct PINT_Request_state *PINT_New_request_state (PINT_Request *request);
+struct PINT_Request_state *PINT_new_request_state (PINT_Request *request);
 
-void PINT_Free_request_state (PINT_Request_state *req);
+void PINT_free_request_state (PINT_Request_state *req);
 
 /* generate offset length pairs from request and dist */
-int PINT_Process_request(PINT_Request_state *req,
+int PINT_process_request(PINT_Request_state *req,
 		PINT_Request_state *mem,
-		PINT_Request_file_data *rfdata,
+		PINT_request_file_data *rfdata,
 		PINT_Request_result *result,
 		int mode);
 
 /* internal function */
-PVFS_size PINT_Distribute(PVFS_offset offset,
-		PVFS_size size,
-		PINT_Request_file_data *rfdata,
-		PINT_Request_state *mem,
-		PINT_Request_result *result,
-		PVFS_boolean *eof_flag,
-		int mode);
+PVFS_size PINT_distribute(PVFS_offset offset,
+                          PVFS_size size,
+                          PINT_request_file_data *rfdata,
+                          PINT_Request_state *mem,
+                          PINT_Request_result *result,
+                          PVFS_boolean *eof_flag,
+                          int mode);
 
 /* pack request from node into a contiguous buffer pointed to by region */
-int PINT_Request_commit(PINT_Request *region, PINT_Request *node);
-PINT_Request *PINT_Do_Request_commit(PINT_Request *region, PINT_Request *node,
+int PINT_request_commit(PINT_Request *region, PINT_Request *node);
+PINT_Request *PINT_do_request_commit(PINT_Request *region, PINT_Request *node,
 		int32_t *index, int32_t depth);
-int PINT_Do_clear_commit(PINT_Request *node, int32_t depth);
+int PINT_do_clear_commit(PINT_Request *node, int32_t depth);
 
 /* encode packed request in place for sending over wire */
-int PINT_Request_encode(struct PINT_Request *req);
+int PINT_request_encode(struct PINT_Request *req);
 
 /* decode packed request in place after receiving from wire */
-int PINT_Request_decode(struct PINT_Request *req);
+int PINT_request_decode(struct PINT_Request *req);
 
-void PINT_Dump_packed_request(struct PINT_Request *req);
-void PINT_Dump_request(struct PINT_Request *req);
+void PINT_dump_packed_request(struct PINT_Request *req);
+void PINT_dump_request(struct PINT_Request *req);
 
 /********* macros for accessing key fields in a request *********/
 
@@ -288,3 +300,14 @@ void PINT_Dump_request(struct PINT_Reque
 	} while(0)
 
 #endif /* __PINT_REQUEST_H */
+
+
+/*
+ * Local variables:
+ *  mode: c
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */

Index: pvfs-distribution.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pvfs-distribution.h,v
diff -p -u -r1.10 -r1.10.8.1
--- pvfs-distribution.h	13 May 2004 14:46:37 -0000	1.10
+++ pvfs-distribution.h	25 Aug 2005 20:38:24 -0000	1.10.8.1
@@ -9,81 +9,21 @@
 
 #include "pvfs2-types.h"
 
-/* each particular distribution implementation will define this for itself */
-typedef struct {
-	PVFS_offset (*logical_to_physical_offset)(void* params,
-                                                  uint32_t server_nr,
-                                                  uint32_t server_ct,
-                                                  PVFS_offset logical_offset);
-	PVFS_offset (*physical_to_logical_offset)(void* params,
-                                                  uint32_t server_nr,
-                                                  uint32_t server_ct,
-                                                  PVFS_offset physical_offset);
-	PVFS_offset (*next_mapped_offset)(void* params,
-                                          uint32_t server_nr,
-                                          uint32_t server_ct,
-                                          PVFS_offset logical_offset);
-	PVFS_size (*contiguous_length)(void* params,
-                                       uint32_t server_nr,
-                                       uint32_t server_ct,
-                                       PVFS_offset physical_offset);
-	PVFS_size (*logical_file_size)(void* params,
-                                       uint32_t server_ct,
-                                       PVFS_size *psizes);
-	void (*encode)(void* params, void *buffer);
-	void (*decode)(void* params, void *buffer);
-	void (*encode_lebf)(char **pptr, void* params);
-	void (*decode_lebf)(char **pptr, void* params);
-} PVFS_Dist_methods;
-
-/* this struct is used to define a distribution to PVFS */
-typedef struct PINT_dist_s {
-	char *dist_name;
-	int32_t name_size;
-	int32_t param_size; 
-	void *params;
-	PVFS_Dist_methods *methods;
-} PINT_dist;
-
-#ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
-#define encode_PVFS_Dist(pptr,x) do { PINT_dist *px = *(x); \
-    encode_string(pptr, &px->dist_name); \
-    if (!px->methods) { \
-	gossip_err("%s: encode_PVFS_Dist: methods is null\n", __func__); \
-	exit(1); \
-    } \
-    (px->methods->encode_lebf) (pptr, px->params); \
-} while (0)
-#define decode_PVFS_Dist(pptr,x) do { PINT_dist tmp_dist; PINT_dist *px; \
-    extern int PINT_Dist_lookup(PINT_dist *dist); \
-    decode_string(pptr, &tmp_dist.dist_name); \
-    tmp_dist.params = 0; \
-    tmp_dist.methods = 0; \
-    /* bizzare lookup function fills in most fields */ \
-    PINT_Dist_lookup(&tmp_dist); \
-    if (!tmp_dist.methods) { \
-	gossip_err("%s: decode_PVFS_Dist: methods is null\n", __func__); \
-	exit(1); \
-    } \
-    /* later routines assume dist is a big contiguous thing, do so */ \
-    *(x) = px = decode_malloc(PINT_DIST_PACK_SIZE(&tmp_dist)); \
-    memcpy(px, &tmp_dist, sizeof(*px)); \
-    px->dist_name = (char *) px + roundup8(sizeof(*px)); \
-    memcpy(px->dist_name, tmp_dist.dist_name, tmp_dist.name_size); \
-    px->params = (void *)(px->dist_name + roundup8(px->name_size)); \
-    (px->methods->decode_lebf) (pptr, px->params); \
-} while (0)
-#endif
-
 extern PINT_dist *PVFS_dist_create(const char *name);
 extern int PVFS_dist_free(PINT_dist *dist);
 extern PINT_dist *PVFS_Dist_copy(const PINT_dist *dist);
-extern int PINT_dist_getparams(void *buf, const PINT_dist *dist);
-extern int PINT_dist_setparams(PINT_dist *dist, const void *buf);
+extern int PVFS_dist_getparams(void *buf, const PINT_dist *dist);
+extern int PVFS_dist_setparams(PINT_dist *dist, const void *buf);
 
-/******** macros for access to dist struct ***********/
-
-#define PINT_DIST_PACK_SIZE(d) \
- (roundup8(sizeof(*(d))) + roundup8((d)->name_size) + roundup8((d)->param_size))
 
 #endif /* __PVFS_DISTRIBUTION_H */
+
+/*
+ * Local variables:
+ *  mode: c
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */

Index: pvfs-request.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/description/pvfs-request.c,v
diff -p -u -r1.21 -r1.21.2.1
--- pvfs-request.c	27 May 2005 19:27:04 -0000	1.21
+++ pvfs-request.c	25 Aug 2005 20:38:24 -0000	1.21.2.1
@@ -413,7 +413,7 @@ int PVFS_Request_commit(PVFS_Request * r
             return PVFS_ERR_REQ;
         }
         /* pack the request */
-        PINT_Request_commit(region, req);
+        PINT_request_commit(region, req);
     }
     /* return the pointer to the memory region */
     *reqp = region;



More information about the PVFS2-CVS mailing list