Show
Ignore:
Timestamp:
06/18/10 20:02:50 (3 years ago)
Author:
nlmills
Message:

initial merge with Orange-Branch. much will be broken

Location:
branches/cu-security-branch
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/cu-security-branch

    • Property svn:ignore
      •  

        old new  
        33aclocal.m4 
        44autom4te.cache 
        5 config.status 
        6 Makefile 
        7 pvfs2-config.h 
        8 module.mk 
  • branches/cu-security-branch/test/io/description/test-zero-fill.c

    r8330 r8397  
    66#include <time.h> 
    77#include <unistd.h> 
    8 #include <assert.h> 
    9  
    108#include "pvfs2-request.h" 
    119#include "pvfs2-sysint.h" 
     
    2826 
    2927int do_smallmem_noncontig_read( 
    30     PVFS_object_ref ref, PVFS_credential * cred, 
     28    PVFS_object_ref ref, PVFS_credentials * creds, 
    3129    int memsize, 
    3230    int chunks, 
     
    3432 
    3533int do_noncontig_read( 
    36     PVFS_object_ref ref, PVFS_credential * cred,  
     34    PVFS_object_ref ref, PVFS_credentials * creds,  
    3735    int chunks,  
    3836    ...); 
     
    4038int do_contig_read( 
    4139    PVFS_object_ref ref,  
    42     PVFS_credential * cred,  
     40    PVFS_credentials * creds,  
    4341    PVFS_offset offset,  
    4442    int length, 
    4543    PVFS_Request freq); 
    4644 
    47 int do_write(PVFS_object_ref ref, PVFS_credential * cred, 
     45int do_write(PVFS_object_ref ref, PVFS_credentials * creds, 
    4846             PVFS_offset offset, PVFS_size size, char * buff); 
    4947 
     
    159157 
    160158int do_smallmem_noncontig_read( 
    161     PVFS_object_ref ref, PVFS_credential * cred, 
     159    PVFS_object_ref ref, PVFS_credentials * creds, 
    162160    int memsize, 
    163161    int chunks, 
     
    212210 
    213211    res = PVFS_sys_read( 
    214         ref, readreq, 0, buff, memreq, cred, &io_resp); 
     212        ref, readreq, 0, buff, memreq, creds, &io_resp, NULL); 
    215213    if(res < 0) 
    216214    { 
     
    234232 
    235233int do_noncontig_read( 
    236     PVFS_object_ref ref, PVFS_credential * cred,  
     234    PVFS_object_ref ref, PVFS_credentials * creds,  
    237235    int chunks,  
    238236    ...) 
     
    287285 
    288286    res = PVFS_sys_read( 
    289         ref, readreq, 0, buff, memreq, cred, &io_resp); 
     287        ref, readreq, 0, buff, memreq, creds, &io_resp, NULL); 
    290288    if(res < 0) 
    291289    { 
     
    309307int do_contig_read( 
    310308    PVFS_object_ref ref,  
    311     PVFS_credential * cred,  
     309    PVFS_credentials * creds,  
    312310    PVFS_offset offset,  
    313311    int length, 
     
    351349 
    352350    res = PVFS_sys_read( 
    353         ref, readreq, offset, buff, memreq, cred, &io_resp); 
     351        ref, readreq, offset, buff, memreq, creds, &io_resp, NULL); 
    354352    if(res < 0) 
    355353    { 
     
    369367} 
    370368 
    371 int do_write(PVFS_object_ref ref, PVFS_credential * cred, 
     369int do_write(PVFS_object_ref ref, PVFS_credentials * creds, 
    372370             PVFS_offset offset, PVFS_size size, char * buff) 
    373371{ 
     
    405403    res = PVFS_sys_write( 
    406404        ref, filereq,  
    407         offset, buff, memreq, cred, &io_resp); 
     405        offset, buff, memreq, creds, &io_resp, NULL); 
    408406    if(res < 0) 
    409407    { 
     
    435433    PVFS_fs_id curfs; 
    436434    PVFS_sys_attr attr; 
    437     PVFS_credential *cred; 
     435    PVFS_credentials creds; 
    438436    PVFS_sys_dist * dist; 
    439437    int strip_size = 9; 
     
    504502                before_len, dashes, after_len, dashes); 
    505503    } 
    506      
    507     cred = PVFS_util_gen_fake_credential(); 
    508     assert(cred); 
    509  
    510     res = PVFS_sys_lookup(curfs, "/", cred, &lookup_resp, 0); 
     504 
     505    res = PVFS_sys_lookup(curfs, "/", &creds, &lookup_resp, 0, NULL); 
    511506    if(res < 0) 
    512507    { 
     
    523518    } 
    524519 
     520    PVFS_util_gen_credentials(&creds); 
     521 
    525522    attr.mask = PVFS_ATTR_SYS_ALL_SETABLE; 
    526     attr.owner = cred->userid; 
    527     attr.group = cred->group_array[0]; 
     523    attr.owner = creds.uid; 
     524    attr.group = creds.gid; 
    528525    attr.perms = 1877; 
    529526    attr.atime = attr.ctime = attr.mtime = time(NULL); 
     
    537534 
    538535    res = PVFS_sys_create( 
    539         zerofill_fname, lookup_resp.ref, attr, cred, dist, NULL, &create_resp); 
     536        zerofill_fname, lookup_resp.ref, attr, &creds, dist, &create_resp, NULL, NULL); 
    540537    if(res < 0) 
    541538    { 
     
    546543    half_strip = strip_size / 2; 
    547544 
    548     do_write(create_resp.ref, cred, 0, half_strip, as); 
    549  
    550     do_write(create_resp.ref, cred, strip_size * 2, half_strip, bs); 
    551  
    552     res = do_contig_read( 
    553         create_resp.ref, cred, 0, strip_size + half_strip, NULL); 
     545    do_write(create_resp.ref, &creds, 0, half_strip, as); 
     546 
     547    do_write(create_resp.ref, &creds, strip_size * 2, half_strip, bs); 
     548 
     549    res = do_contig_read( 
     550        create_resp.ref, &creds, 0, strip_size + half_strip, NULL); 
    554551    if(res < 0) 
    555552    { 
     
    558555         
    559556    res = do_contig_read( 
    560         create_resp.ref, cred, 0, strip_size + half_strip, PVFS_BYTE); 
    561     if(res < 0) 
    562     { 
    563         goto exit; 
    564     } 
    565  
    566     res = do_contig_read( 
    567         create_resp.ref, cred,  
     557        create_resp.ref, &creds, 0, strip_size + half_strip, PVFS_BYTE); 
     558    if(res < 0) 
     559    { 
     560        goto exit; 
     561    } 
     562 
     563    res = do_contig_read( 
     564        create_resp.ref, &creds,  
    568565        (strip_size + half_strip), (strip_size + half_strip), NULL); 
    569566    if(res < 0) 
     
    573570 
    574571    res = do_contig_read( 
    575         create_resp.ref, cred,  
     572        create_resp.ref, &creds,  
    576573        (strip_size + half_strip), (strip_size + half_strip), PVFS_BYTE); 
    577574    if(res < 0) 
     
    581578 
    582579    res = do_contig_read( 
    583         create_resp.ref, cred, 0, (strip_size * 3), NULL); 
    584     if(res < 0) 
    585     { 
    586         goto exit; 
    587     } 
    588  
    589     res = do_contig_read( 
    590         create_resp.ref, cred, 0, (strip_size * 3), PVFS_BYTE); 
    591     if(res < 0) 
    592     { 
    593         goto exit; 
    594     } 
    595  
    596     res = do_contig_read( 
    597         create_resp.ref, cred, 0, half_strip + 2, NULL); 
    598     if(res < 0) 
    599     { 
    600         goto exit; 
    601     } 
    602  
    603     res = do_contig_read( 
    604         create_resp.ref, cred, 0, half_strip + 2, PVFS_BYTE); 
    605     if(res < 0) 
    606     { 
    607         goto exit; 
    608     } 
    609  
    610     res = do_contig_read( 
    611         create_resp.ref, cred, half_strip + 2, strip_size, NULL); 
    612     if(res < 0) 
    613     { 
    614         goto exit; 
    615     } 
    616  
    617     res = do_contig_read( 
    618         create_resp.ref, cred, half_strip + 2, strip_size, PVFS_BYTE); 
    619     if(res < 0) 
    620     { 
    621         goto exit; 
    622     } 
    623  
    624     res = do_contig_read( 
    625         create_resp.ref, cred, strip_size + 1, 3, NULL); 
    626     if(res < 0) 
    627     { 
    628         goto exit; 
    629     } 
    630  
    631     res = do_contig_read( 
    632         create_resp.ref, cred, strip_size + 1, 3, PVFS_BYTE); 
    633     if(res < 0) 
    634     { 
    635         goto exit; 
    636     } 
    637  
    638     res = do_contig_read( 
    639         create_resp.ref, cred, 0, 2, NULL); 
    640     if(res < 0) 
    641     { 
    642         goto exit; 
    643     } 
    644  
    645     res = do_contig_read( 
    646         create_resp.ref, cred, 0, 2, PVFS_BYTE); 
    647     if(res < 0) 
    648     { 
    649         goto exit; 
    650     } 
    651  
    652     do_write(create_resp.ref, cred, strip_size * 4, half_strip, cs); 
    653  
    654     res = do_contig_read( 
    655         create_resp.ref, cred, 
     580        create_resp.ref, &creds, 0, (strip_size * 3), NULL); 
     581    if(res < 0) 
     582    { 
     583        goto exit; 
     584    } 
     585 
     586    res = do_contig_read( 
     587        create_resp.ref, &creds, 0, (strip_size * 3), PVFS_BYTE); 
     588    if(res < 0) 
     589    { 
     590        goto exit; 
     591    } 
     592 
     593    res = do_contig_read( 
     594        create_resp.ref, &creds, 0, half_strip + 2, NULL); 
     595    if(res < 0) 
     596    { 
     597        goto exit; 
     598    } 
     599 
     600    res = do_contig_read( 
     601        create_resp.ref, &creds, 0, half_strip + 2, PVFS_BYTE); 
     602    if(res < 0) 
     603    { 
     604        goto exit; 
     605    } 
     606 
     607    res = do_contig_read( 
     608        create_resp.ref, &creds, half_strip + 2, strip_size, NULL); 
     609    if(res < 0) 
     610    { 
     611        goto exit; 
     612    } 
     613 
     614    res = do_contig_read( 
     615        create_resp.ref, &creds, half_strip + 2, strip_size, PVFS_BYTE); 
     616    if(res < 0) 
     617    { 
     618        goto exit; 
     619    } 
     620 
     621    res = do_contig_read( 
     622        create_resp.ref, &creds, strip_size + 1, 3, NULL); 
     623    if(res < 0) 
     624    { 
     625        goto exit; 
     626    } 
     627 
     628    res = do_contig_read( 
     629        create_resp.ref, &creds, strip_size + 1, 3, PVFS_BYTE); 
     630    if(res < 0) 
     631    { 
     632        goto exit; 
     633    } 
     634 
     635    res = do_contig_read( 
     636        create_resp.ref, &creds, 0, 2, NULL); 
     637    if(res < 0) 
     638    { 
     639        goto exit; 
     640    } 
     641 
     642    res = do_contig_read( 
     643        create_resp.ref, &creds, 0, 2, PVFS_BYTE); 
     644    if(res < 0) 
     645    { 
     646        goto exit; 
     647    } 
     648 
     649    do_write(create_resp.ref, &creds, strip_size * 4, half_strip, cs); 
     650 
     651    res = do_contig_read( 
     652        create_resp.ref, &creds, 
    656653        (strip_size * 3 + half_strip), (strip_size + half_strip), NULL); 
    657654    if(res < 0) 
     
    661658 
    662659    res = do_contig_read( 
    663         create_resp.ref, cred, 
     660        create_resp.ref, &creds, 
    664661        (strip_size * 3 + half_strip), (strip_size + half_strip), PVFS_BYTE); 
    665662    if(res < 0) 
     
    669666 
    670667    res = do_contig_read( 
    671         create_resp.ref, cred, 
     668        create_resp.ref, &creds, 
    672669        0, (strip_size * 5), NULL); 
    673670    if(res < 0) 
     
    677674 
    678675    res = do_contig_read( 
    679         create_resp.ref, cred, 
     676        create_resp.ref, &creds, 
    680677        0, (strip_size * 5), PVFS_BYTE); 
    681678    if(res < 0) 
     
    685682 
    686683    res = do_contig_read( 
    687         create_resp.ref, cred,  
     684        create_resp.ref, &creds,  
    688685        (strip_size + half_strip), (strip_size + half_strip), NULL); 
    689686    if(res < 0) 
     
    693690 
    694691    res = do_contig_read( 
    695         create_resp.ref, cred,  
     692        create_resp.ref, &creds,  
    696693        (strip_size + half_strip), (strip_size + half_strip), PVFS_BYTE); 
    697694    if(res < 0) 
     
    701698 
    702699    res = do_contig_read( 
    703         create_resp.ref, cred, 
     700        create_resp.ref, &creds, 
    704701        0, (strip_size * 3), NULL); 
    705702    if(res < 0) 
     
    709706 
    710707    res = do_contig_read( 
    711         create_resp.ref, cred, 
     708        create_resp.ref, &creds, 
    712709        0, (strip_size * 3), PVFS_BYTE); 
    713710    if(res < 0) 
     
    717714 
    718715    res = do_noncontig_read( 
    719         create_resp.ref, cred, 
     716        create_resp.ref, &creds, 
    720717        2, 
    721718        0, strip_size + half_strip, 
     
    727724     
    728725    res = do_noncontig_read( 
    729         create_resp.ref, cred, 
     726        create_resp.ref, &creds, 
    730727        2, 
    731728        0, strip_size, 
     
    737734 
    738735    res = do_noncontig_read( 
    739         create_resp.ref, cred, 
     736        create_resp.ref, &creds, 
    740737        2, 
    741738        0, strip_size, 
     
    747744 
    748745    res = do_noncontig_read( 
    749         create_resp.ref, cred, 
     746        create_resp.ref, &creds, 
    750747        2, 
    751748        strip_size, strip_size, 
     
    757754 
    758755    res = do_noncontig_read( 
    759         create_resp.ref, cred, 
     756        create_resp.ref, &creds, 
    760757        9, 
    761758        2, 2, 
     
    774771 
    775772    res = do_smallmem_noncontig_read( 
    776         create_resp.ref, cred, 
     773        create_resp.ref, &creds, 
    777774        strip_size, 
    778775        4, 
     
    787784     
    788785    res = do_smallmem_noncontig_read( 
    789         create_resp.ref, cred, 
     786        create_resp.ref, &creds, 
    790787        strip_size, 
    791788        2, 
     
    800797        zerofill_fname, 
    801798        lookup_resp.ref, 
    802         cred); 
     799        &creds, 
     800        NULL); 
    803801 
    804802exit: