home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / test / io / description / test-zero-fill.c < prev   
C/C++ Source or Header  |  2008-11-26  |  16KB  |  816 lines

  1.  
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdarg.h>
  6. #include <time.h>
  7. #include <unistd.h>
  8. #include "pvfs2-request.h"
  9. #include "pvfs2-sysint.h"
  10. #include "pvfs2-util.h"
  11. #include "pvfs2-dist-simple-stripe.h"
  12.  
  13. char buff[1000];
  14. char check_buff[1000];
  15. char * dashes = "--------------------------------------------------------";
  16. char * spaces = "                                                        ";
  17. char * as = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
  18. char * bs = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB";
  19. char * cs = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC";
  20. char * xs = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  21.  
  22. int verbose = 0;
  23.  
  24. void reset_buff(void);
  25. void print_buff(int padding, int len);
  26.  
  27. int do_smallmem_noncontig_read(
  28.     PVFS_object_ref ref, PVFS_credentials * creds,
  29.     int memsize,
  30.     int chunks,
  31.     ...);
  32.  
  33. int do_noncontig_read(
  34.     PVFS_object_ref ref, PVFS_credentials * creds, 
  35.     int chunks, 
  36.     ...);
  37.  
  38. int do_contig_read(
  39.     PVFS_object_ref ref, 
  40.     PVFS_credentials * creds, 
  41.     PVFS_offset offset, 
  42.     int length,
  43.     PVFS_Request freq);
  44.  
  45. int do_write(PVFS_object_ref ref, PVFS_credentials * creds,
  46.          PVFS_offset offset, PVFS_size size, char * buff);
  47.  
  48. int check_results(
  49.     PVFS_offset offset,
  50.     int total_read,
  51.     PVFS_offset * offsets,
  52.     int32_t * sizes,
  53.     int count);
  54.  
  55. int check_smallmem_results(
  56.     PVFS_offset offset,
  57.     int total_read,
  58.     int memsize,
  59.     PVFS_offset * offsets,
  60.     int32_t * sizes,
  61.     int count);
  62.  
  63. void reset_buff(void)
  64. {
  65.     memset(buff, 'X', 1000);
  66. }
  67.  
  68. void print_buff(int padding, int len)
  69. {
  70.     int i = 0;
  71.     
  72.     fprintf(stdout, "RESULT: \t");
  73.     fprintf(stdout, "%.*s", padding, spaces);
  74.  
  75.     for(; i < 50; ++i)
  76.     {
  77.     fprintf(stdout, "%c", (buff[i] == 0 ? '-' : buff[i]));
  78.     }
  79.     fprintf(stdout, "\t (%d bytes)\n\n", len);
  80. }
  81.  
  82. int check_smallmem_results(
  83.     PVFS_offset offset,
  84.     int total_read,
  85.     int memsize,
  86.     PVFS_offset * offsets,
  87.     int32_t * sizes,
  88.     int count)
  89. {
  90.     int stop_size;
  91.     int total_size = 0;
  92.     int i = 0;
  93.     int res = 0;
  94.  
  95.     stop_size = (memsize > total_read) ? total_read : memsize;
  96.  
  97.     for(; i < count; ++i)
  98.     {
  99.     if(total_size + sizes[i] > stop_size)
  100.     {
  101.         sizes[i] = stop_size - total_size;
  102.     }
  103.  
  104.     res = memcmp(check_buff + offset + offsets[i], 
  105.              buff + total_size, sizes[i]);
  106.     if(res != 0)
  107.     {
  108.         if(verbose)
  109.         {
  110.         printf("Invalid result: offset: %d, size: %d\n",
  111.                (int32_t)offsets[i], (int32_t)sizes[i]);
  112.         }
  113.         return res;
  114.     }
  115.     total_size += sizes[i];
  116.     }
  117.  
  118.     return 0;
  119.  
  120. }
  121.  
  122. int check_results(
  123.     PVFS_offset offset,
  124.     int total_read,
  125.     PVFS_offset * offsets,
  126.     int32_t * sizes,
  127.     int count)
  128. {
  129.     int total_size = 0;
  130.     int i = 0;
  131.     int res;
  132.  
  133.     for(; i < count; ++i)
  134.     {
  135.     if(total_read < (total_size + sizes[i]))
  136.     {
  137.         sizes[i] = (total_read - total_size);
  138.     }
  139.        
  140.     res = memcmp(
  141.         check_buff + offset + offsets[i], buff + total_size, sizes[i]);
  142.     if(res != 0)
  143.     {
  144.         if(verbose)
  145.         {
  146.         printf("Invalid result: offset: %u, size: %d\n", 
  147.                (int32_t)offsets[i], (int32_t)sizes[i]);
  148.         }
  149.         return res;
  150.     }
  151.     total_size += sizes[i];
  152.     }
  153.  
  154.     return 0;
  155. }
  156.         
  157.  
  158. int do_smallmem_noncontig_read(
  159.     PVFS_object_ref ref, PVFS_credentials * creds,
  160.     int memsize,
  161.     int chunks,
  162.     ...)
  163. {
  164.     int i;
  165.     int res;
  166.     PVFS_Request memreq, readreq;
  167.     PVFS_sysresp_io io_resp;
  168.     PVFS_size * offsets;
  169.     int32_t * sizes;
  170.     va_list args_list;
  171.     int total = 0;
  172.     
  173.     if(verbose)
  174.     {
  175.     fprintf(stdout, 
  176.         "READING:\t");
  177.     }
  178.  
  179.     sizes = malloc(sizeof(int32_t) * chunks);
  180.     offsets = malloc(sizeof(PVFS_size) * chunks);
  181.  
  182.     va_start(args_list, chunks);
  183.  
  184.     for(i = 0; i < chunks; ++i)
  185.     {
  186.     offsets[i] = (PVFS_size)va_arg(args_list, int);
  187.     sizes[i] = (int32_t)va_arg(args_list, int);
  188.  
  189.     if(verbose)
  190.     {
  191.         total += fprintf(stdout,
  192.                  "%.*s<%.*s>",
  193.                  (int) (offsets[i] - total), spaces,
  194.                  (int) (sizes[i] - 2), spaces);
  195.     }
  196.  
  197.     }
  198.  
  199.     va_end(args_list);
  200.  
  201.     if(verbose)
  202.     {
  203.     fprintf(stdout, "    (memsize = %d)\n", memsize);
  204.     }
  205.  
  206.     PVFS_Request_indexed(chunks, sizes, offsets, PVFS_BYTE, &readreq);
  207.     PVFS_Request_contiguous(memsize, PVFS_BYTE, &memreq);
  208.  
  209.     reset_buff();
  210.  
  211.     res = PVFS_sys_read(
  212.     ref, readreq, 0, buff, memreq, creds, &io_resp, NULL);
  213.     if(res < 0)
  214.     {
  215.     PVFS_perror("read failed with errcode", res);
  216.     return res;
  217.     }
  218.  
  219.     if(verbose)
  220.     {
  221.     print_buff(0, io_resp.total_completed);
  222.     }
  223.     
  224.     res = check_smallmem_results(
  225.     0, io_resp.total_completed, memsize, offsets, sizes, chunks);
  226.  
  227.     free(offsets);
  228.     free(sizes);
  229.  
  230.     return res;
  231.  
  232. int do_noncontig_read(
  233.     PVFS_object_ref ref, PVFS_credentials * creds, 
  234.     int chunks, 
  235.     ...)
  236. {
  237.     int i;
  238.     int res;
  239.     PVFS_Request memreq, readreq;
  240.     PVFS_sysresp_io io_resp;
  241.     PVFS_size * offsets;
  242.     int32_t * sizes;
  243.     PVFS_size readreq_size;
  244.     va_list args_list;
  245.     int total = 0;
  246.     
  247.     if(verbose)
  248.     {
  249.     fprintf(stdout, 
  250.         "READING:\t");
  251.     }
  252.  
  253.     sizes = malloc(sizeof(int32_t) * chunks);
  254.     offsets = malloc(sizeof(PVFS_size) * chunks);
  255.  
  256.     va_start(args_list, chunks);
  257.  
  258.     for(i = 0; i < chunks; ++i)
  259.     {
  260.     offsets[i] = (PVFS_size)va_arg(args_list, int);
  261.     sizes[i] = (int32_t)va_arg(args_list, int);
  262.  
  263.     if(verbose)
  264.     {
  265.         total += fprintf(stdout,
  266.                  "%.*s<%.*s>",
  267.                  (int) (offsets[i] - total), spaces,
  268.                  (int) (sizes[i] - 2), spaces);
  269.     }
  270.     }
  271.     
  272.     va_end(args_list);
  273.  
  274.     if(verbose)
  275.     {
  276.     fprintf(stdout, "\n");
  277.     }
  278.  
  279.     PVFS_Request_indexed(chunks, sizes, offsets, PVFS_BYTE, &readreq);
  280.     PVFS_Request_size(readreq, &readreq_size);
  281.     PVFS_Request_contiguous(readreq_size, PVFS_BYTE, &memreq);
  282.  
  283.     reset_buff();
  284.  
  285.     res = PVFS_sys_read(
  286.     ref, readreq, 0, buff, memreq, creds, &io_resp, NULL);
  287.     if(res < 0)
  288.     {
  289.     PVFS_perror("read failed with errcode", res);
  290.     return res;
  291.     }
  292.  
  293.     if(verbose)
  294.     {
  295.     print_buff(0, io_resp.total_completed);
  296.     }
  297.  
  298.     res = check_results(0, io_resp.total_completed, offsets, sizes, chunks);
  299.  
  300.     free(offsets);
  301.     free(sizes);
  302.  
  303.     return res;
  304. }
  305.  
  306. int do_contig_read(
  307.     PVFS_object_ref ref, 
  308.     PVFS_credentials * creds, 
  309.     PVFS_offset offset, 
  310.     int length,
  311.     PVFS_Request freq)
  312. {
  313.     int res;
  314.     PVFS_sysresp_io     io_resp;
  315.     PVFS_Request memreq, readreq;
  316.  
  317.     if(verbose)
  318.     {
  319.     fprintf(stdout, 
  320.         "READING:\t"
  321.         "%.*s<%.*s>\n",
  322.         (int)offset, spaces,
  323.         length - 2, spaces);
  324.     }
  325.  
  326.     res = PVFS_Request_contiguous(length, PVFS_BYTE, &memreq);
  327.     if(res < 0)
  328.     {
  329.     PVFS_perror("request contig for memory failed with errcode", res);
  330.     return res;
  331.     }
  332.  
  333.     if(freq)
  334.     {
  335.     readreq = freq;
  336.     }
  337.     else
  338.     {
  339.     res = PVFS_Request_contiguous(length, PVFS_BYTE, &readreq);
  340.     if(res < 0)
  341.     {
  342.         PVFS_perror("request contig for file failed with errcode", res);
  343.         return res;
  344.     }
  345.     }
  346.  
  347.     reset_buff();
  348.  
  349.     res = PVFS_sys_read(
  350.     ref, readreq, offset, buff, memreq, creds, &io_resp, NULL);
  351.     if(res < 0)
  352.     {
  353.     PVFS_perror("read failed with errcode", res);
  354.     return res;
  355.     }
  356.  
  357.     if(verbose)
  358.     {
  359.     print_buff(offset, io_resp.total_completed);
  360.     }
  361.  
  362.     res = check_results(0, io_resp.total_completed, 
  363.             (PVFS_offset *)&offset, &length, 1);
  364.  
  365.     return res;
  366. }
  367.  
  368. int do_write(PVFS_object_ref ref, PVFS_credentials * creds,
  369.          PVFS_offset offset, PVFS_size size, char * buff)
  370. {
  371.     PVFS_Request filereq;
  372.     PVFS_Request memreq;
  373.     PVFS_sysresp_io     io_resp;
  374.     int res;
  375.  
  376.     /* setup check_buff */
  377.     memcpy(check_buff + offset, buff, size);
  378.  
  379.     if(verbose)
  380.     {
  381.     fprintf(stdout,
  382.         "WRITING:\t"
  383.         "%.*s%.*s\n\n",
  384.         (int32_t)offset, spaces,
  385.         (int32_t)size, buff);
  386.     }
  387.  
  388.     res = PVFS_Request_contiguous(size, PVFS_BYTE, &filereq);
  389.     if(res < 0)
  390.     {
  391.     PVFS_perror("request contig for memory failed with errcode", res);
  392.     return -1;
  393.     }
  394.  
  395.     res = PVFS_Request_contiguous(size, PVFS_BYTE, &memreq);
  396.     if(res < 0)
  397.     {
  398.     PVFS_perror("request contig for memory failed with errcode", res);
  399.     return -1;
  400.     }
  401.  
  402.     res = PVFS_sys_write(
  403.     ref, filereq, 
  404.     offset, buff, memreq, creds, &io_resp, NULL);
  405.     if(res < 0)
  406.     {
  407.     PVFS_perror("write failed with errcode", res);
  408.     return -1;
  409.     }
  410.  
  411.     return 0;
  412. }
  413.  
  414. static void usage(void)
  415. {
  416.     printf("usage: test-zero-fill [<OPTIONS>...]\n");
  417.     printf("\n<OPTIONS> is one of\n");
  418.     printf("-v\t\tverbose mode.  prints out read results\n");
  419.     printf("-s <strip size>\tstrip size to use when creating the file\n");
  420.     printf("-h\t\tprint this help\n");
  421. }
  422.  
  423. #define ZEROFILL_FILENAME "test-zerofill"
  424.  
  425. extern char *optarg;
  426. extern int optind, opterr, optopt;
  427.  
  428. int main(int argc, char * argv[])
  429. {
  430.     PVFS_sysresp_create create_resp;
  431.     PVFS_sysresp_lookup lookup_resp;
  432.     PVFS_fs_id curfs;
  433.     PVFS_sys_attr attr;
  434.     PVFS_credentials creds;
  435.     PVFS_sys_dist * dist;
  436.     int strip_size = 9;
  437.     int half_strip;
  438.     int before_len, after_len;
  439.     char zerofill_fname[100];
  440.     PVFS_simple_stripe_params params;
  441.     int32_t res, realres;
  442.     char c;
  443.  
  444.     memset(check_buff, 0, 1000);
  445.  
  446.     while((c = getopt(argc, argv, "vs:")) != EOF)
  447.     {
  448.     switch(c)
  449.     {
  450.         case 'v':
  451.         verbose = 1;
  452.         break;
  453.         case 's':
  454.         strip_size = atoi(optarg);
  455.         break;
  456.         case 'h':
  457.         usage();
  458.         exit(0);
  459.         case '?':
  460.         usage();
  461.         exit(1);
  462.         default:
  463.         break;
  464.     }
  465.     }
  466.  
  467.     half_strip = (int) strip_size / 2;
  468.  
  469.     res = PVFS_util_init_defaults();
  470.     if(res < 0)
  471.     {
  472.     PVFS_perror("PVFS_util_init_defaults", res);
  473.     return (-1);
  474.     }
  475.  
  476.     res = PVFS_util_get_default_fsid(&curfs);
  477.     if(res < 0)
  478.     {
  479.     PVFS_perror("PVFS_util_get_default_fsid", res);
  480.     return (-1);
  481.     }
  482.   
  483.     before_len = half_strip - 1;
  484.     after_len = half_strip + (strip_size % 2 == 0 ? 0 : 1) - 2;
  485.  
  486.     if(verbose)
  487.     {
  488.  
  489.     fprintf(stdout, 
  490.         "unset  = XXXXX\n"
  491.         "zeroed = -----\n\n"
  492.         "DISTRIBUTION (strip size == %d):\n"
  493.         "        \t|%.*s0%.*s||%.*s1%.*s||%.*s2%.*s|"
  494.         "|%.*s0%.*s||%.*s1%.*s||%.*s2%.*s|\n", 
  495.         strip_size,
  496.         before_len, dashes, after_len, dashes,
  497.         before_len, dashes, after_len, dashes,
  498.         before_len, dashes, after_len, dashes,
  499.         before_len, dashes, after_len, dashes,
  500.         before_len, dashes, after_len, dashes,
  501.         before_len, dashes, after_len, dashes);
  502.     }
  503.  
  504.     res = PVFS_sys_lookup(curfs, "/", &creds, &lookup_resp, 0, NULL);
  505.     if(res < 0)
  506.     {
  507.     PVFS_perror("lookup failed with errcode", res);
  508.     }
  509.     
  510.     dist = PVFS_sys_dist_lookup("simple_stripe");
  511.     params.strip_size = strip_size;
  512.  
  513.     res = PVFS_sys_dist_setparam(dist, "strip_size", (void *)¶ms);
  514.     if(res < 0)
  515.     {
  516.     PVFS_perror("dist setparam failed with errcode", res);
  517.     }
  518.  
  519.     PVFS_util_gen_credentials(&creds);
  520.  
  521.     attr.mask = PVFS_ATTR_SYS_ALL_SETABLE;
  522.     attr.owner = creds.uid;
  523.     attr.group = creds.gid;
  524.     attr.perms = 1877;
  525.     attr.atime = attr.ctime = attr.mtime = time(NULL);
  526.  
  527.     sprintf(zerofill_fname, "%s-%d", ZEROFILL_FILENAME, rand());
  528.  
  529.     if(verbose)
  530.     {
  531.     fprintf(stdout, "filename: %s\n", zerofill_fname);
  532.     }
  533.  
  534.     res = PVFS_sys_create(
  535.     zerofill_fname, lookup_resp.ref, attr, &creds, dist, &create_resp, NULL, NULL);
  536.     if(res < 0)
  537.     {
  538.     PVFS_perror("create failed with errcode", res);
  539.     return -1;
  540.     }
  541.  
  542.     half_strip = strip_size / 2;
  543.  
  544.     do_write(create_resp.ref, &creds, 0, half_strip, as);
  545.  
  546.     do_write(create_resp.ref, &creds, strip_size * 2, half_strip, bs);
  547.  
  548.     res = do_contig_read(
  549.     create_resp.ref, &creds, 0, strip_size + half_strip, NULL);
  550.     if(res < 0)
  551.     {
  552.     goto exit;
  553.     }
  554.     
  555.     res = do_contig_read(
  556.     create_resp.ref, &creds, 0, strip_size + half_strip, PVFS_BYTE);
  557.     if(res < 0)
  558.     {
  559.     goto exit;
  560.     }
  561.  
  562.     res = do_contig_read(
  563.     create_resp.ref, &creds, 
  564.     (strip_size + half_strip), (strip_size + half_strip), NULL);
  565.     if(res < 0)
  566.     {
  567.     goto exit;
  568.     }
  569.  
  570.     res = do_contig_read(
  571.     create_resp.ref, &creds, 
  572.     (strip_size + half_strip), (strip_size + half_strip), PVFS_BYTE);
  573.     if(res < 0)
  574.     {
  575.     goto exit;
  576.     }
  577.  
  578.     res = do_contig_read(
  579.     create_resp.ref, &creds, 0, (strip_size * 3), NULL);
  580.     if(res < 0)
  581.     {
  582.     goto exit;
  583.     }
  584.  
  585.     res = do_contig_read(
  586.     create_resp.ref, &creds, 0, (strip_size * 3), PVFS_BYTE);
  587.     if(res < 0)
  588.     {
  589.     goto exit;
  590.     }
  591.  
  592.     res = do_contig_read(
  593.     create_resp.ref, &creds, 0, half_strip + 2, NULL);
  594.     if(res < 0)
  595.     {
  596.     goto exit;
  597.     }
  598.  
  599.     res = do_contig_read(
  600.     create_resp.ref, &creds, 0, half_strip + 2, PVFS_BYTE);
  601.     if(res < 0)
  602.     {
  603.     goto exit;
  604.     }
  605.  
  606.     res = do_contig_read(
  607.     create_resp.ref, &creds, half_strip + 2, strip_size, NULL);
  608.     if(res < 0)
  609.     {
  610.     goto exit;
  611.     }
  612.  
  613.     res = do_contig_read(
  614.     create_resp.ref, &creds, half_strip + 2, strip_size, PVFS_BYTE);
  615.     if(res < 0)
  616.     {
  617.     goto exit;
  618.     }
  619.  
  620.     res = do_contig_read(
  621.     create_resp.ref, &creds, strip_size + 1, 3, NULL);
  622.     if(res < 0)
  623.     {
  624.     goto exit;
  625.     }
  626.  
  627.     res = do_contig_read(
  628.     create_resp.ref, &creds, strip_size + 1, 3, PVFS_BYTE);
  629.     if(res < 0)
  630.     {
  631.     goto exit;
  632.     }
  633.  
  634.     res = do_contig_read(
  635.     create_resp.ref, &creds, 0, 2, NULL);
  636.     if(res < 0)
  637.     {
  638.     goto exit;
  639.     }
  640.  
  641.     res = do_contig_read(
  642.     create_resp.ref, &creds, 0, 2, PVFS_BYTE);
  643.     if(res < 0)
  644.     {
  645.     goto exit;
  646.     }
  647.  
  648.     do_write(create_resp.ref, &creds, strip_size * 4, half_strip, cs);
  649.  
  650.     res = do_contig_read(
  651.     create_resp.ref, &creds,
  652.     (strip_size * 3 + half_strip), (strip_size + half_strip), NULL);
  653.     if(res < 0)
  654.     {
  655.     goto exit;
  656.     }
  657.  
  658.     res = do_contig_read(
  659.     create_resp.ref, &creds,
  660.     (strip_size * 3 + half_strip), (strip_size + half_strip), PVFS_BYTE);
  661.     if(res < 0)
  662.     {
  663.     goto exit;
  664.     }
  665.  
  666.     res = do_contig_read(
  667.     create_resp.ref, &creds,
  668.     0, (strip_size * 5), NULL);
  669.     if(res < 0)
  670.     {
  671.     goto exit;
  672.     }
  673.  
  674.     res = do_contig_read(
  675.     create_resp.ref, &creds,
  676.     0, (strip_size * 5), PVFS_BYTE);
  677.     if(res < 0)
  678.     {
  679.     goto exit;
  680.     }
  681.  
  682.     res = do_contig_read(
  683.     create_resp.ref, &creds, 
  684.     (strip_size + half_strip), (strip_size + half_strip), NULL);
  685.     if(res < 0)
  686.     {
  687.     goto exit;
  688.     }
  689.  
  690.     res = do_contig_read(
  691.     create_resp.ref, &creds, 
  692.     (strip_size + half_strip), (strip_size + half_strip), PVFS_BYTE);
  693.     if(res < 0)
  694.     {
  695.     goto exit;
  696.     }
  697.  
  698.     res = do_contig_read(
  699.     create_resp.ref, &creds,
  700.     0, (strip_size * 3), NULL);
  701.     if(res < 0)
  702.     {
  703.     goto exit;
  704.     }
  705.  
  706.     res = do_contig_read(
  707.     create_resp.ref, &creds,
  708.     0, (strip_size * 3), PVFS_BYTE);
  709.     if(res < 0)
  710.     {
  711.     goto exit;
  712.     }
  713.  
  714.     res = do_noncontig_read(
  715.     create_resp.ref, &creds,
  716.     2,
  717.     0, strip_size + half_strip,
  718.     strip_size * 4, half_strip);
  719.     if(res < 0)
  720.     {
  721.     goto exit;
  722.     }
  723.     
  724.     res = do_noncontig_read(
  725.     create_resp.ref, &creds,
  726.     2,
  727.     0, strip_size,
  728.     strip_size * 5, half_strip);
  729.     if(res < 0)
  730.     {
  731.     goto exit;
  732.     }
  733.  
  734.     res = do_noncontig_read(
  735.     create_resp.ref, &creds,
  736.     2,
  737.     0, strip_size,
  738.     strip_size * 3, half_strip);
  739.     if(res < 0)
  740.     {
  741.     goto exit;
  742.     }
  743.  
  744.     res = do_noncontig_read(
  745.     create_resp.ref, &creds,
  746.     2,
  747.     strip_size, strip_size,
  748.     strip_size * 4 + 2, strip_size);
  749.     if(res < 0)
  750.     {
  751.     goto exit;
  752.     }
  753.  
  754.     res = do_noncontig_read(
  755.     create_resp.ref, &creds,
  756.     9,
  757.     2, 2,
  758.     8, 2,
  759.     14, 2,
  760.     20, 2,
  761.     26, 2,
  762.     32, 2,
  763.     38, 2,
  764.     44, 2,
  765.     50, 2);
  766.     if(res < 0)
  767.     {
  768.     goto exit;
  769.     }
  770.  
  771.     res = do_smallmem_noncontig_read(
  772.     create_resp.ref, &creds,
  773.     strip_size,
  774.     4,
  775.     strip_size, half_strip,
  776.     strip_size * 2, half_strip,
  777.     strip_size * 3, half_strip,
  778.     strip_size * 4, half_strip);
  779.     if(res < 0)
  780.     {
  781.     goto exit;
  782.     }
  783.     
  784.     res = do_smallmem_noncontig_read(
  785.     create_resp.ref, &creds,
  786.     strip_size,
  787.     2,
  788.     strip_size, 2,
  789.     strip_size * 4, strip_size);
  790.     if(res < 0)
  791.     {
  792.     goto exit;
  793.     }
  794.     
  795.     PVFS_sys_remove(
  796.     zerofill_fname,
  797.     lookup_resp.ref,
  798.     &creds,
  799.         NULL);
  800.  
  801. exit:
  802.     
  803.     realres = res;
  804.     
  805.     res = PVFS_sys_finalize();
  806.     if(res < 0)
  807.     {
  808.     printf("finalizing sysint failed with errcode = %d\n", res);
  809.     realres = res;
  810.     }
  811.  
  812.     return realres;
  813. }
  814.  
  815.