Changeset 8899
- Timestamp:
- 06/28/11 12:18:43 (23 months ago)
- Location:
- branches/Orange-Branch
- Files:
-
- 15 modified
-
include/pvfs2-mgmt.h (modified) (1 diff)
-
src/apps/admin/pvfs2-perf-mon-snmp.c (modified) (3 diffs)
-
src/client/usrint/Makefile (modified) (2 diffs)
-
src/client/usrint/iocommon.c (modified) (46 diffs)
-
src/client/usrint/iocommon.h (modified) (1 diff)
-
src/client/usrint/openfile-util.c (modified) (22 diffs)
-
src/client/usrint/openfile-util.h (modified) (2 diffs)
-
src/client/usrint/posix-pvfs.c (modified) (29 diffs)
-
src/client/usrint/posix.c (modified) (8 diffs)
-
src/client/usrint/stdio.c (modified) (6 diffs)
-
src/client/usrint/usrint.h (modified) (1 diff)
-
src/common/misc/pint-perf-counter.c (modified) (4 diffs)
-
src/io/flow/flowproto-bmi-trove/flowproto-multiqueue.c (modified) (2 diffs)
-
src/io/trove/trove-mgmt.c (modified) (1 diff)
-
src/server/small-io.sm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Branch/include/pvfs2-mgmt.h
r8891 r8899 68 68 PINT_PERF_REQSCHED = 6, /* instantaneous active requests */ 69 69 PINT_PERF_REQUESTS = 7, /* requests received */ 70 PINT_PERF_SMALL_READ = 8, /* bytes read by small_io */ 71 PINT_PERF_SMALL_WRITE = 9, /* bytes written by small_io */ 72 PINT_PERF_FLOW_READ = 10, /* bytes read by flow */ 73 PINT_PERF_FLOW_WRITE = 11, /* bytes written by flow */ 70 74 }; 71 75 -
branches/Orange-Branch/src/apps/admin/pvfs2-perf-mon-snmp.c
r8891 r8899 34 34 #define OID_REQSCHED ".1.3.6.1.4.1.7778.6" 35 35 #define OID_REQUESTS ".1.3.6.1.4.1.7778.7" 36 #define OID_SMALL_READ ".1.3.6.1.4.1.7778.8" 37 #define OID_SMALL_WRITE ".1.3.6.1.4.1.7778.9" 38 #define OID_FLOW_READ ".1.3.6.1.4.1.7778.10" 39 #define OID_FLOW_WRITE ".1.3.6.1.4.1.7778.11" 36 40 37 41 #define INT_TYPE "INTEGER" … … 61 65 {OID_REQSCHED, INT_TYPE, PINT_PERF_REQSCHED, "Requests Active"}, 62 66 {OID_REQUESTS, CNT_TYPE, PINT_PERF_REQUESTS, "Requests Received"}, 67 {OID_SMALL_READ, CNT_TYPE, PINT_PERF_SMALL_READ, "Bytes Read by Small_IO"}, 68 {OID_SMALL_WRITE, CNT_TYPE, PINT_PERF_SMALL_WRITE, "Bytes Written by Small_IO"}, 69 {OID_FLOW_READ, CNT_TYPE, PINT_PERF_FLOW_READ, "Bytes Read by Flow"}, 70 {OID_FLOW_WRITE, CNT_TYPE, PINT_PERF_FLOW_WRITE, "Bytes Written by Flow"}, 63 71 {NULL, NULL, -1, NULL} /* this halts the key count */ 64 72 }; … … 293 301 strcmp(cmd_buffer, key_table[k].key_oid); k++); 294 302 /* out of for loop k equals selected key */ 295 if (k < =max_keys)303 if (k < max_keys) 296 304 { 297 305 returnType = key_table[k].key_type; -
branches/Orange-Branch/src/client/usrint/Makefile
r8890 r8899 4 4 LIBDIR= 5 5 6 CFLAGS= $(INCDIR) $(LIBDIR)6 CFLAGS=-g -O0 $(INCDIR) $(LIBDIR) 7 7 8 8 OBJS=iocommon.o openfile-util.o posix-pvfs.o posix.o stdio.o request.o … … 12 12 all: $(OBJS) 13 13 14 clean: 14 clean:: 15 15 rm *.o 16 16 -
branches/Orange-Branch/src/client/usrint/iocommon.c
r8890 r8899 16 16 #include <iocommon.h> 17 17 18 int init=0;19 20 /* Perform PVFS initialization if not already finished */21 void iocommon_ensure_init()22 {23 24 /* Initialize the file system with mount points */25 int ret;26 if (!init)27 {28 ret = PVFS_util_init_defaults();29 assert(ret==PVFS_FD_SUCCESS);30 init=1;31 }32 33 }34 18 35 19 void iocommon_cred(PVFS_credentials **credentials) … … 52 36 { 53 37 PVFS_credentials *credentials; 38 39 pvfs_sys_init(); 54 40 iocommon_cred(&credentials); 55 41 return PVFS_sys_flush(pd->pvfs_ref, credentials, PVFS_HINT_NULL); … … 71 57 memset(&resp_lookup, 0, sizeof(resp_lookup)); 72 58 59 pvfs_sys_init(); 60 iocommon_cred(&credentials); 61 73 62 /* Determine the fs_id and pvfs_path */ 74 63 rc = PVFS_util_resolve(abs_path, &lookup_fs_id, pvfs_path, 256); 75 if (rc == -1)64 if (rc < 0) 76 65 { 77 66 return -1; 78 67 } 79 68 80 iocommon_cred(&credentials);81 69 rc = PVFS_sys_lookup(lookup_fs_id, pvfs_path, 82 70 credentials, &resp_lookup, … … 100 88 101 89 /* Initialize any variables */ 90 pvfs_sys_init(); 102 91 memset(&resp_lookup, 0, sizeof(resp_lookup)); 103 92 … … 135 124 136 125 /* Initialize */ 126 pvfs_sys_init(); 137 127 memset(&attr, 0, sizeof(attr)); 138 128 memset(&resp_create, 0, sizeof(resp_create)); … … 155 145 #endif 156 146 157 attr.owner = get uid();158 attr.group = get gid();147 attr.owner = geteuid(); 148 attr.group = getegid(); 159 149 attr.atime = time(NULL); 160 150 attr.mtime = attr.atime; … … 260 250 memset(&attributes_resp, 0, sizeof(attributes_resp)); 261 251 252 pvfs_sys_init(); 253 iocommon_cred(&credentials); 254 262 255 /* Split the path into a directory and file */ 263 rc = split_pathname(pathname, &directory, &filename);264 if (rc == -1)256 rc = split_pathname(pathname, 0, &directory, &filename); 257 if (rc < 0) 265 258 { 266 259 goto errorout; … … 281 274 { 282 275 rc = iocommon_lookup_absolute(directory, &parent_ref); 283 if (rc == -1)276 if (rc < 0) 284 277 { 285 278 goto errorout; … … 294 287 follow_link, 295 288 &parent_ref); 296 if (rc == -1)289 if (rc < 0) 297 290 { 298 291 goto errorout; … … 335 328 /* create failed, the file must have been */ 336 329 /* created by a different process, so just open it */ 337 if (rc != -1)330 if (rc < 0) 338 331 { 339 332 /* get existing handle */ … … 342 335 follow_link, 343 336 &file_ref); 344 if (rc == -1)337 if (rc < 0) 345 338 { 346 339 /* not sure what is wrong */ … … 360 353 361 354 /* Get the file's type information from its attributes */ 362 PVFS_sys_getattr(pd->pvfs_ref, PVFS_ATTR_SYS_ALL_NOHINT, 363 credentials, &attributes_resp, NULL); 355 rc = PVFS_sys_getattr(pd->pvfs_ref, 356 PVFS_ATTR_SYS_ALL_NOHINT, 357 credentials, 358 &attributes_resp, 359 NULL); 360 if (rc < 0) 361 { 362 goto errorout; 363 } 364 364 pd->mode = attributes_resp.attr.perms; /* this may change */ 365 365 if (attributes_resp.attr.objtype & PVFS_TYPE_METAFILE) … … 379 379 if (flag & O_TRUNC) 380 380 { 381 PVFS_credentials *credentials; 382 iocommon_cred(&credentials); 383 PVFS_sys_truncate(file_ref, 0, credentials, NULL); 381 rc = PVFS_sys_truncate(file_ref, 0, credentials, NULL); 382 if (rc < 0) 383 { 384 goto errorout; 385 } 384 386 } 385 387 … … 387 389 if (flag & O_APPEND) 388 390 { 389 iocommon_lseek(pd, 0, 0, SEEK_END);391 rc = iocommon_lseek(pd, 0, 0, SEEK_END); 390 392 } 391 393 … … 401 403 free(filename); 402 404 } 403 if (rc == -1)405 if (rc < 0) 404 406 { 405 407 return NULL; … … 409 411 return pd; 410 412 } 413 } 414 415 /** 416 * Implementation of truncate via PVFS 417 * 418 */ 419 int iocommon_truncate(PVFS_object_ref file_ref, off64_t length) 420 { 421 PVFS_credentials *credentials; 422 423 pvfs_sys_init(); 424 iocommon_cred(&credentials); 425 return PVFS_sys_truncate(file_ref, length, credentials, NULL); 411 426 } 412 427 … … 451 466 { 452 467 /* Get the file's size in bytes as the ending offset */ 453 rc = PVFS_sys_getattr(pd->pvfs_ref, PVFS_ATTR_SYS_SIZE, 454 credentials, &attributes_resp, NULL); 468 rc = PVFS_sys_getattr(pd->pvfs_ref, 469 PVFS_ATTR_SYS_SIZE, 470 credentials, 471 &attributes_resp, 472 NULL); 455 473 if(rc) 456 474 { … … 481 499 &readdir_resp, 482 500 NULL); 483 if(rc == -1)501 if(rc < 0) 484 502 { 485 503 return -1; … … 492 510 } 493 511 494 /* 495 * pvfs_unlink implementation496 * need to verify this is a file or symlink497 * use rmdir for directory512 /** 513 * implements unlink and rmdir 514 * 515 * dirflag indicates trying to remove a dir (rmdir) 498 516 */ 499 517 int iocommon_remove (const char *pathname, … … 514 532 515 533 /* Initialize the system interface for this process */ 516 iocommon_ensure_init();534 pvfs_sys_init(); 517 535 iocommon_cred(&credentials); 518 536 519 rc = split_pathname(pathname, &parentdir, &file);520 if (rc == -1)537 rc = split_pathname(pathname, dirflag, &parentdir, &file); 538 if (rc < 0) 521 539 { 522 540 return -1; … … 526 544 { 527 545 rc = iocommon_lookup_absolute(parentdir, &parent_ref); 528 if (rc == -1)546 if (rc < 0) 529 547 { 530 548 goto errorout; … … 533 551 else 534 552 { 535 if ( !parentdir)553 if (parentdir) 536 554 { 537 555 rc = iocommon_lookup_relative(parentdir, *pdir, 538 556 PVFS2_LOOKUP_LINK_FOLLOW, &parent_ref); 539 if (rc == -1)557 if (rc < 0) 540 558 { 541 559 goto errorout; … … 552 570 rc = iocommon_lookup_relative(file, parent_ref, 553 571 PVFS2_LOOKUP_LINK_NO_FOLLOW, &file_ref); 554 if (rc == -1)572 if (rc < 0) 555 573 { 556 574 goto errorout; 557 575 } 558 576 rc = iocommon_getattr(file_ref, &attr); 559 if (rc == -1)577 if (rc < 0) 560 578 { 561 579 goto errorout; 562 580 } 563 if ((attr.objtype & PVFS_TYPE_DIRECTORY) && dirflag)581 if ((attr.objtype & PVFS_TYPE_DIRECTORY) && !dirflag) 564 582 { 565 583 errno = EISDIR; 566 584 goto errorout; 567 585 } 568 else if (!(attr.objtype & PVFS_TYPE_DIRECTORY) && !dirflag)586 else if (!(attr.objtype & PVFS_TYPE_DIRECTORY) && dirflag) 569 587 { 570 588 errno = ENOTDIR; … … 572 590 } 573 591 592 /* should check to see if any process has file open */ 574 593 rc = PVFS_sys_remove(file, parent_ref, credentials, PVFS_HINT_NULL); 575 594 … … 583 602 free(file); 584 603 } 585 if (rc == -1)604 if (rc < 0) 586 605 { 587 606 return -1; … … 593 612 } 594 613 614 /** 615 * wrapper for unlink 616 */ 595 617 int iocommon_unlink(const char *pathname, 596 618 PVFS_object_ref *pdir) 597 619 { 598 return iocommon_remove(pathname, pdir, 1); 599 } 600 620 return iocommon_remove(pathname, pdir, 0); 621 } 622 623 /** 624 * wrapper for rmdir 625 */ 601 626 int iocommon_rmdir(const char *pathname, 602 627 PVFS_object_ref *pdir) 603 628 { 604 return iocommon_remove(pathname, pdir, 0);629 return iocommon_remove(pathname, pdir, 1); 605 630 } 606 631 … … 620 645 621 646 iocommon_cred(&creds); 622 rc = split_pathname(oldpath, &olddir, &oldname);623 if (rc == -1)647 rc = split_pathname(oldpath, 0, &olddir, &oldname); 648 if (rc < 0) 624 649 { 625 650 return -1; 626 651 } 627 if (!old dir)652 if (!oldpdir) 628 653 { 629 654 rc = iocommon_lookup_absolute(olddir, &oldref); 630 if (rc == -1)655 if (rc < 0) 631 656 { 632 657 goto errorout; … … 635 660 else 636 661 { 637 if ( !olddir)662 if (olddir) 638 663 { 639 664 rc = iocommon_lookup_relative(olddir, *oldpdir, 640 665 PVFS2_LOOKUP_LINK_FOLLOW, &oldref); 641 if (rc == -1)666 if (rc < 0) 642 667 { 643 668 goto errorout; … … 649 674 } 650 675 } 651 rc = split_pathname(newpath, &olddir, &oldname);652 if (rc == -1)676 rc = split_pathname(newpath, 0, &newdir, &newname); 677 if (rc < 0) 653 678 { 654 679 goto errorout; … … 657 682 { 658 683 rc = iocommon_lookup_absolute(newdir, &newref); 659 if (rc == -1)684 if (rc < 0) 660 685 { 661 686 goto errorout; … … 664 689 else 665 690 { 666 if ( !olddir)691 if (newdir) 667 692 { 668 693 rc = iocommon_lookup_relative(newdir, *newpdir, 669 694 PVFS2_LOOKUP_LINK_FOLLOW, &newref); 670 if (rc == -1)695 if (rc < 0) 671 696 { 672 697 goto errorout; … … 847 872 } 848 873 849 /* WBL - question - should attr not be a pointer */850 874 int iocommon_setattr(PVFS_object_ref obj, PVFS_sys_attr *attr) 851 875 { … … 963 987 { 964 988 attr.owner = owner; 989 attr.mask |= PVFS_ATTR_SYS_UID; 965 990 } 966 991 if (owner != -1) 967 992 { 968 993 attr.group = group; 969 }970 attr.mask = PVFS_ATTR_SYS_UID | PVFS_ATTR_SYS_GID;994 attr.mask |= PVFS_ATTR_SYS_GID; 995 } 971 996 972 997 rc = iocommon_setattr(pd->pvfs_ref, &attr); … … 979 1004 int rc = 0; 980 1005 PVFS_sys_attr attr; 1006 1007 /* Initialize */ 1008 memset(&attr, 0, sizeof(attr)); 981 1009 982 1010 attr.perms = mode & 07777; /* mask off any stray bits */ … … 1007 1035 memset(&resp_mkdir, 0, sizeof(resp_mkdir)); 1008 1036 1037 pvfs_sys_init(); 1009 1038 iocommon_cred(&credentials); 1010 1039 1011 rc = split_pathname(pvfs_path, &parentdir, &filename);1012 if (rc == -1)1040 rc = split_pathname(pvfs_path, 1, &parentdir, &filename); 1041 if (rc < 0) 1013 1042 { 1014 1043 return -1; … … 1021 1050 { 1022 1051 rc = iocommon_lookup_absolute(parentdir, &parent_ref); 1023 if (rc == -1)1052 if (rc < 0) 1024 1053 { 1025 1054 goto errorout; … … 1028 1057 else 1029 1058 { 1030 if ( !parentdir)1059 if (parentdir) 1031 1060 { 1032 1061 rc = iocommon_lookup_relative(parentdir, *pdir, 1033 1062 PVFS2_LOOKUP_LINK_FOLLOW, &parent_ref); 1034 if (rc == -1)1063 if (rc < 0) 1035 1064 { 1036 1065 goto errorout; … … 1044 1073 1045 1074 /* Set the attributes for the new directory */ 1046 attr.owner = (int)getuid;1047 attr.group = (int)getgid;1048 attr.perms = mode ;1075 attr.owner = geteuid(); 1076 attr.group = getegid(); 1077 attr.perms = mode & 07777; /* mask off stray bits */ 1049 1078 attr.mask = (PVFS_ATTR_SYS_ALL_SETABLE); 1050 1079 … … 1108 1137 memset(&resp_symlink,0, sizeof(resp_symlink)); 1109 1138 1139 pvfs_sys_init(); 1110 1140 iocommon_cred(&credentials); 1111 1141 1112 1142 1113 rc = split_pathname(pvfs_path, &parentdir, &filename);1114 if (rc == -1)1143 rc = split_pathname(pvfs_path, 0, &parentdir, &filename); 1144 if (rc < 0) 1115 1145 { 1116 1146 return -1; … … 1123 1153 { 1124 1154 rc = iocommon_lookup_absolute(parentdir, &parent_ref); 1125 if (rc == -1)1155 if (rc < 0) 1126 1156 { 1127 1157 goto errorout; … … 1130 1160 else 1131 1161 { 1132 if ( !parentdir)1162 if (parentdir) 1133 1163 { 1134 1164 rc = iocommon_lookup_relative(parentdir, *pdir, 1135 1165 PVFS2_LOOKUP_LINK_FOLLOW, &parent_ref); 1136 if (rc == -1)1166 if (rc < 0) 1137 1167 { 1138 1168 goto errorout; … … 1206 1236 &readdir_resp, 1207 1237 NULL); 1208 if(rc == -1)1238 if(rc < 0) 1209 1239 { 1210 1240 return -1; 1211 1241 } 1212 1242 pd->token = readdir_resp.token; 1213 name_max = MIN(NAME_MAX, PVFS_NAME_MAX);1243 name_max = PVFS_util_min(NAME_MAX, PVFS_NAME_MAX); 1214 1244 while(readdir_resp.pvfs_dirent_outcount--) 1215 1245 { … … 1218 1248 dirp->d_off = pd->file_pointer; 1219 1249 dirp->d_reclen = sizeof(PVFS_dirent); 1220 mem ncpy(dirp->d_name, readdir_resp.dirent_array[i].d_name, name_max);1250 memcpy(dirp->d_name, readdir_resp.dirent_array[i].d_name, name_max); 1221 1251 dirp->d_name[name_max] = 0; 1222 1252 pd->file_pointer += sizeof(PVFS_dirent); … … 1278 1308 1279 1309 /* Initialize the system interface for this process */ 1280 iocommon_ensure_init();1310 pvfs_sys_init(); 1281 1311 iocommon_cred(&credentials); 1282 1312 1283 rc = split_pathname(pvfs_path, &parentdir, &file);1284 if (rc == -1)1313 rc = split_pathname(pvfs_path, 0, &parentdir, &file); 1314 if (rc < 0) 1285 1315 { 1286 1316 return -1; … … 1290 1320 { 1291 1321 rc = iocommon_lookup_absolute(parentdir, &parent_ref); 1292 if (rc == -1)1322 if (rc < 0) 1293 1323 { 1294 1324 goto errorout; … … 1297 1327 else 1298 1328 { 1299 if ( !parentdir)1329 if (parentdir) 1300 1330 { 1301 1331 rc = iocommon_lookup_relative(parentdir, *pdir, 1302 1332 PVFS2_LOOKUP_LINK_FOLLOW, &parent_ref); 1303 if (rc == -1)1333 if (rc < 0) 1304 1334 { 1305 1335 goto errorout; -
branches/Orange-Branch/src/client/usrint/iocommon.h
r8890 r8899 68 68 mode_t file_permission, 69 69 PVFS_object_ref *pdir); 70 71 int iocommon_truncate(PVFS_object_ref file_ref, off64_t length); 70 72 71 73 off64_t iocommon_lseek(pvfs_descriptor *pd, off64_t offset, PVFS_size unit_size, int whence); -
branches/Orange-Branch/src/client/usrint/openfile-util.c
r8890 r8899 14 14 #include <posix-ops.h> 15 15 #include <openfile-util.h> 16 17 static int pvfs_is_sys_initialized = 0;18 16 19 17 #define PREALLOC 3 … … 22 20 static int next_descriptor = 0; 23 21 static pvfs_descriptor **descriptor_table; 22 static char rstate[256]; /* used for random number generation */ 23 24 posix_ops glibc_ops; 24 25 25 26 pvfs_descriptor pvfs_stdin = … … 65 66 }; 66 67 68 void load_glibc(void) 69 { 70 glibc_ops.open = dlsym(RTLD_NEXT, "open"); 71 glibc_ops.open64 = dlsym(RTLD_NEXT, "open64"); 72 glibc_ops.openat = dlsym(RTLD_NEXT, "openat"); 73 glibc_ops.openat64 = dlsym(RTLD_NEXT, "openat64"); 74 glibc_ops.creat = dlsym(RTLD_NEXT, "creat"); 75 glibc_ops.creat64 = dlsym(RTLD_NEXT, "creat64"); 76 glibc_ops.unlink = dlsym(RTLD_NEXT, "unlink"); 77 glibc_ops.unlinkat = dlsym(RTLD_NEXT, "unlinkat"); 78 glibc_ops.rename = dlsym(RTLD_NEXT, "rename"); 79 glibc_ops.renameat = dlsym(RTLD_NEXT, "renameat"); 80 glibc_ops.read = dlsym(RTLD_NEXT, "read"); 81 glibc_ops.pread = dlsym(RTLD_NEXT, "pread"); 82 glibc_ops.readv = dlsym(RTLD_NEXT, "readv"); 83 glibc_ops.pread64 = dlsym(RTLD_NEXT, "pread64"); 84 glibc_ops.write = dlsym(RTLD_NEXT, "write"); 85 glibc_ops.pwrite = dlsym(RTLD_NEXT, "pwrite"); 86 glibc_ops.writev = dlsym(RTLD_NEXT, "writev"); 87 /* glibc_ops.write64 = dlsym(RTLD_NEXT, "write64"); */ 88 glibc_ops.lseek = dlsym(RTLD_NEXT, "lseek"); 89 glibc_ops.lseek64 = dlsym(RTLD_NEXT, "lseek64"); 90 glibc_ops.truncate = dlsym(RTLD_NEXT, "truncate"); 91 glibc_ops.truncate64 = dlsym(RTLD_NEXT, "truncate64"); 92 glibc_ops.ftruncate = dlsym(RTLD_NEXT, "ftruncate"); 93 glibc_ops.ftruncate64 = dlsym(RTLD_NEXT, "ftruncate64"); 94 glibc_ops.close = dlsym(RTLD_NEXT, "close"); 95 glibc_ops.flush = dlsym(RTLD_NEXT, "flush"); 96 glibc_ops.stat = dlsym(RTLD_NEXT, "stat"); 97 glibc_ops.stat64 = dlsym(RTLD_NEXT, "stat64"); 98 glibc_ops.fstat = dlsym(RTLD_NEXT, "fstat"); 99 glibc_ops.fstat64 = dlsym(RTLD_NEXT, "fstat64"); 100 glibc_ops.fstatat = dlsym(RTLD_NEXT, "fstatat"); 101 glibc_ops.fstatat64 = dlsym(RTLD_NEXT, "fstatat64"); 102 glibc_ops.lstat = dlsym(RTLD_NEXT, "lstat"); 103 glibc_ops.lstat64 = dlsym(RTLD_NEXT, "lstat64"); 104 glibc_ops.dup = dlsym(RTLD_NEXT, "dup"); 105 glibc_ops.dup2 = dlsym(RTLD_NEXT, "dup2"); 106 glibc_ops.chown = dlsym(RTLD_NEXT, "chown"); 107 glibc_ops.fchown = dlsym(RTLD_NEXT, "fchown"); 108 glibc_ops.fchownat = dlsym(RTLD_NEXT, "fchownat"); 109 glibc_ops.lchown = dlsym(RTLD_NEXT, "lchown"); 110 glibc_ops.chmod = dlsym(RTLD_NEXT, "chmod"); 111 glibc_ops.fchmod = dlsym(RTLD_NEXT, "fchmod"); 112 glibc_ops.fchmodat = dlsym(RTLD_NEXT, "fchmodat"); 113 glibc_ops.lchmod = dlsym(RTLD_NEXT, "lchmod"); 114 glibc_ops.mkdir = dlsym(RTLD_NEXT, "mkdir"); 115 glibc_ops.mkdirat = dlsym(RTLD_NEXT, "mkdirat"); 116 glibc_ops.rmdir = dlsym(RTLD_NEXT, "rmdir"); 117 glibc_ops.readlink = dlsym(RTLD_NEXT, "readlink"); 118 glibc_ops.readlinkat = dlsym(RTLD_NEXT, "readlinkat"); 119 glibc_ops.symlink = dlsym(RTLD_NEXT, "symlink"); 120 glibc_ops.symlinkat = dlsym(RTLD_NEXT, "symlinkat"); 121 glibc_ops.link = dlsym(RTLD_NEXT, "link"); 122 glibc_ops.linkat = dlsym(RTLD_NEXT, "linkat"); 123 glibc_ops.readdir = dlsym(RTLD_NEXT, "readdir"); 124 glibc_ops.getdents = dlsym(RTLD_NEXT, "getdents"); 125 glibc_ops.access = dlsym(RTLD_NEXT, "access"); 126 glibc_ops.faccessat = dlsym(RTLD_NEXT, "faccessat"); 127 glibc_ops.flock = dlsym(RTLD_NEXT, "flock"); 128 glibc_ops.fcntl = dlsym(RTLD_NEXT, "fcntl"); 129 glibc_ops.sync = dlsym(RTLD_NEXT, "sync"); 130 glibc_ops.fsync = dlsym(RTLD_NEXT, "fsync"); 131 glibc_ops.fdatasync = dlsym(RTLD_NEXT, "fdatasync"); 132 glibc_ops.umask = dlsym(RTLD_NEXT, "umask"); 133 glibc_ops.getumask = dlsym(RTLD_NEXT, "getumask"); 134 glibc_ops.getdtablesize = dlsym(RTLD_NEXT, "getdtablesize"); 135 } 67 136 68 137 /* … … 70 139 */ 71 140 72 int pvfs_sys_init() {141 void pvfs_sys_init(void) { 73 142 struct rlimit rl; 74 143 int rc; 75 76 /* initalize the file system */ 77 PVFS_util_init_defaults(); 144 static int pvfs_lib_init_flag = 0; 145 146 if (pvfs_lib_init_flag) 147 { 148 return; 149 } 150 pvfs_lib_init_flag = 1; /* should only run this once */ 151 152 /* this allows system calls to run */ 153 load_glibc(); 78 154 79 155 rc = getrlimit(RLIMIT_NOFILE, &rl); 80 156 /* need to check for "INFINITY" */ 81 157 158 /* set up descriptor table */ 82 159 descriptor_table_size = rl.rlim_max; 83 160 descriptor_table = … … 89 166 descriptor_table[1] = &pvfs_stdout; 90 167 descriptor_table[2] = &pvfs_stderr; 168 descriptor_table_count = PREALLOC; 91 169 next_descriptor = PREALLOC; 92 170 93 /* Mark the initialization complete */ 94 pvfs_is_sys_initialized = 1; 95 return PVFS_FD_SUCCESS; 171 /* initalize PVFS */ 172 PVFS_util_init_defaults(); 173 174 /* call other initialization routines */ 175 PINT_initrand(); 96 176 } 97 177 … … 100 180 return descriptor_table_size; 101 181 } 102 103 182 104 183 /* … … 109 188 { 110 189 int i; 190 if (fsops == NULL) 191 { 192 errno = EINVAL; 193 return NULL; 194 } 195 pvfs_sys_init(); 196 197 /* table should be initialized now - check for available slot */ 111 198 if (descriptor_table_count == (descriptor_table_size - PREALLOC)) 112 199 { 200 errno = ENOMEM; 113 201 return NULL; 114 202 } … … 116 204 /* find next empty slot in table */ 117 205 for (i = next_descriptor; descriptor_table[i]; 118 i = (i == descriptor_table_size - 1) ? PREALLOC : i ++);206 i = (i == descriptor_table_size - 1) ? PREALLOC : i + 1); 119 207 120 208 /* found a slot */ … … 124 212 return NULL; 125 213 } 126 next_descriptor = ((i == descriptor_table_size - 1) ? PREALLOC : i ++);214 next_descriptor = ((i == descriptor_table_size - 1) ? PREALLOC : i + 1); 127 215 descriptor_table_count++; 128 216 … … 140 228 descriptor_table[i]->is_in_use = PVFS_FS; 141 229 142 return descriptor_table[i];230 return descriptor_table[i]; 143 231 } 144 232 … … 148 236 int pvfs_dup_descriptor(int oldfd, int newfd) 149 237 { 238 if (oldfd < 0 || oldfd >= descriptor_table_size) 239 { 240 errno = EBADF; 241 return -1; 242 } 150 243 if (newfd == -1) 151 244 { … … 174 267 pvfs_descriptor *pvfs_find_descriptor(int fd) 175 268 { 269 if (fd < 0 || fd >= descriptor_table_size) 270 { 271 errno = EBADF; 272 return NULL; 273 } 176 274 return descriptor_table[fd]; 177 275 } … … 181 279 pvfs_descriptor *pd; 182 280 281 if (fd < 0 || fd >= descriptor_table_size) 282 { 283 errno = EBADF; 284 return -1; 285 } 183 286 pd = descriptor_table[fd]; 184 287 … … 187 290 188 291 /* keep up with used descriptors */ 189 descriptor_table_count ++;292 descriptor_table_count--; 190 293 191 294 /* check if last copy */ … … 251 354 } 252 355 253 /* 254 *Determines if a path is part of a PVFS Filesystem 356 /** 357 * Determines if a path is part of a PVFS Filesystem 358 * 359 * returns 1 if PVFS 0 otherwise 255 360 */ 256 361 … … 261 366 char *str; 262 367 368 pvfs_sys_init(); 369 memset(&file_system, 0, sizeof(file_system)); 370 /* add current working dir to front of relative path */ 371 /* and copy to temp string working area */ 263 372 if(path[0] != '/') 264 373 { … … 282 391 } 283 392 393 /* lop off the last segment of the path */ 284 394 int count; 285 395 for(count = strlen(str) -2; count > 0; count--) … … 296 406 if(file_system.f_type == PVFS_FS) 297 407 { 298 #ifdef DEBUG 299 printf("IS PVFS_PATH\n"); 300 #endif 301 return true; 302 } 303 else if(file_system.f_type == LINUX_FS) 304 { 305 #ifdef DEBUG 306 printf("IS NOT PVFS_PATH\n"); 307 #endif 308 return false; 408 return 1; 309 409 } 310 410 else 311 411 { 312 printf("NO A LINUX OR PVFS FILE SYSTEM!! (BAILING OUT!!!)\n");313 exit(1);412 /* not PVFS assume the kernel can handle it */ 413 return 0; 314 414 } 315 415 } … … 328 428 * If non-null is passed as the directory or filename, 329 429 * the field will be allocated and filled with the correct value 430 * 431 * A slash at the end of the path is interpreted as no filename 432 * and is an error. To parse the last dir in a path, remove this 433 * trailing slash. No filename with no directory is OK. 330 434 */ 331 435 int split_pathname( const char *path, 436 int dirflag, 332 437 char **directory, 333 438 char **filename) 334 439 { 335 int i ;440 int i, slashes = 0; 336 441 int length = strlen("pvfs2"); 337 442 … … 347 452 } 348 453 /* Split path into a directory and filename */ 349 length = strlen(path); 350 for (i = length - 1; i >= 0; --i) 454 length = strnlen(path, PVFS_NAME_MAX); 455 if (length == PVFS_NAME_MAX) 456 { 457 errno = ENAMETOOLONG; 458 return -1; 459 } 460 i = length - 1; 461 if (dirflag) 462 { 463 /* skip any trailing slashes */ 464 for(; i >= 0 && path[i] == '/'; i--) 465 { 466 slashes++; 467 } 468 } 469 for (; i >= 0; i--) 351 470 { 352 471 if (path[i] == '/') … … 367 486 /* found no '/' path is all filename */ 368 487 *directory = NULL; 369 i++;370 }488 } 489 i++; 371 490 /* copy the filename */ 372 *filename = malloc(length - i + 1); 491 fnlen = length - i - slashes 492 if (fnlen == 0) 493 { 494 filename = NULL; 495 if (!directory) 496 { 497 errno = EISDIR; 498 } 499 else 500 { 501 errno = ENOENT; 502 } 503 return = -1; 504 } 505 /* check flag to see if there are slashes to skip */ 506 *filename = malloc(fnlen + 1); 373 507 if (!*filename) 374 508 { … … 381 515 return -1; 382 516 } 383 strncpy(*filename, path + i + 1, length - i);517 strncpy(*filename, path + i, length - i); 384 518 (*filename)[length - i] = '\0'; 385 519 return 0; 520 } 521 522 void PINT_initrand(void) 523 { 524 static int init_called = 0; 525 pid_t pid; 526 uid_t uid; 527 gid_t gid; 528 struct timeval time; 529 char *oldstate; 530 unsigned int seed; 531 532 if (init_called) 533 { 534 return; 535 } 536 init_called = 1; 537 pid = getpid(); 538 uid = getuid(); 539 gid = getgid(); 540 gettimeofday(&time, NULL); 541 seed = (((pid << 16) ^ uid) ^ (gid << 8)) ^ time.tv_usec; 542 oldstate = initstate(seed, rstate, 256); 543 setstate(oldstate); 544 } 545 546 long int PINT_random(void) 547 { 548 char *oldstate; 549 long int rndval; 550 551 PINT_initrand(); 552 oldstate = setstate(rstate); 553 rndval = random(); 554 setstate(oldstate); 555 return rndval; 386 556 } 387 557 -
branches/Orange-Branch/src/client/usrint/openfile-util.h
r8890 r8899 19 19 int split_pathname( const char *path, char **directory, char **filename); 20 20 21 int pvfs_sys_init();21 void pvfs_sys_init(void); 22 22 23 23 char *pvfs_qualify_path(const char *path); … … 52 52 PVFS_object_ref parent_ref, 53 53 PVFS_object_ref *ref); 54 55 void PINT_initrand(void); 56 57 long int PINT_random(void); 54 58 #endif -
branches/Orange-Branch/src/client/usrint/posix-pvfs.c
r8890 r8899 43 43 pvfs_descriptor *pd; 44 44 45 if (!path) 46 { 47 errno = EINVAL; 48 return -1; 49 } 45 50 va_start(ap, flags); 46 51 if (flags & O_CREAT) … … 77 82 PVFS_hint hints; 78 83 84 if (!path) 85 { 86 errno = EINVAL; 87 return -1; 88 } 79 89 va_start(ap, flags); 80 90 if (flags & O_CREAT) … … 109 119 pvfs_descriptor *dpd, *fpd; 110 120 121 if (!path) 122 { 123 errno - EINVAL; 124 return -1; 125 } 111 126 va_start(ap, flags); 112 127 if (flags & O_CREAT) … … 133 148 else 134 149 { 150 if (dirfd < 0) 151 { 152 errno = EBADF; 153 return -1; 154 } 135 155 dpd = pvfs_find_descriptor(dirfd); 136 156 if (!dpd) … … 139 159 } 140 160 fpd = iocommon_open(path, flags, hints, mode, &dpd->pvfs_ref); 161 if (!fpd) 162 { 163 return -1; 164 } 141 165 return fpd->fd; 142 166 } … … 153 177 pvfs_descriptor *pd; 154 178 179 if (dirfd < 0) 180 { 181 errno = EBADF; 182 return -1; 183 } 155 184 va_start(ap, flags); 156 185 if (flags & O_CREAT) … … 214 243 { 215 244 int flags = O_RDONLY; 245 if (dirfd < 0) 246 { 247 errno = EBADF; 248 return -1; 249 } 216 250 pd = pvfs_find_descriptor(dirfd); 217 251 rc = iocommon_unlink(path, &pd->pvfs_ref); … … 252 286 char *absoldpath, *absnewpath; 253 287 288 if (!oldpath || !newpath) 289 { 290 errno = EINVAL; 291 return -1; 292 } 254 293 if (oldpath[0] != '/') 255 294 { 295 if (olddirfd < 0) 296 { 297 errno = EBADF; 298 return -1; 299 } 256 300 olddes = pvfs_find_descriptor(olddirfd); 257 301 absoldpath = (char *)oldpath; … … 264 308 if (oldpath[0] != '/') 265 309 { 310 if (newdirfd < 0) 311 { 312 errno = EBADF; 313 return -1; 314 } 266 315 newdes = pvfs_find_descriptor(newdirfd); 267 316 absnewpath = (char *)newpath; … … 292 341 int rc; 293 342 343 if (fd < 0) 344 { 345 errno = EBADF; 346 return -1; 347 } 294 348 pvfs_descriptor *pd = pvfs_find_descriptor(fd); 295 349 if (!pd) … … 336 390 { 337 391 int rc; 392 393 if (fd < 0) 394 { 395 errno = EBADF; 396 return -1; 397 } 338 398 pvfs_descriptor *pd = pvfs_find_descriptor(fd); 339 399 if (!pd) … … 460 520 pvfs_descriptor* pd; 461 521 522 if (fd < 0) 523 { 524 errno = EBADF; 525 return -1; 526 } 462 527 /* Find the descriptor */ 463 528 pd = pvfs_find_descriptor(fd); … … 489 554 pvfs_descriptor *pd; 490 555 556 if (!path) 557 { 558 errno = EINVAL; 559 return -1; 560 } 491 561 pd = iocommon_open(path, O_WRONLY, PVFS_HINT_NULL, 0 , NULL); 492 562 if (!pd) … … 514 584 pvfs_descriptor *pd; 515 585 586 if (fd < 0) 587 { 588 errno = EBADF; 589 return -1; 590 } 516 591 pd = pvfs_find_descriptor(fd); 517 592 if (!pd) … … 533 608 pvfs_descriptor* pd; 534 609 610 if (fd < 0) 611 { 612 errno = EBADF; 613 return -1; 614 } 535 615 pd = pvfs_find_descriptor(fd); 536 616 if (!pd) … … 560 640 #endif 561 641 642 if (fd < 0) 643 { 644 errno = EBADF; 645 return -1; 646 } 562 647 /* Find the descriptor */ 563 648 pd = pvfs_find_descriptor(fd); … … 620 705 pvfs_descriptor *pd; 621 706 707 if (fd < 0) 708 { 709 errno = EBADF; 710 return -1; 711 } 622 712 pd = pvfs_find_descriptor(fd); 623 713 return iocommon_stat(pd, buf); … … 631 721 pvfs_descriptor *pd; 632 722 723 if (fd < 0) 724 { 725 errno = EBADF; 726 return -1; 727 } 633 728 pd = pvfs_find_descriptor(fd); 634 729 return iocommon_stat64(pd, buf); … … 660 755 { 661 756 flags |= O_NOFOLLOW; 757 } 758 if (fd < 0) 759 { 760 errno = EBADF; 761 return -1; 662 762 } 663 763 pd = pvfs_find_descriptor(fd); … … 698 798 { 699 799 flags |= O_NOFOLLOW; 800 } 801 if (fd < 0) 802 { 803 errno = EBADF; 804 return -1; 700 805 } 701 806 pd = pvfs_find_descriptor(fd); … … 790 895 pvfs_descriptor *pd; 791 896 897 if (fd < 0) 898 { 899 errno = EBADF; 900 return -1; 901 } 792 902 pd = pvfs_find_descriptor(fd); 793 903 return iocommon_chown(pd, owner, group); … … 819 929 { 820 930 flags |= O_NOFOLLOW; 931 } 932 if (fd < 0) 933 { 934 errno = EBADF; 935 return -1; 821 936 } 822 937 pd = pvfs_find_descriptor(fd); … … 879 994 pvfs_descriptor *pd; 880 995 996 if (fd < 0) 997 { 998 errno = EBADF; 999 return -1; 1000 } 881 1001 pd = pvfs_find_descriptor(fd); 882 1002 return iocommon_chmod(pd, mode); … … 908 1028 { 909 1029 flags |= O_NOFOLLOW; 1030 } 1031 if (fd < 0) 1032 { 1033 errno = EBADF; 1034 return -1; 910 1035 } 911 1036 pd = pvfs_find_descriptor(fd); … … 974 1099 else 975 1100 { 1101 if (dirfd < 0) 1102 { 1103 errno = EBADF; 1104 return -1; 1105 } 976 1106 pd = pvfs_find_descriptor(dirfd); 977 1107 rc = iocommon_make_directory(path, … … 1033 1163 { 1034 1164 int flags = O_RDONLY | O_NOFOLLOW; 1165 if (fd < 0) 1166 { 1167 errno = EBADF; 1168 return -1; 1169 } 1035 1170 pd = pvfs_find_descriptor(fd); 1036 1171 if (!pd) … … 1057 1192 { 1058 1193 pvfs_descriptor *pd; 1194 if (newdirfd < 0) 1195 { 1196 errno = EBADF; 1197 return -1; 1198 } 1059 1199 pd = pvfs_find_descriptor(newdirfd); 1060 1200 return iocommon_symlink(newpath, oldpath, &pd->pvfs_ref); … … 1090 1230 { 1091 1231 pvfs_descriptor *pd; 1232 1233 if (fd < 0) 1234 { 1235 errno = EBADF; 1236 return -1; 1237 } 1092 1238 pd = pvfs_find_descriptor(fd); 1093 1239 return iocommon_getdents(pd, dirp, count); … … 1102 1248 { 1103 1249 pvfs_descriptor *pd; 1250 1251 if (fd < 0) 1252 { 1253 errno = EBADF; 1254 return -1; 1255 } 1104 1256 pd = pvfs_find_descriptor(fd); 1105 1257 return iocommon_access(path, mode, flags, &pd->pvfs_ref); -
branches/Orange-Branch/src/client/usrint/posix.c
r8890 r8899 15 15 #include <posix-pvfs.h> 16 16 #include <openfile-util.h> 17 18 static int pvfs_lib_init = 0;19 20 posix_ops glibc_ops =21 {22 .statfs = statfs23 };24 25 void load_glibc(void)26 {27 pvfs_lib_init = 1;28 glibc_ops.open = dlsym(RTLD_NEXT, "open");29 glibc_ops.open64 = dlsym(RTLD_NEXT, "open64");30 glibc_ops.unlink = dlsym(RTLD_NEXT, "unlink");31 glibc_ops.close = dlsym(RTLD_NEXT, "close");32 glibc_ops.read = dlsym(RTLD_NEXT, "read");33 glibc_ops.write = dlsym(RTLD_NEXT, "write");34 glibc_ops.lseek = dlsym(RTLD_NEXT, "lseek");35 glibc_ops.lseek64 = dlsym(RTLD_NEXT, "lseek64");36 glibc_ops.pread = dlsym(RTLD_NEXT, "pread");37 glibc_ops.pwrite = dlsym(RTLD_NEXT, "pwrite");38 glibc_ops.readv = dlsym(RTLD_NEXT, "readv");39 glibc_ops.writev = dlsym(RTLD_NEXT, "writev");40 }41 17 42 18 /* … … 54 30 pvfs_descriptor *pd; 55 31 56 if(!pvfs_lib_init) {57 load_glibc();58 }59 60 32 va_start(ap, flags); 61 33 if (flags & O_CREAT) … … 69 41 va_end(ap); 70 42 71 if(is_pvfs_path(path)) { 72 #ifdef DEBUG 73 printf("PVFS_OPEN\n"); 74 #endif 43 if (is_pvfs_path(path)) 44 { 75 45 return pvfs_open(path, flags, mode, hints); 76 46 } 77 else { 78 #ifdef DEBUG 79 printf("GLIBC_OPEN\n"); 80 #endif 47 else 48 { 81 49 pd = pvfs_alloc_descriptor(&glibc_ops); 82 50 pd->posix_fd = pd->fsops->open(path, flags, mode); … … 96 64 PVFS_hint hints; /* need to figure out how to set default */ 97 65 98 if(!pvfs_lib_init) {99 load_glibc();100 }101 102 66 va_start(ap, flags); 103 67 if (flags & O_HINTS) … … 123 87 int creat(const char *path, mode_t mode) 124 88 { 125 if(!pvfs_lib_init) {126 load_glibc();127 }128 129 89 return open(path, O_CREAT|O_WRONLY|O_TRUNC, mode); 130 90 } … … 135 95 int creat64(const char *path, mode_t mode) 136 96 { 137 if(!pvfs_lib_init) {138 load_glibc();139 }140 141 97 return open64(path, O_CREAT|O_WRONLY|O_TRUNC, mode); 142 98 } … … 147 103 int unlink(const char *path) 148 104 { 149 if (!pvfs_lib_init) {150 load_glibc();151 }152 105 if (is_pvfs_path(path)) { 153 #ifdef DEBUG154 pvfs_debug("unlink: calling pvfs_unlink\n");155 #endif156 106 return pvfs_ops.unlink(path); 157 107 } 158 108 else { 159 #ifdef DEBUG160 pvfs_debug("unlink: calling glibc_ops.unlink\n");161 #endif162 109 return glibc_ops.unlink(path); 163 110 } … … 517 464 { 518 465 return lstat64(path, buf); 466 } 467 468 int getdents(unsigned int fd, struct dirent *dirp, unsigned int count) 469 { 470 return -1; 519 471 } 520 472 -
branches/Orange-Branch/src/client/usrint/stdio.c
r8890 r8899 38 38 #define DIRBUFSIZE (512*1024) 39 39 #define ASIZE 256 40 #define MAXTRIES 16 /* arbitrary - how many tries to get a unique file name */ 40 41 41 42 /** This function coverts from stream style mode to ssycall style flags … … 1100 1101 * mkdtemp makes a temp dir and returns an fd 1101 1102 */ 1102 char * mkdtemp(char *template) 1103 { 1104 char *rc = NULL; 1103 char *mkdtemp(char *template) 1104 { 1105 1105 int fd; 1106 int len; 1107 int rnum; 1108 int try; 1109 1106 1110 if (!template) 1107 1111 { … … 1109 1113 return NULL; 1110 1114 } 1111 rc = mktemp(template); 1112 if (rc == NULL) 1113 { 1115 len = strlen(template); 1116 if (!strncmp(&template[len-6],"XXXXXX",6)) 1117 { 1118 errno = EINVAL; 1114 1119 return NULL; 1115 1120 } 1116 fd = mkdir(template, 0600); 1117 if (fd < 0) 1118 { 1119 return NULL; 1121 for(try = 0; try < MAXTRIES; try++) 1122 { 1123 rnum = PINT_random() % 1000000; 1124 sprintf(&template[len-6],"%06d", rnum); 1125 fd = mkdir(template, 0700); 1126 if (fd < 0) 1127 { 1128 if (errno == EEXIST) 1129 { 1130 continue; 1131 } 1132 return NULL; 1133 } 1120 1134 } 1121 1135 return template; … … 1127 1141 int mkstemp(char *template) 1128 1142 { 1129 char *ret;1130 1143 int fd; 1144 int len; 1145 int rnum; 1146 int try; 1147 1131 1148 if (!template) 1132 1149 { … … 1134 1151 return -1; 1135 1152 } 1136 ret = mktemp(template); 1137 if (ret == NULL) 1138 { 1139 return -1; 1140 } 1141 fd = open(template, O_RDWR|O_EXCL|O_CREAT, 0600); 1153 len = strlen(template); 1154 if (!strncmp(&template[len-6],"XXXXXX",6)) 1155 { 1156 errno = EINVAL; 1157 return -1; 1158 } 1159 for(try = 0; try < MAXTRIES; try++) 1160 { 1161 rnum = PINT_random() % 1000000; 1162 sprintf(&template[len-6],"%06d", rnum); 1163 fd = open(template, O_RDWR|O_EXCL|O_CREAT, 0600); 1164 if (fd < 0) 1165 { 1166 if (errno == EEXIST) 1167 { 1168 continue; 1169 } 1170 return -1; 1171 } 1172 } 1142 1173 return fd; 1143 1174 } … … 1261 1292 int bytes_read; 1262 1293 /* read a block of dirents into the buffer */ 1263 bytes_read = getdents 64(dir->fileno, dir->buf_base,1264 (dir->buf_end - dir->buf_base));1294 bytes_read = getdents(dir->fileno, dir->buf_base, 1295 (dir->buf_end - dir->buf_base)); 1265 1296 dir->buf_act = dir->buf_base + bytes_read; 1266 1297 dir->buf_ptr = dir->buf_base; -
branches/Orange-Branch/src/client/usrint/usrint.h
r8890 r8899 59 59 #define O_NOFOLLOW 0 60 60 #endif 61 #define max(x, y) (((x) > (y)) ? (x) : (y))62 61 #define true 1 63 62 #define false 0 -
branches/Orange-Branch/src/common/misc/pint-perf-counter.c
r8892 r8899 52 52 {"request scheduler", PINT_PERF_REQSCHED, PINT_PERF_PRESERVE}, 53 53 {"requests received ", PINT_PERF_REQUESTS, PINT_PERF_PRESERVE}, 54 {"bytes read by small_io", PINT_PERF_SMALL_READ, PINT_PERF_PRESERVE}, 55 {"bytes written by small_io", PINT_PERF_SMALL_WRITE, PINT_PERF_PRESERVE}, 56 {"bytes read by flow", PINT_PERF_FLOW_READ, PINT_PERF_PRESERVE}, 57 {"bytes written by flow", PINT_PERF_FLOW_WRITE, PINT_PERF_PRESERVE}, 54 58 {NULL, 0, 0}, 55 59 }; … … 228 232 enum PINT_perf_ops op) 229 233 { 234 #if 0 230 235 int64_t tmp; /* this is for debugging purposes */ 236 #endif 231 237 232 238 if(!pc || !pc->sample || !pc->sample->value) … … 238 244 gen_mutex_lock(&pc->mutex); 239 245 246 #if 0 240 247 tmp = pc->sample->value[key]; 248 #endif 241 249 242 250 if(key >= pc->key_count) 243 251 { 244 252 gossip_err("Error: PINT_perf_count(): invalid key.\n"); 245 return;253 goto errorout; 246 254 } 247 255 … … 265 273 #endif 266 274 275 errorout: 267 276 gen_mutex_unlock(&pc->mutex); 268 277 return; -
branches/Orange-Branch/src/io/flow/flowproto-bmi-trove/flowproto-multiqueue.c
r8317 r8899 1067 1067 actual_size, 1068 1068 PINT_PERF_ADD); 1069 PINT_perf_count(PINT_server_pc, 1070 PINT_PERF_FLOW_READ, 1071 actual_size, 1072 PINT_PERF_ADD); 1069 1073 1070 1074 flow_data->parent->total_transferred += actual_size; … … 1352 1356 do{ 1353 1357 q_item->parent->total_transferred += result_tmp->result.bytes; 1354 PINT_perf_count( 1355 PINT_server_pc, 1356 PINT_PERF_WRITE, 1357 result_tmp->result.bytes, 1358 PINT_PERF_ADD); 1358 PINT_perf_count( PINT_server_pc, 1359 PINT_PERF_WRITE, 1360 result_tmp->result.bytes, 1361 PINT_PERF_ADD); 1362 PINT_perf_count( PINT_server_pc, 1363 PINT_PERF_FLOW_WRITE, 1364 result_tmp->result.bytes, 1365 PINT_PERF_ADD); 1359 1366 old_result_tmp = result_tmp; 1360 1367 result_tmp = result_tmp->next; -
branches/Orange-Branch/src/io/trove/trove-mgmt.c
r7959 r8899 89 89 TROVE_method_callback method_callback, 90 90 char *data_path, 91 char *meta_path,91 char *meta_path, 92 92 TROVE_ds_flags flags) 93 93 { -
branches/Orange-Branch/src/server/small-io.sm
r8891 r8899 18 18 #include "pint-distribution.h" 19 19 #include "pint-request.h" 20 #include "pint-perf-counter.h" 20 21 21 22 %% … … 232 233 } 233 234 } 235 if(s_op->req->u.small_io.io_type == PVFS_IO_READ) 236 { 237 PINT_perf_count(PINT_server_pc, 238 PINT_PERF_READ, 239 s_op->resp.u.small_io.result_size, 240 PINT_PERF_ADD); 241 PINT_perf_count(PINT_server_pc, 242 PINT_PERF_SMALL_READ, 243 s_op->resp.u.small_io.result_size, 244 PINT_PERF_ADD); 245 } 246 else 247 { 248 PINT_perf_count(PINT_server_pc, 249 PINT_PERF_WRITE, 250 s_op->resp.u.small_io.result_size, 251 PINT_PERF_ADD); 252 PINT_perf_count(PINT_server_pc, 253 PINT_PERF_SMALL_WRITE, 254 s_op->resp.u.small_io.result_size, 255 PINT_PERF_ADD); 256 } 234 257 235 258 return SM_ACTION_COMPLETE;
