- Timestamp:
- 06/18/10 20:02:50 (3 years ago)
- Location:
- branches/cu-security-branch
- Files:
-
- 2 modified
-
. (modified) (1 prop)
-
test/io/description/test-zero-fill.c (modified) (35 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cu-security-branch
- Property svn:ignore
-
old new 3 3 aclocal.m4 4 4 autom4te.cache 5 config.status6 Makefile7 pvfs2-config.h8 module.mk
-
- Property svn:ignore
-
branches/cu-security-branch/test/io/description/test-zero-fill.c
r8330 r8397 6 6 #include <time.h> 7 7 #include <unistd.h> 8 #include <assert.h>9 10 8 #include "pvfs2-request.h" 11 9 #include "pvfs2-sysint.h" … … 28 26 29 27 int do_smallmem_noncontig_read( 30 PVFS_object_ref ref, PVFS_credential * cred,28 PVFS_object_ref ref, PVFS_credentials * creds, 31 29 int memsize, 32 30 int chunks, … … 34 32 35 33 int do_noncontig_read( 36 PVFS_object_ref ref, PVFS_credential * cred,34 PVFS_object_ref ref, PVFS_credentials * creds, 37 35 int chunks, 38 36 ...); … … 40 38 int do_contig_read( 41 39 PVFS_object_ref ref, 42 PVFS_credential * cred,40 PVFS_credentials * creds, 43 41 PVFS_offset offset, 44 42 int length, 45 43 PVFS_Request freq); 46 44 47 int do_write(PVFS_object_ref ref, PVFS_credential * cred,45 int do_write(PVFS_object_ref ref, PVFS_credentials * creds, 48 46 PVFS_offset offset, PVFS_size size, char * buff); 49 47 … … 159 157 160 158 int do_smallmem_noncontig_read( 161 PVFS_object_ref ref, PVFS_credential * cred,159 PVFS_object_ref ref, PVFS_credentials * creds, 162 160 int memsize, 163 161 int chunks, … … 212 210 213 211 res = PVFS_sys_read( 214 ref, readreq, 0, buff, memreq, cred , &io_resp);212 ref, readreq, 0, buff, memreq, creds, &io_resp, NULL); 215 213 if(res < 0) 216 214 { … … 234 232 235 233 int do_noncontig_read( 236 PVFS_object_ref ref, PVFS_credential * cred,234 PVFS_object_ref ref, PVFS_credentials * creds, 237 235 int chunks, 238 236 ...) … … 287 285 288 286 res = PVFS_sys_read( 289 ref, readreq, 0, buff, memreq, cred , &io_resp);287 ref, readreq, 0, buff, memreq, creds, &io_resp, NULL); 290 288 if(res < 0) 291 289 { … … 309 307 int do_contig_read( 310 308 PVFS_object_ref ref, 311 PVFS_credential * cred,309 PVFS_credentials * creds, 312 310 PVFS_offset offset, 313 311 int length, … … 351 349 352 350 res = PVFS_sys_read( 353 ref, readreq, offset, buff, memreq, cred , &io_resp);351 ref, readreq, offset, buff, memreq, creds, &io_resp, NULL); 354 352 if(res < 0) 355 353 { … … 369 367 } 370 368 371 int do_write(PVFS_object_ref ref, PVFS_credential * cred,369 int do_write(PVFS_object_ref ref, PVFS_credentials * creds, 372 370 PVFS_offset offset, PVFS_size size, char * buff) 373 371 { … … 405 403 res = PVFS_sys_write( 406 404 ref, filereq, 407 offset, buff, memreq, cred , &io_resp);405 offset, buff, memreq, creds, &io_resp, NULL); 408 406 if(res < 0) 409 407 { … … 435 433 PVFS_fs_id curfs; 436 434 PVFS_sys_attr attr; 437 PVFS_credential *cred;435 PVFS_credentials creds; 438 436 PVFS_sys_dist * dist; 439 437 int strip_size = 9; … … 504 502 before_len, dashes, after_len, dashes); 505 503 } 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); 511 506 if(res < 0) 512 507 { … … 523 518 } 524 519 520 PVFS_util_gen_credentials(&creds); 521 525 522 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; 528 525 attr.perms = 1877; 529 526 attr.atime = attr.ctime = attr.mtime = time(NULL); … … 537 534 538 535 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); 540 537 if(res < 0) 541 538 { … … 546 543 half_strip = strip_size / 2; 547 544 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); 554 551 if(res < 0) 555 552 { … … 558 555 559 556 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, 568 565 (strip_size + half_strip), (strip_size + half_strip), NULL); 569 566 if(res < 0) … … 573 570 574 571 res = do_contig_read( 575 create_resp.ref, cred,572 create_resp.ref, &creds, 576 573 (strip_size + half_strip), (strip_size + half_strip), PVFS_BYTE); 577 574 if(res < 0) … … 581 578 582 579 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, 656 653 (strip_size * 3 + half_strip), (strip_size + half_strip), NULL); 657 654 if(res < 0) … … 661 658 662 659 res = do_contig_read( 663 create_resp.ref, cred,660 create_resp.ref, &creds, 664 661 (strip_size * 3 + half_strip), (strip_size + half_strip), PVFS_BYTE); 665 662 if(res < 0) … … 669 666 670 667 res = do_contig_read( 671 create_resp.ref, cred,668 create_resp.ref, &creds, 672 669 0, (strip_size * 5), NULL); 673 670 if(res < 0) … … 677 674 678 675 res = do_contig_read( 679 create_resp.ref, cred,676 create_resp.ref, &creds, 680 677 0, (strip_size * 5), PVFS_BYTE); 681 678 if(res < 0) … … 685 682 686 683 res = do_contig_read( 687 create_resp.ref, cred,684 create_resp.ref, &creds, 688 685 (strip_size + half_strip), (strip_size + half_strip), NULL); 689 686 if(res < 0) … … 693 690 694 691 res = do_contig_read( 695 create_resp.ref, cred,692 create_resp.ref, &creds, 696 693 (strip_size + half_strip), (strip_size + half_strip), PVFS_BYTE); 697 694 if(res < 0) … … 701 698 702 699 res = do_contig_read( 703 create_resp.ref, cred,700 create_resp.ref, &creds, 704 701 0, (strip_size * 3), NULL); 705 702 if(res < 0) … … 709 706 710 707 res = do_contig_read( 711 create_resp.ref, cred,708 create_resp.ref, &creds, 712 709 0, (strip_size * 3), PVFS_BYTE); 713 710 if(res < 0) … … 717 714 718 715 res = do_noncontig_read( 719 create_resp.ref, cred,716 create_resp.ref, &creds, 720 717 2, 721 718 0, strip_size + half_strip, … … 727 724 728 725 res = do_noncontig_read( 729 create_resp.ref, cred,726 create_resp.ref, &creds, 730 727 2, 731 728 0, strip_size, … … 737 734 738 735 res = do_noncontig_read( 739 create_resp.ref, cred,736 create_resp.ref, &creds, 740 737 2, 741 738 0, strip_size, … … 747 744 748 745 res = do_noncontig_read( 749 create_resp.ref, cred,746 create_resp.ref, &creds, 750 747 2, 751 748 strip_size, strip_size, … … 757 754 758 755 res = do_noncontig_read( 759 create_resp.ref, cred,756 create_resp.ref, &creds, 760 757 9, 761 758 2, 2, … … 774 771 775 772 res = do_smallmem_noncontig_read( 776 create_resp.ref, cred,773 create_resp.ref, &creds, 777 774 strip_size, 778 775 4, … … 787 784 788 785 res = do_smallmem_noncontig_read( 789 create_resp.ref, cred,786 create_resp.ref, &creds, 790 787 strip_size, 791 788 2, … … 800 797 zerofill_fname, 801 798 lookup_resp.ref, 802 cred); 799 &creds, 800 NULL); 803 801 804 802 exit:
