Changeset 7958
- Timestamp:
- 09/02/09 17:10:52 (4 years ago)
- Location:
- trunk
- Files:
-
- 49 modified
-
src/apps/admin/pvfs2-change-fsid.c (modified) (8 diffs)
-
src/apps/admin/pvfs2-genconfig (modified) (18 diffs)
-
src/apps/admin/pvfs2-migrate-collection.c (modified) (32 diffs)
-
src/apps/admin/pvfs2-mkspace.c (modified) (9 diffs)
-
src/apps/admin/pvfs2-showcoll.c (modified) (8 diffs)
-
src/common/misc/mkspace.c (modified) (9 diffs)
-
src/common/misc/mkspace.h (modified) (2 diffs)
-
src/common/misc/server-config.c (modified) (9 diffs)
-
src/common/misc/server-config.h (modified) (1 diff)
-
src/io/trove/trove-dbpf/dbpf-dspace.c (modified) (2 diffs)
-
src/io/trove/trove-dbpf/dbpf-mgmt.c (modified) (51 diffs)
-
src/io/trove/trove-dbpf/dbpf-open-cache.c (modified) (3 diffs)
-
src/io/trove/trove-dbpf/dbpf.h (modified) (5 diffs)
-
src/io/trove/trove-internal.h (modified) (4 diffs)
-
src/io/trove/trove-mgmt.c (modified) (4 diffs)
-
src/io/trove/trove-migrate.c (modified) (7 diffs)
-
src/io/trove/trove.h (modified) (5 diffs)
-
src/proto/endecode-funcs.h (modified) (1 diff)
-
src/server/pvfs2-server.c (modified) (3 diffs)
-
test/automated/README.tests (modified) (1 diff)
-
test/io/buffer/trove-init.c (modified) (1 diff)
-
test/io/flow/test-bmi-cache-server.c (modified) (1 diff)
-
test/io/flow/test-harness-server-trove.c (modified) (1 diff)
-
test/io/flow/test1-server.c (modified) (1 diff)
-
test/io/job/job-client-example.c (modified) (1 diff)
-
test/io/job/job-server-example.c (modified) (1 diff)
-
test/io/job/module.mk.in (modified) (1 diff)
-
test/io/job/trove-job-create-toy.c (modified) (1 diff)
-
test/io/job/trove-job-ls.c (modified) (1 diff)
-
test/io/job/trove-job-mkfs.c (modified) (3 diffs)
-
test/io/job/trove-job-touch.c (modified) (1 diff)
-
test/io/trove/test-listio.c (modified) (1 diff)
-
test/io/trove/test-listio2.c (modified) (1 diff)
-
test/io/trove/test-listio3.c (modified) (1 diff)
-
test/io/trove/test-listio4.c (modified) (1 diff)
-
test/io/trove/test-listio5.c (modified) (1 diff)
-
test/io/trove/test-trove-cancel.c (modified) (1 diff)
-
test/io/trove/trove-bstream.c (modified) (1 diff)
-
test/io/trove/trove-create-stress.c (modified) (1 diff)
-
test/io/trove/trove-export.c (modified) (1 diff)
-
test/io/trove/trove-import.c (modified) (1 diff)
-
test/io/trove/trove-key-iterate.c (modified) (1 diff)
-
test/io/trove/trove-ls.c (modified) (1 diff)
-
test/io/trove/trove-mkdir.c (modified) (1 diff)
-
test/io/trove/trove-mkfs.c (modified) (3 diffs)
-
test/io/trove/trove-rm.c (modified) (1 diff)
-
test/io/trove/trove-rmdir.c (modified) (1 diff)
-
test/io/trove/trove-touch.c (modified) (1 diff)
-
test/server/showconfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/apps/admin/pvfs2-change-fsid.c
r7952 r7958 39 39 char fs_conf[PATH_MAX]; 40 40 char fs_name[PATH_MAX]; 41 char data_storage_path[PATH_MAX]; 42 char meta_storage_path[PATH_MAX]; 41 char storage_path[PATH_MAX]; 43 42 int32_t old_fsid; 44 43 int32_t new_fsid; … … 315 314 { 316 315 FILE * fptr = NULL; 317 char datacommand[PATH_MAX]; 318 char metacommand[PATH_MAX]; 319 char dataoutput[PATH_MAX]; 320 char metaoutput[PATH_MAX]; 316 char command[PATH_MAX]; 317 char output[PATH_MAX]; 321 318 struct stat buf; 322 char datapath[PATH_MAX]; 323 char new_datapath[PATH_MAX]; 324 char metapath[PATH_MAX]; 325 char new_metapath[PATH_MAX]; 319 char path[PATH_MAX]; 320 char new_path[PATH_MAX]; 326 321 int ret = 0; 327 322 328 memset(datapath, 0, sizeof(datapath)); 329 memset(metapath, 0, sizeof(metapath)); 330 sprintf(datapath, "%s%s", opts.data_storage_path, opts.old_fsid_hex); 331 sprintf(metapath, "%s/%s", opts.meta_storage_path, opts.old_fsid_hex); 332 333 /* See if each directory exists */ 334 ret = stat(datapath, &buf); 323 memset(path,0,sizeof(path)); 324 sprintf(path,"%s/%s", opts.storage_path, opts.old_fsid_hex); 325 326 /* See if directory exists */ 327 ret = stat(path, &buf); 335 328 if(ret) 336 329 { 337 330 fprintf(stderr, 338 "Error checking for data directory's existance. [%s]\n", 339 datapath); 340 return -1; 341 } 342 ret = stat(metapath, &buf); 343 if(ret) 344 { 345 fprintf(stderr, 346 "Error checking for meta directory's existance. [%s]\n", 347 metapath); 331 "Error checking for directory's existance. [%s]\n", 332 path); 348 333 return -1; 349 334 } … … 356 341 } 357 342 358 memset(datacommand, 0, sizeof(datacommand)); 359 memset(metacommand, 0, sizeof(metacommand)); 360 memset(dataoutput, 0, sizeof(dataoutput)); 361 memset(metaoutput, 0, sizeof(metaoutput)); 362 memset(new_datapath, 0, sizeof(new_datapath)); 363 memset(new_metapath, 0, sizeof(new_metapath)); 364 365 /* Move the directories */ 366 sprintf(new_datapath, "%s/%s", opts.data_storage_path, opts.new_fsid_hex); 367 sprintf(new_metapath, "%s%s", opts.meta_storage_path, opts.new_fsid_hex); 368 sprintf(datacommand, "mv %s %s", datapath, new_datapath); 369 sprintf(metacommand, "mv %s %s", metapath, new_metapath); 370 371 /* move the data dir */ 372 fptr = popen(datacommand, "r"); 343 memset(command,0,sizeof(command)); 344 memset(output,0,sizeof(output)); 345 memset(new_path,0,sizeof(new_path)); 346 347 /* Move the directory */ 348 sprintf(new_path, "%s/%s", opts.storage_path, opts.new_fsid_hex); 349 sprintf(command, "mv %s %s", path, new_path); 350 351 fptr = popen(command, "r"); 373 352 if(fptr == NULL) 374 353 { … … 376 355 exit(-1); 377 356 } 378 ret = fscanf(fptr, "%s", dataoutput);379 if(ret && strncmp( dataoutput,"",PATH_MAX))380 { 381 printf("mv from [%s] to [%s] failed.\n", datapath, new_datapath);357 ret = fscanf(fptr, "%s", output); 358 if(ret && strncmp(output,"",PATH_MAX)) 359 { 360 printf("mv from [%s] to [%s] failed.\n", path, new_path); 382 361 return -1; 383 362 } 384 363 pclose(fptr); 385 364 386 /* move the meta dir */387 fptr = popen(metacommand, "r");388 if(fptr == NULL)389 {390 fprintf(stderr,"Error opening pipe. errno=%d",errno);391 exit(-1);392 }393 ret = fscanf(fptr, "%s", metaoutput);394 if(ret && strncmp(metaoutput,"",PATH_MAX))395 {396 printf("mv from [%s] to [%s] failed.\n", metapath, new_metapath);397 return -1;398 }399 pclose(fptr);400 401 365 if(opts.verbose) 402 366 { 403 printf("Successful data dir move from [%s] to [%s]\n", datapath, new_datapath); 404 printf("Successful meta dir move from [%s] to [%s]\n", metapath, new_metapath); 367 printf("Successful dir move from [%s] to [%s]\n", path, new_path); 405 368 } 406 369 … … 554 517 {"dbpath",1,0,0}, 555 518 {"fsconf",1,0,0}, 556 {"datastorage",1,0,0}, 557 {"metastorage",1,0,0}, 519 {"storage",1,0,0}, 558 520 {"view",0,0,0}, 559 521 {0,0,0,0} … … 600 562 break; 601 563 602 case 7: /* data storage */ 603 strncpy(opts.data_storage_path, optarg, PATH_MAX); 604 break; 605 606 case 8: /* meta storage */ 607 strncpy(opts.meta_storage_path, optarg, PATH_MAX); 608 break; 609 610 case 9: /* view */ 564 case 7: /* storage */ 565 strncpy(opts.storage_path, optarg, PATH_MAX); 566 break; 567 568 case 8: /* view */ 611 569 opts.view_only = 1; 612 570 break; … … 635 593 } 636 594 637 /* data storage_path must be set */ 638 if(!strncmp(opts.data_storage_path,"",PATH_MAX)) 639 { 640 fprintf(stderr,"Error: --datastorage option must be given.\n"); 641 print_help(argv[0]); 642 return(-1); 643 } 644 645 /* meta storage_path must be set */ 646 if(!strncmp(opts.meta_storage_path,"",PATH_MAX)) 647 { 648 fprintf(stderr,"Error: --metastorage option must be given.\n"); 595 /* storage_path must be set */ 596 if(!strncmp(opts.storage_path,"",PATH_MAX)) 597 { 598 fprintf(stderr,"Error: --storage option must be given.\n"); 649 599 print_help(argv[0]); 650 600 return(-1); … … 663 613 fprintf(stderr," --fsconf=</path/to/pvfs2-fs.conf> " 664 614 "Fs config file for the the file system being modified.\n"); 665 fprintf(stderr," --datastorage=</path/to/pvfs2-data-storage-space> " 666 "Local data storage space for the the file system being modified.\n"); 667 fprintf(stderr," --metastorage=</path/to/pvfs2-meta-storage-space> " 668 "Local meta storage space for the the file system being modified.\n"); 615 fprintf(stderr," --storage=</path/to/pvfs2-storage-space> " 616 "Local storage space for the the file system being modified.\n"); 669 617 fprintf(stderr, "\n"); 670 618 fprintf(stderr,"The following arguments are optional:\n"); -
trunk/src/apps/admin/pvfs2-genconfig
r7952 r7958 57 57 58 58 my $default_storage = undef; 59 my $default_meta_storage = undef;60 59 my $default_logfile = undef; 61 60 … … 217 216 if(defined($default_storage)) 218 217 { 219 print $target "\n\tDataStorageSpace " . $default_storage . "\n"; 220 } 221 222 if(defined($default_meta_storage)) 223 { 224 print $target "\tMetadataStorageSpace " . $default_meta_storage . "\n\n"; 218 print $target "\n\tStorageSpace " . $default_storage . "\n"; 225 219 } 226 220 … … 386 380 print $target "\n<ServerOptions>\n"; 387 381 print $target "\tServer $alias\n"; 388 print $target "\tDataStorageSpace $endpoint->{STORAGE}\n"; 389 print $target "\tMetadataStorageSpace $endpoint->{METASTORAGE}\n"; 382 print $target "\tStorageSpace $endpoint->{STORAGE}\n"; 390 383 print $target "\tLogFile $endpoint->{LOGFILE}\n"; 391 384 print $target "</ServerOptions>\n"; … … 396 389 sub emit_server_conf 397 390 { 398 my($target, $node, $storage, $metastorage, $logfile) = @_; 399 400 print $target "DataStorageSpace $storage\n"; 401 print $target "MetadataStorageSpace $metastorage\n"; 391 my($target, $node, $storage, $logfile) = @_; 392 393 print $target "StorageSpace $storage\n"; 402 394 print $target "HostID \"" . get_bmi_endpoint($node) . "\"\n"; 403 395 print $target "LogFile $logfile\n"; … … 850 842 } 851 843 852 sub get_meta_storage 853 { 854 my $metastorage = "/pvfs2-storage-space"; 855 if ($opt_storage) { 856 $metastorage = $opt_storage; 857 } elsif (!$opt_quiet) { 858 print $OUT "Choose a directory for each server to store metadata in.\n"; 859 $metastorage = prompt_word("Enter directory name: [Default is /pvfs2-storage-space]: ","/pvfs2-storage-space"); 860 } 861 return $metastorage; 862 } 844 863 845 864 846 # get host port … … 966 948 my $portmap = shift; 967 949 my $storage = shift; 968 my $metastorage = shift;969 950 my $logfile = shift; 970 951 my $ioline = ''; … … 996 977 HOSTNAME => $io_host, 997 978 PORTMAP => $portmap, 998 STORAGE => $storage, 999 METASTORAGE => $metastorage, 979 STORAGE => $storage, 1000 980 LOGFILE => $logfile}; 1001 981 } … … 1007 987 my $portmap = shift; 1008 988 my $storage = shift; 1009 my $metastorage = shift;1010 989 my $logfile = shift; 1011 990 my $metaline = ''; … … 1053 1032 HOSTNAME => $meta_host, 1054 1033 PORTMAP => $portmap, 1055 STORAGE => $storage, 1056 METASTORAGE => $metastorage, 1034 STORAGE => $storage, 1057 1035 LOGFILE => $logfile}; 1058 1036 } … … 1083 1061 { 1084 1062 my $stor = undef; 1085 my $mstor = undef;1086 1063 my $logf = undef; 1087 1064 my $proto = undef; … … 1094 1071 # endpoint. We want to match on [...]:storage:logfile 1095 1072 # and place the stuff between the [] in $1, and optionally 1096 # place the matched storage path and meta path in $2 and $3, 1097 # logfile is in $4 1073 # place the matched storage path and logfile in $2 and $3 1098 1074 # 1099 1075 $ep =~ /\[([^\]]+)\](?::([^:]+))?(?::([^:]+))?/; 1100 1076 1101 1077 $stor = $2; 1102 $mstor = $3; 1103 $logf = $4; 1078 $logf = $3; 1104 1079 1105 1080 if(!defined($1)) … … 1152 1127 HOSTNAME => $hostname, 1153 1128 PORTMAP => \%port, 1154 STORAGE => $stor, 1155 METASTORAGE => $mstor, 1129 STORAGE => $stor, 1156 1130 LOGFILE => $logf}; 1157 1131 } … … 1200 1174 my $pranges = $4; 1201 1175 $stor = $5; 1202 $mstor = $6; 1203 $logf = $7; 1176 $logf = $6; 1204 1177 1205 1178 if($proto !~ /mx/) 1206 1179 { 1207 1180 $logf = $stor; 1208 $stor = $mstor; 1209 $mstor = $pranges; 1181 $stor = $pranges; 1210 1182 $pranges = $branges; 1211 1183 $branges = undef; … … 1249 1221 PORTMAP => $portmap, 1250 1222 STORAGE => $stor, 1251 METASTORAGE => $mstor,1252 1223 LOGFILE => $logf}; 1253 1224 } … … 1271 1242 PORTMAP => $portmap, 1272 1243 STORAGE => $stor, 1273 METASTORAGE => $mstor,1274 1244 LOGFILE => $logf}; 1275 1245 } … … 1310 1280 PORTMAP => $portmap, 1311 1281 STORAGE => $stor, 1312 METASTORAGE => $mstor,1313 1282 LOGFILE => $logf}; 1314 1283 } … … 1527 1496 1528 1497 $default_storage = get_storage(); 1529 $default_meta_storage = get_meta_storage();1530 1498 $default_logfile = get_logfile(); 1531 1499 1532 1500 get_ionames($portmap, $default_storage, $default_logfile); 1533 get_metanames($portmap, $default_ meta_storage, $default_logfile);1501 get_metanames($portmap, $default_storage, $default_logfile); 1534 1502 } 1535 1503 … … 1545 1513 set_default_value(STORAGE, $default_storage); 1546 1514 set_default_value(STORAGE, $default_storage); 1547 }1548 1549 if(needs_default_value(METASTORAGE))1550 {1551 if(!defined($default_meta_storage))1552 {1553 $default_meta_storage = get_meta_storage();1554 }1555 set_default_value(METASTORAGE, $default_meta_storage);1556 set_default_value(METASTORAGE, $default_meta_storage);1557 1515 } 1558 1516 -
trunk/src/apps/admin/pvfs2-migrate-collection.c
r7952 r7958 63 63 static int parse_args(int argc, char **argv, options_t *opts); 64 64 static int src_get_version( 65 char* meta_storage_space, TROVE_coll_id coll_id, char* coll_name,65 char* storage_space, TROVE_coll_id coll_id, char* coll_name, 66 66 char* ver_string, int ver_string_max); 67 static int remove_collection_entry(char* meta_storage_space, char* collname);67 static int remove_collection_entry(char* storage_space, char* collname); 68 68 69 69 int migrate_collection(void * config, void * sconfig); … … 73 73 /* functions specific to reading 0.0.1 collections */ 74 74 static int src_get_version_0_0_1( 75 char* meta_storage_space, TROVE_coll_id coll_id,75 char* storage_space, TROVE_coll_id coll_id, 76 76 char* ver_string, int ver_string_max); 77 77 static int translate_0_0_1( 78 char* data_storage_space, char* meta_storage_space, char* old_coll_path,78 char* storage_space, char* old_coll_path, 79 79 char* coll_name, TROVE_coll_id coll_id); 80 80 static int translate_coll_eattr_0_0_1( … … 88 88 TROVE_context_id trove_context); 89 89 static int translate_bstreams_0_0_1( 90 char* data_storage_space, char* old_coll_path,90 char* storage_space, char* old_coll_path, 91 91 TROVE_coll_id coll_id, char* coll_name, 92 92 TROVE_context_id trove_context); … … 233 233 (struct server_configuration_s *) sconfig; 234 234 235 if(server_config->meta_path == NULL)236 {237 server_config->meta_path = server_config->data_path;238 }239 240 235 memset(version, 0, 256); 241 236 /* find version of source storage space */ 242 237 ret = src_get_version( 243 server_config-> meta_path,238 server_config->storage_path, 244 239 fs_config->coll_id, 245 240 fs_config->file_system_name, … … 258 253 { 259 254 sprintf(old_coll_path, "%s/%08x-old-%s", 260 server_config-> meta_path,255 server_config->storage_path, 261 256 fs_config->coll_id, version); 262 257 … … 297 292 298 293 ret = translate_0_0_1( 299 server_config->data_path, 300 server_config->meta_path, 301 old_coll_path, 294 server_config->storage_path, old_coll_path, 302 295 fs_config->file_system_name, 303 296 fs_config->coll_id); … … 334 327 * is anymore 335 328 */ 336 DIR * data_storage_dir; 337 DIR * meta_storage_dir; 329 DIR * storage_dir; 338 330 struct dirent * next_dirent; 339 331 char collname[PATH_MAX]; … … 343 335 collname_length = sprintf(collname, "%08x-old", fs_config->coll_id); 344 336 345 data_storage_dir = opendir(server_config->data_path);346 if(! data_storage_dir)347 { 348 fprintf(stderr, "Error: failed to open d ata directory: %s\n",349 server_config-> data_path);337 storage_dir = opendir(server_config->storage_path); 338 if(!storage_dir) 339 { 340 fprintf(stderr, "Error: failed to open directory: %s\n", 341 server_config->storage_path); 350 342 return -1; 351 343 } 352 344 353 while((next_dirent = readdir( data_storage_dir)) != NULL)345 while((next_dirent = readdir(storage_dir)) != NULL) 354 346 { 355 347 int d_namelen = strlen(next_dirent->d_name); … … 360 352 361 353 sprintf(old_coll_path, "%s/%s", 362 server_config-> data_path, next_dirent->d_name);354 server_config->storage_path, next_dirent->d_name); 363 355 364 356 /* found an old version, delete it */ … … 373 365 "Error: failed to remove old collection at: %s\n", 374 366 old_coll_path); 375 closedir( data_storage_dir);367 closedir(storage_dir); 376 368 return -1; 377 369 } … … 380 372 } 381 373 382 /* if the meta and data paths are the same, don't try to remove twice */383 if (strcmp(server_config->data_path, server_config->meta_path))384 {385 meta_storage_dir = opendir(server_config->meta_path);386 if(!meta_storage_dir)387 {388 fprintf(stderr, "Error: failed to open meta directory: %s\n",389 server_config->meta_path);390 return -1;391 }392 393 while((next_dirent = readdir(meta_storage_dir)) != NULL)394 {395 int d_namelen = strlen(next_dirent->d_name);396 if(collname_length < d_namelen &&397 strncmp(next_dirent->d_name, collname, collname_length) == 0)398 {399 char old_coll_path[PATH_MAX];400 401 sprintf(old_coll_path, "%s/%s",402 server_config->meta_path, next_dirent->d_name);403 404 /* found an old version, delete it */405 if(verbose)406 printf("VERBOSE Removing old collection at: %s\n",407 old_coll_path);408 ret = recursive_rmdir(old_coll_path);409 if(ret < 0)410 {411 fprintf(412 stderr,413 "Error: failed to remove old collection at: %s\n",414 old_coll_path);415 closedir(meta_storage_dir);416 return -1;417 }418 removed_olddirs = 1;419 }420 }421 closedir(meta_storage_dir);422 }423 424 374 if(removed_olddirs == 0) 425 375 { … … 429 379 } 430 380 431 closedir( data_storage_dir);381 closedir(storage_dir); 432 382 } 433 383 else … … 576 526 */ 577 527 static int src_get_version( 578 char* meta_storage_space, /**< path to storage space */528 char* storage_space, /**< path to storage space */ 579 529 TROVE_coll_id coll_id, /**< collection id */ 580 530 char* coll_name, /**< collection name */ … … 586 536 587 537 ret = src_get_version_0_0_1( 588 meta_storage_space, coll_id, ver_string, ver_string_max);538 storage_space, coll_id, ver_string, ver_string_max); 589 539 590 540 if(ret != 0) … … 593 543 "Error: all known collection version checks " 594 544 "failed for \ncollection %s (%08x) in storage space %s\n", 595 coll_name, coll_id, meta_storage_space);545 coll_name, coll_id, storage_space); 596 546 } 597 547 … … 605 555 */ 606 556 static int src_get_version_0_0_1( 607 char* meta_storage_space, /**< path to storage space */557 char* storage_space, /**< path to storage space */ 608 558 TROVE_coll_id coll_id, /**< collection id */ 609 559 char* ver_string, /**< version in string format */ … … 616 566 617 567 sprintf(coll_db, "%s/%08x/collection_attributes.db", 618 meta_storage_space, coll_id);568 storage_space, coll_id); 619 569 620 570 /* try to find a collections db */ … … 679 629 */ 680 630 static int translate_0_0_1( 681 char* data_storage_space, /**< path to data storage space */ 682 char* meta_storage_space, /**< path to metadata storage space */ 631 char* storage_space, /**< path to storage space */ 683 632 char* old_coll_path, /**< path to old collection */ 684 633 char* coll_name, /**< collection name */ … … 695 644 696 645 /* rename old collection */ 697 snprintf(current_path, PATH_MAX, "%s/%08x", meta_storage_space, coll_id);646 snprintf(current_path, PATH_MAX, "%s/%08x", storage_space, coll_id); 698 647 699 648 if(access(current_path, F_OK) != 0) … … 714 663 } 715 664 716 ret = remove_collection_entry( meta_storage_space, coll_name);665 ret = remove_collection_entry(storage_space, coll_name); 717 666 if(ret < 0) 718 667 { … … 729 678 printf("VERBOSE Creating temporary collection to migrate to.\n"); 730 679 ret = pvfs2_mkspace( 731 data_storage_space, 732 meta_storage_space, 680 storage_space, 733 681 coll_name, 734 682 coll_id, … … 751 699 PVFS_perror("PINT_dist_initialize", ret); 752 700 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 753 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);701 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 754 702 return(-1); 755 703 } … … 757 705 /* initialize trove and lookup collection */ 758 706 ret = trove_initialize( 759 TROVE_METHOD_DBPF, NULL, data_storage_space, meta_storage_space,0);707 TROVE_METHOD_DBPF, NULL, storage_space, 0); 760 708 if (ret < 0) 761 709 { 762 710 PVFS_perror("trove_initialize", ret); 763 711 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 764 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);712 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 765 713 return(-1); 766 714 } … … 771 719 fprintf(stderr, "Error: failed to lookup new collection.\n"); 772 720 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 773 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);721 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 774 722 return -1; 775 723 } … … 789 737 fprintf(stderr, "Error: failed to migrate collection extended attributes.\n"); 790 738 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 791 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);739 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 792 740 return(-1); 793 741 } … … 800 748 fprintf(stderr, "Error: failed to migrate dspace attributes.\n"); 801 749 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 802 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);750 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 803 751 return(-1); 804 752 } … … 811 759 fprintf(stderr, "Error: failed to migrate keyvals.\n"); 812 760 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 813 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);761 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 814 762 return(-1); 815 763 } … … 822 770 /* convert bstreams */ 823 771 ret = translate_bstreams_0_0_1( 824 data_storage_space, old_coll_path, coll_id, coll_name, trove_context);772 storage_space, old_coll_path, coll_id, coll_name, trove_context); 825 773 if(ret < 0) 826 774 { 827 775 fprintf(stderr, "Error: failed to migrate bstreams.\n"); 828 776 if(verbose) printf("VERBOSE Destroying temporary collection.\n"); 829 pvfs2_rmspace( data_storage_space, meta_storage_space, coll_name, coll_id, 1, 0);777 pvfs2_rmspace(storage_space, coll_name, coll_id, 1, 0); 830 778 return(-1); 831 779 } … … 846 794 } 847 795 848 static int remove_collection_entry(char* meta_storage_space, char* collname)796 static int remove_collection_entry(char* storage_space, char* collname) 849 797 { 850 798 char collections_db[PATH_MAX]; … … 854 802 TROVE_coll_id coll_id; 855 803 856 sprintf(collections_db, "%s/collections.db", meta_storage_space);804 sprintf(collections_db, "%s/collections.db", storage_space); 857 805 858 806 ret = access(collections_db, F_OK); … … 1545 1493 */ 1546 1494 static int translate_bstreams_0_0_1( 1547 char* data_storage_space, /**< path to trove storage space */1495 char* storage_space, /**< path to trove storage space */ 1548 1496 char* old_coll_path, /**< path to old collection */ 1549 1497 TROVE_coll_id coll_id, /**< collection id */ … … 1582 1530 old_coll_path, i, tmp_ent->d_name); 1583 1531 snprintf(new_bstream_file, PATH_MAX, "%s/%08x/bstreams/%.8d/%s", 1584 data_storage_space, coll_id, i, tmp_ent->d_name);1532 storage_space, coll_id, i, tmp_ent->d_name); 1585 1533 /* hard link to new location */ 1586 1534 ret = link(bstream_file, new_bstream_file); -
trunk/src/apps/admin/pvfs2-mkspace.c
r7952 r7958 32 32 char data_ranges[PATH_MAX]; 33 33 char collection[PATH_MAX]; 34 char data_space[PATH_MAX]; 35 char meta_space[PATH_MAX]; 34 char storage_space[PATH_MAX]; 36 35 } options_t; 37 36 … … 55 54 {"verbose",0,0,0}, 56 55 {"defaults",0,0,0}, 57 {"data-space",1,0,0}, 58 {"meta-space",1,0,0}, 56 {"storage-space",1,0,0}, 59 57 {"coll-id",1,0,0}, 60 58 {"coll-name",1,0,0}, … … 73 71 } 74 72 75 while ((ret = getopt_long(argc, argv, " c:i:r:vVhadDM:N:",73 while ((ret = getopt_long(argc, argv, "s:c:i:r:vVhadDM:N:", 76 74 long_opts, &option_index)) != -1) 77 75 { … … 93 91 goto do_verbose; 94 92 } 95 else if (strcmp("data-space", cur_option) == 0) 96 { 97 strncpy(opts->data_space, optarg, PATH_MAX); 98 } 99 else if (strcmp("meta-space", cur_option) == 0) 100 { 101 strncpy(opts->meta_space, optarg, PATH_MAX); 102 } 93 else if (strcmp("storage-space", cur_option) == 0) 94 { 95 goto do_storage_space; 96 } 103 97 else if (strcmp("coll-id", cur_option) == 0) 104 98 { … … 179 173 do_data_handle_range: 180 174 strncpy(opts->data_ranges, optarg, PATH_MAX); 175 break; 176 case 's': 177 do_storage_space: 178 strncpy(opts->storage_space, optarg, PATH_MAX); 181 179 break; 182 180 case 'v': … … 226 224 (strlen(opts->data_ranges) ? 227 225 opts->data_ranges : "None specified")); 228 printf("\tdata storage space : %s\n", 229 (strlen(opts->data_space) ? 230 opts->data_space : "None specified")); 231 printf("metadata storage space : %s\n", 232 (strlen(opts->meta_space) ? 233 opts->meta_space : "None specified")); 226 printf("\tstorage space : %s\n", 227 (strlen(opts->storage_space) ? 228 opts->storage_space : "None specified")); 234 229 } 235 230 } … … 264 259 "create collection with the specified\n " 265 260 " data handle range\n"); 266 fprintf(stderr," --data-space=PATH " 267 "create data storage space at this location\n"); 268 fprintf(stderr," --meta-space=PATH " 269 "create metadata storage space at this location\n"); 261 fprintf(stderr," -s, --storage-space=PATH " 262 "create storage space at this location\n"); 270 263 fprintf(stderr," -v, --verbose " 271 264 "operate in verbose mode\n"); … … 304 297 print_options(&opts); 305 298 306 if (strlen(opts.data_space) == 0) 307 { 308 fprintf(stderr, "Error: You MUST specify a data storage space\n"); 309 return -1; 310 } 311 312 if (strlen(opts.meta_space) == 0) 313 { 314 fprintf(stderr, "Error: You MUST specify a metadata storage space\n"); 299 if (strlen(opts.storage_space) == 0) 300 { 301 fprintf(stderr, "Error: You MUST specify a storage space\n"); 315 302 return -1; 316 303 } … … 332 319 if (opts.delete_storage) 333 320 { 334 ret = pvfs2_rmspace(opts. data_space, opts.meta_space,335 opts.collection, opts.coll_id, 336 opts.collection_only,opts.verbose);321 ret = pvfs2_rmspace(opts.storage_space, opts.collection, 322 opts.coll_id, opts.collection_only, 323 opts.verbose); 337 324 } 338 325 else 339 326 { 340 ret = pvfs2_mkspace(opts.data_space, opts.meta_space, 341 opts.collection, opts.coll_id, 342 opts.root_handle, opts.meta_ranges, 343 opts.data_ranges, opts.collection_only, 344 opts.verbose); 327 ret = pvfs2_mkspace(opts.storage_space, opts.collection, 328 opts.coll_id, opts.root_handle, 329 opts.meta_ranges, opts.data_ranges, 330 opts.collection_only, opts.verbose); 345 331 } 346 332 return ret; -
trunk/src/apps/admin/pvfs2-showcoll.c
r7952 r7958 24 24 size_t strnlen(const char *s, size_t limit); 25 25 26 static char data_path[PATH_MAX] = "/tmp/pvfs2-test-space"; 27 static char meta_path[PATH_MAX] = "/tmp/pvfs2-test-space"; 26 static char storage_space[PATH_MAX] = "/tmp/pvfs2-test-space"; 28 27 static char collection[PATH_MAX]; 29 28 static int verbose = 0, got_collection = 0, print_keyvals = 0, got_dspace_handle = 0; … … 73 72 /* initialize trove, verifying storage space exists */ 74 73 ret = trove_initialize( 75 TROVE_METHOD_DBPF, NULL, data_path, meta_path, 0);74 TROVE_METHOD_DBPF, NULL, storage_space, 0); 76 75 if (ret < 0) 77 76 { … … 83 82 84 83 if (verbose) fprintf(stderr, 85 "%s: info: initialized with storage space s '%s' and'%s'.\n",84 "%s: info: initialized with storage space '%s'.\n", 86 85 argv[0], 87 data_path, meta_path);86 storage_space); 88 87 89 88 /* if no collection was specified, simply print out the collections and exit */ … … 166 165 if (no_root_handle) { 167 166 fprintf(stdout, 168 "Storage space %s and %s, collection %s (coll_id = %d, "167 "Storage space %s, collection %s (coll_id = %d, " 169 168 "*** no root_handle found ***):\n", 170 data_path, 171 meta_path, 169 storage_space, 172 170 collection, 173 171 coll_id); … … 175 173 else { 176 174 fprintf(stdout, 177 "Storage space %s and %s, collection %s (coll_id = %d, "175 "Storage space %s, collection %s (coll_id = %d, " 178 176 "root_handle = 0x%08llx):\n", 179 data_path, 180 meta_path, 177 storage_space, 181 178 collection, 182 179 coll_id, … … 204 201 int c; 205 202 206 while ((c = getopt(argc, argv, "s: m:c:d:kvh")) != EOF) {203 while ((c = getopt(argc, argv, "s:c:d:kvh")) != EOF) { 207 204 switch (c) { 208 205 case 's': 209 strncpy( data_path, optarg, PATH_MAX);206 strncpy(storage_space, optarg, PATH_MAX); 210 207 break; 211 case 'm':212 strncpy(meta_path, optarg, PATH_MAX);213 208 case 'c': /* collection */ 214 209 got_collection = 1; … … 230 225 case 'h': 231 226 fprintf(stderr, 232 "usage: pvfs2-showcoll [-s data_storage_space] [-m metadata storagespace] [-c collection_name] [-d dspace_handle] [-v] [-k] [-h]\n");227 "usage: pvfs2-showcoll [-s storage_space] [-c collection_name] [-d dspace_handle] [-v] [-k] [-h]\n"); 233 228 fprintf(stderr, "\tdefault storage space is '/tmp/pvfs2-test-space'.\n"); 234 229 fprintf(stderr, "\t'-v' turns on verbose output.\n"); … … 504 499 pos = TROVE_ITERATE_START; 505 500 506 fprintf(stdout, "Storage space %s and %s collections:\n", 507 data_path, meta_path); 501 fprintf(stdout, "Storage space %s collections:\n", storage_space); 508 502 509 503 while (count > 0) { -
trunk/src/common/misc/mkspace.c
r7952 r7958 112 112 113 113 int pvfs2_mkspace( 114 char *data_path, 115 char *meta_path, 114 char *storage_space, 116 115 char *collection, 117 116 TROVE_coll_id coll_id, … … 136 135 TROVE_handle lost_and_found_dirdata_handle = TROVE_HANDLE_NULL; 137 136 138 mkspace_print(verbose,"Data storage space : %s\n",data_path); 139 mkspace_print(verbose,"Metadata storage space : %s\n", meta_path); 137 mkspace_print(verbose,"Storage space: %s\n",storage_space); 140 138 mkspace_print(verbose,"Collection : %s\n",collection); 141 139 mkspace_print(verbose,"ID : %d\n",coll_id); … … 162 160 ret = trove_initialize(TROVE_METHOD_DBPF, 163 161 NULL, 164 data_path, 165 meta_path, 162 storage_space, 166 163 0); 167 164 if (ret > -1) 168 165 { 169 gossip_err("error: storage space %s or %salready "170 "exists; aborting!\n", data_path,meta_path);171 return -1; 172 } 173 174 ret = trove_storage_create(TROVE_METHOD_DBPF, data_path, meta_path, NULL, &op_id);166 gossip_err("error: storage space %s already " 167 "exists; aborting!\n",storage_space); 168 return -1; 169 } 170 171 ret = trove_storage_create(TROVE_METHOD_DBPF, storage_space, NULL, &op_id); 175 172 if (ret != 1) 176 173 { … … 183 180 ret = trove_initialize( 184 181 TROVE_METHOD_DBPF, NULL, 185 data_path, meta_path, 0);182 storage_space, 0); 186 183 if (ret < 0) 187 184 { … … 190 187 } 191 188 192 mkspace_print(verbose,"info: created data storage space '%s'.\n", 193 data_path); 194 mkspace_print(verbose,"info: created metadata storage space '%s'.\n", 195 meta_path); 189 mkspace_print(verbose,"info: created storage space '%s'.\n", 190 storage_space); 196 191 197 192 /* try to look up collection used to store file system */ … … 642 637 643 638 int pvfs2_rmspace( 644 char *data_path, 645 char *meta_path, 639 char *storage_space, 646 640 char *collection, 647 641 TROVE_coll_id coll_id, … … 658 652 ret = trove_initialize( 659 653 TROVE_METHOD_DBPF, NULL, 660 data_path, meta_path, 0);654 storage_space, 0); 661 655 if (ret == -1) 662 656 { 663 gossip_err("error: storage space %s or %sdoes not "664 "exist; aborting!\n", data_path, meta_path);657 gossip_err("error: storage space %s does not " 658 "exist; aborting!\n", storage_space); 665 659 return -1; 666 660 } … … 680 674 if (!remove_collection_only) 681 675 { 682 ret = trove_storage_remove( TROVE_METHOD_DBPF, data_path, meta_path,683 NULL, &op_id);676 ret = trove_storage_remove( 677 TROVE_METHOD_DBPF, storage_space, NULL, &op_id); 684 678 /* 685 679 * it is a bit weird to do a trove_finaliz() prior to blowing away … … 689 683 trove_finalize(TROVE_METHOD_DBPF); 690 684 mkspace_print( 691 verbose, "PVFS2 Storage Space %s and %sremoved %s\n",692 data_path, meta_path, (((ret == 1) || (ret == -TROVE_ENOENT)) ?685 verbose, "PVFS2 Storage Space %s removed %s\n", 686 storage_space, (((ret == 1) || (ret == -TROVE_ENOENT)) ? 693 687 "successfully" : "with errors")); 694 688 -
trunk/src/common/misc/mkspace.h
r7952 r7958 14 14 15 15 int pvfs2_mkspace( 16 char *data_path, 17 char *meta_path, 16 char *storage_space, 18 17 char *collection, 19 18 TROVE_coll_id coll_id, … … 25 24 26 25 int pvfs2_rmspace( 27 char *data_path, 28 char *meta_path, 26 char *storage_space, 29 27 char *collection, 30 28 TROVE_coll_id coll_id, -
trunk/src/common/misc/server-config.c
r7952 r7958 35 35 36 36 static DOTCONF_CB(get_logstamp); 37 static DOTCONF_CB(get_data_path); 38 static DOTCONF_CB(get_meta_path); 37 static DOTCONF_CB(get_storage_space); 39 38 static DOTCONF_CB(enter_defaults_context); 40 39 static DOTCONF_CB(exit_defaults_context); … … 552 551 CTX_DEFAULTS|CTX_SERVER_OPTIONS,"50"}, 553 552 554 /* Specifies the local path for the pvfs2 server to use as storage space 555 * for data files. This option specifies the default path for all servers556 * and will appearin the Defaults context.553 /* Specifies the local path for the pvfs2 server to use as storage space. 554 * This option specifies the default path for all servers and will appear 555 * in the Defaults context. 557 556 * 558 557 * NOTE: This can be overridden in the <ServerOptions> tag on a per-server … … 560 559 * Example: 561 560 * 562 * DataStorageSpace /tmp/pvfs-data.storage 563 */ 564 {"DataStorageSpace",ARG_STR, get_data_path,NULL, 565 CTX_DEFAULTS|CTX_SERVER_OPTIONS,NULL}, 566 567 /* Specifies the local path for the pvfs2 server to use as storage space 568 * for metadata files. This option specifies the default path for all 569 * servers and will appear in the Defaults context. 570 * 571 * NOTE: This can be overridden in the <ServerOptions> tag on a per-server 572 * basis. Look at the "Option" tag for more details 573 * Example: 574 * 575 * MetadataStorageSpace /tmp/pvfs-meta.storage 576 */ 577 {"MetadataStorageSpace",ARG_STR, get_meta_path,NULL, 561 * StorageSpace /tmp/pvfs.storage 562 */ 563 {"StorageSpace",ARG_STR, get_storage_space,NULL, 578 564 CTX_DEFAULTS|CTX_SERVER_OPTIONS,NULL}, 579 565 … … 1063 1049 } 1064 1050 1065 if (server_alias_name && !config_s-> data_path)1051 if (server_alias_name && !config_s->storage_path) 1066 1052 { 1067 1053 gossip_err("Configuration file error. " 1068 "No data storage path specified for alias %s.\n", server_alias_name); 1069 return 1; 1070 } 1071 1072 if (server_alias_name && !config_s->meta_path) 1073 { 1074 gossip_err("Configuration file error. " 1075 "No metadata storage path specified for alias %s.\n", server_alias_name); 1054 "No storage path specified for alias %s.\n", server_alias_name); 1076 1055 return 1; 1077 1056 } … … 1157 1136 1158 1137 1159 DOTCONF_CB(get_ data_path)1138 DOTCONF_CB(get_storage_space) 1160 1139 { 1161 1140 struct server_configuration_s *config_s = … … 1166 1145 return NULL; 1167 1146 } 1168 if (config_s->data_path) 1169 { 1170 free(config_s->data_path); 1171 } 1172 config_s->data_path = 1173 (cmd->data.str ? strdup(cmd->data.str) : NULL); 1174 return NULL; 1175 } 1176 1177 DOTCONF_CB(get_meta_path) 1178 { 1179 struct server_configuration_s *config_s = 1180 (struct server_configuration_s *)cmd->context; 1181 if(config_s->configuration_context == CTX_SERVER_OPTIONS && 1182 config_s->my_server_options == 0) 1183 { 1184 return NULL; 1185 } 1186 if (config_s->meta_path) 1187 { 1188 free(config_s->meta_path); 1189 } 1190 config_s->meta_path = 1147 if (config_s->storage_path) 1148 { 1149 free(config_s->storage_path); 1150 } 1151 config_s->storage_path = 1191 1152 (cmd->data.str ? strdup(cmd->data.str) : NULL); 1192 1153 return NULL; … … 2877 2838 } 2878 2839 2879 if (config_s->data_path) 2880 { 2881 free(config_s->data_path); 2882 config_s->data_path = NULL; 2883 } 2884 2885 if (config_s->meta_path) 2886 { 2887 free(config_s->meta_path); 2888 config_s->meta_path = NULL; 2840 if (config_s->storage_path) 2841 { 2842 free(config_s->storage_path); 2843 config_s->storage_path = NULL; 2889 2844 } 2890 2845 … … 4386 4341 4387 4342 ret = pvfs2_mkspace( 4388 config-> data_path, config->meta_path, cur_fs->file_system_name,4343 config->storage_path, cur_fs->file_system_name, 4389 4344 cur_fs->coll_id, root_handle, cur_meta_handle_range, 4390 4345 cur_data_handle_range, create_collection_only, 1); … … 4441 4396 (remove_collection_only ? "collection" : 4442 4397 "storage space")); 4443 ret = pvfs2_rmspace(config->data_path, 4444 config->meta_path, 4398 ret = pvfs2_rmspace(config->storage_path, 4445 4399 cur_fs->file_system_name, 4446 4400 cur_fs->coll_id, -
trunk/src/common/misc/server-config.h
r7952 r7958 146 146 char *server_alias; /* the command line server-alias parameter */ 147 147 int my_server_options; 148 char *data_path; /* path to data storage directory */ 149 char *meta_path; /* path to metadata storage directory */ 148 char *storage_path; 150 149 char *fs_config_filename; /* the fs.conf file name */ 151 150 size_t fs_config_buflen; /* the fs.conf file length */ -
trunk/src/io/trove/trove-dbpf/dbpf-dspace.c
r7952 r7958 2116 2116 * somehow 2117 2117 */ 2118 DBPF_GET_BSTREAM_FILENAME(filename, PATH_MAX, my_storage_p-> data_path,2118 DBPF_GET_BSTREAM_FILENAME(filename, PATH_MAX, my_storage_p->name, 2119 2119 coll_p->coll_id, llu(new_handle)); 2120 2120 ret = access(filename, F_OK); … … 2129 2129 2130 2130 DBPF_GET_STRANDED_BSTREAM_FILENAME(new_filename, PATH_MAX, 2131 my_storage_p-> data_path,2131 my_storage_p->name, 2132 2132 coll_p->coll_id, 2133 2133 llu(new_handle)); -
trunk/src/io/trove/trove-dbpf/dbpf-mgmt.c
r7952 r7958 292 292 } 293 293 294 static int dbpf_db_create(char *dbname, 294 static int dbpf_db_create(const char *sto_path, 295 char *dbname, 295 296 DB_ENV *envp, 296 297 uint32_t flags); 297 298 static DB *dbpf_db_open( 298 c har *dbname, DB_ENV *envp, int *err_p,299 const char *sto_path, char *dbname, DB_ENV *envp, int *err_p, 299 300 int (*compare_fn) (DB *db, const DBT *dbt1, const DBT *dbt2), uint32_t flags); 300 301 static int dbpf_mkpath(char *pathname, mode_t mode); … … 329 330 TROVE_statfs *tmp_trove_statfs = (TROVE_statfs *)parameter; 330 331 331 /* XXX: this is not entirely accurate when data and metadata 332 * are stored on different devices. 333 */ 334 DBPF_GET_DATA_DIRNAME(path_name, PATH_MAX, sto_p->data_path); 332 DBPF_GET_STORAGE_DIRNAME(path_name, PATH_MAX, sto_p->name); 335 333 ret = PINT_statfs_lookup(path_name, &tmp_statfs); 336 334 if (ret < 0) … … 572 570 } 573 571 574 static int dbpf_initialize(char *data_path, 575 char *meta_path, 572 static int dbpf_initialize(char *stoname, 576 573 TROVE_ds_flags flags) 577 574 { … … 672 669 dbpf_pid = getpid(); 673 670 674 if (! data_path)675 { 676 gossip_err("dbpf_initialize failure: invalid data storage path\n");671 if (!stoname) 672 { 673 gossip_err("dbpf_initialize failure: invalid storage name\n"); 677 674 return ret; 678 675 } 679 676 680 if (!meta_path) 681 { 682 gossip_err("dbpf_initialize failure: invalid metadata storage path\n"); 683 return ret; 684 } 685 686 sto_p = dbpf_storage_lookup(data_path, meta_path, &ret, flags); 677 sto_p = dbpf_storage_lookup(stoname, &ret, flags); 687 678 if (sto_p == NULL) 688 679 { … … 777 768 } 778 769 779 static int dbpf_direct_initialize(char *data_path, 780 char *meta_path, 781 TROVE_ds_flags flags) 770 static int dbpf_direct_initialize(char *stoname, TROVE_ds_flags flags) 782 771 { 783 772 int ret; 784 773 785 774 /* some parts of initialization are shared with other methods */ 786 ret = dbpf_initialize( data_path, meta_path, flags);775 ret = dbpf_initialize(stoname, flags); 787 776 if(ret < 0) 788 777 { … … 848 837 } 849 838 850 free(my_storage_p->data_path); 851 free(my_storage_p->meta_path); 839 free(my_storage_p->name); 852 840 free(my_storage_p); 853 841 my_storage_p = NULL; … … 863 851 * - creating collections database, filling in create time 864 852 */ 865 int dbpf_storage_create(char *data_path, 866 char *meta_path, 853 int dbpf_storage_create(char *stoname, 867 854 void *user_ptr, 868 855 TROVE_op_id *out_op_id_p) 869 856 { 870 857 int ret = -TROVE_EINVAL; 871 char data_dirname[PATH_MAX] = {0}; 872 char meta_dirname[PATH_MAX] = {0}; 858 char storage_dirname[PATH_MAX] = {0}; 873 859 char sto_attrib_dbname[PATH_MAX] = {0}; 874 860 char collections_dbname[PATH_MAX] = {0}; 875 861 876 DBPF_GET_ DATA_DIRNAME(data_dirname, PATH_MAX, data_path);877 ret = dbpf_mkpath( data_dirname, 0755);862 DBPF_GET_STORAGE_DIRNAME(storage_dirname, PATH_MAX, stoname); 863 ret = dbpf_mkpath(storage_dirname, 0755); 878 864 if (ret != 0) 879 865 { … … 881 867 } 882 868 883 DBPF_GET_ META_DIRNAME(meta_dirname, PATH_MAX, meta_path);884 ret = dbpf_ mkpath(meta_dirname, 0755);869 DBPF_GET_STO_ATTRIB_DBNAME(sto_attrib_dbname, PATH_MAX, stoname); 870 ret = dbpf_db_create(storage_dirname, sto_attrib_dbname, NULL, 0); 885 871 if (ret != 0) 886 872 { 887 return ret;888 }889 890 DBPF_GET_STO_ATTRIB_DBNAME(sto_attrib_dbname, PATH_MAX, meta_path);891 ret = dbpf_db_create(sto_attrib_dbname, NULL, 0);892 if (ret != 0)893 {894 873 return ret; 895 874 } 896 875 897 DBPF_GET_COLLECTIONS_DBNAME(collections_dbname, PATH_MAX, meta_path);898 ret = dbpf_db_create( collections_dbname, NULL, DB_RECNUM);876 DBPF_GET_COLLECTIONS_DBNAME(collections_dbname, PATH_MAX, stoname); 877 ret = dbpf_db_create(storage_dirname, collections_dbname, NULL, DB_RECNUM); 899 878 if (ret != 0) 900 879 { … … 907 886 } 908 887 909 int dbpf_storage_remove(char *data_path, 910 char *meta_path, 911 void *user_ptr, 912 TROVE_op_id *out_op_id_p) 888 int dbpf_storage_remove(char *stoname, 889 void *user_ptr, 890 TROVE_op_id *out_op_id_p) 913 891 { 914 892 int ret = -TROVE_EINVAL; … … 918 896 db_close(my_storage_p->sto_attr_db); 919 897 db_close(my_storage_p->coll_db); 920 free(my_storage_p->meta_path); 921 free(my_storage_p->data_path); 898 free(my_storage_p->name); 922 899 free(my_storage_p); 923 900 my_storage_p = NULL; 924 901 } 925 926 DBPF_GET_STO_ATTRIB_DBNAME(path_name, PATH_MAX, meta_path); 902 DBPF_GET_STO_ATTRIB_DBNAME(path_name, PATH_MAX, stoname); 927 903 gossip_debug(GOSSIP_TROVE_DEBUG, "Removing %s\n", path_name); 928 904 … … 933 909 } 934 910 935 DBPF_GET_COLLECTIONS_DBNAME(path_name, PATH_MAX, meta_path);911 DBPF_GET_COLLECTIONS_DBNAME(path_name, PATH_MAX, stoname); 936 912 gossip_debug(GOSSIP_TROVE_DEBUG, "Removing %s\n", path_name); 937 913 … … 942 918 } 943 919 944 DBPF_GET_ META_DIRNAME(path_name, PATH_MAX, meta_path);920 DBPF_GET_STORAGE_DIRNAME(path_name, PATH_MAX, stoname); 945 921 gossip_debug(GOSSIP_TROVE_DEBUG, "Removing %s\n", path_name); 946 922 if (rmdir(path_name) != 0) 947 923 { 948 perror("failure removing metadata directory"); 949 ret = -trove_errno_to_trove_error(errno); 950 goto storage_remove_failure; 951 } 952 953 DBPF_GET_DATA_DIRNAME(path_name, PATH_MAX, data_path); 954 gossip_debug(GOSSIP_TROVE_DEBUG, "Removing %s\n", path_name); 955 if (rmdir(path_name) != 0) 956 { 957 perror("failure removing data directory"); 924 perror("failure removing storage space"); 958 925 ret = -trove_errno_to_trove_error(errno); 959 926 goto storage_remove_failure; … … 1042 1009 } 1043 1010 1044 DBPF_GET_ DATA_DIRNAME(path_name, PATH_MAX, sto_p->data_path);1011 DBPF_GET_STORAGE_DIRNAME(path_name, PATH_MAX, sto_p->name); 1045 1012 ret = stat(path_name, &dirstat); 1046 1013 if (ret < 0 && errno != ENOENT) 1047 1014 { 1048 gossip_err("stat failed on datadirectory %s\n", path_name);1015 gossip_err("stat failed on storage directory %s\n", path_name); 1049 1016 return -trove_errno_to_trove_error(errno); 1050 1017 } … … 1054 1021 if (ret != 0) 1055 1022 { 1056 gossip_err("mkdir failed on datadirectory %s\n", path_name);1023 gossip_err("mkdir failed on storage directory %s\n", path_name); 1057 1024 return -trove_errno_to_trove_error(errno); 1058 1025 } 1059 1026 } 1060 1027 1061 DBPF_GET_META_DIRNAME(path_name, PATH_MAX, sto_p->meta_path); 1062 ret = stat(path_name, &dirstat); 1063 if (ret < 0 && errno != ENOENT) 1064 { 1065 gossip_err("stat failed on metadata directory %s\n", path_name); 1066 return -trove_errno_to_trove_error(errno); 1067 } 1068 else if (ret < 0) 1069 { 1070 ret = mkdir(path_name, 0755); 1071 if (ret != 0) 1072 { 1073 gossip_err("mkdir failed on metadata directory %s\n", path_name); 1074 return -trove_errno_to_trove_error(errno); 1075 } 1076 } 1077 1078 1079 DBPF_GET_COLL_DIRNAME(path_name, PATH_MAX, sto_p->data_path, new_coll_id); 1028 DBPF_GET_COLL_DIRNAME(path_name, PATH_MAX, sto_p->name, new_coll_id); 1080 1029 ret = mkdir(path_name, 0755); 1081 1030 if (ret != 0) 1082 1031 { 1083 gossip_err("mkdir failed on data collection directory %s\n", 1084 path_name); 1032 gossip_err("mkdir failed on collection directory %s\n", path_name); 1085 1033 return -trove_errno_to_trove_error(errno); 1086 1034 } 1087 1035 1088 DBPF_GET_COLL_DIRNAME(path_name, PATH_MAX, sto_p->meta_path, new_coll_id);1089 ret = mkdir(path_name, 0755);1090 if (ret != 0)1091 {1092 gossip_err("mkdir failed on metadata collection directory %s\n",1093 path_name);1094 return -trove_errno_to_trove_error(errno);1095 }1096 1097 1036 DBPF_GET_COLL_ATTRIB_DBNAME(path_name, PATH_MAX, 1098 sto_p-> meta_path, new_coll_id);1037 sto_p->name, new_coll_id); 1099 1038 1100 1039 ret = stat(path_name, &dbstat); … … 1106 1045 else if(ret < 0) 1107 1046 { 1108 ret = dbpf_db_create(path_name, NULL, 0);1047 ret = dbpf_db_create(sto_p->name, path_name, NULL, 0); 1109 1048 if (ret != 0) 1110 1049 { … … 1114 1053 } 1115 1054 1116 db_p = dbpf_db_open( path_name, NULL, &error, NULL, 0);1055 db_p = dbpf_db_open(sto_p->name, path_name, NULL, &error, NULL, 0); 1117 1056 if (db_p == NULL) 1118 1057 { … … 1162 1101 db_close(db_p); 1163 1102 1164 DBPF_GET_DS_ATTRIB_DBNAME(path_name, PATH_MAX, sto_p->meta_path, 1165 new_coll_id); 1103 DBPF_GET_DS_ATTRIB_DBNAME(path_name, PATH_MAX, sto_p->name, new_coll_id); 1166 1104 ret = stat(path_name, &dbstat); 1167 1105 if(ret < 0 && errno != ENOENT) … … 1172 1110 if(ret < 0) 1173 1111 { 1174 ret = dbpf_db_create( path_name, NULL, 0);1112 ret = dbpf_db_create(sto_p->name, path_name, NULL, 0); 1175 1113 if (ret != 0) 1176 1114 { … … 1180 1118 } 1181 1119 1182 DBPF_GET_KEYVAL_DBNAME(path_name, PATH_MAX, sto_p-> meta_path, new_coll_id);1120 DBPF_GET_KEYVAL_DBNAME(path_name, PATH_MAX, sto_p->name, new_coll_id); 1183 1121 ret = stat(path_name, &dbstat); 1184 1122 if(ret < 0 && errno != ENOENT) … … 1189 1127 if(ret < 0) 1190 1128 { 1191 ret = dbpf_db_create( path_name, NULL, 0);1129 ret = dbpf_db_create(sto_p->name, path_name, NULL, 0); 1192 1130 if (ret != 0) 1193 1131 { … … 1197 1135 } 1198 1136 1199 DBPF_GET_BSTREAM_DIRNAME(path_name, PATH_MAX, sto_p->data_path, 1200 new_coll_id); 1137 DBPF_GET_BSTREAM_DIRNAME(path_name, PATH_MAX, sto_p->name, new_coll_id); 1201 1138 ret = mkdir(path_name, 0755); 1202 1139 if(ret != 0) … … 1217 1154 } 1218 1155 1219 DBPF_GET_STRANDED_BSTREAM_DIRNAME(path_name, PATH_MAX, sto_p-> data_path,1156 DBPF_GET_STRANDED_BSTREAM_DIRNAME(path_name, PATH_MAX, sto_p->name, 1220 1157 new_coll_id); 1221 1158 ret = mkdir(path_name, 0755); … … 1295 1232 db_close(db_collection->keyval_db); 1296 1233 /* so that environment can also be cleaned up */ 1297 dbpf_putdb_env(db_collection->coll_env, db_collection-> meta_path);1234 dbpf_putdb_env(db_collection->coll_env, db_collection->path_name); 1298 1235 dbpf_collection_deregister(db_collection); 1299 1236 free(db_collection->name); 1300 free(db_collection->meta_path); 1301 free(db_collection->data_path); 1237 free(db_collection->path_name); 1302 1238 PINT_dbpf_keyval_pcache_finalize(db_collection->pcache); 1303 1239 free(db_collection); … … 1305 1241 1306 1242 DBPF_GET_DS_ATTRIB_DBNAME(path_name, PATH_MAX, 1307 sto_p-> meta_path, db_data.coll_id);1243 sto_p->name, db_data.coll_id); 1308 1244 if (unlink(path_name) != 0) 1309 1245 { … … 1313 1249 1314 1250 DBPF_GET_KEYVAL_DBNAME(path_name, PATH_MAX, 1315 sto_p-> meta_path, db_data.coll_id);1251 sto_p->name, db_data.coll_id); 1316 1252 if(unlink(path_name) != 0) 1317 1253 { … … 1321 1257 1322 1258 DBPF_GET_COLL_ATTRIB_DBNAME(path_name, PATH_MAX, 1323 sto_p-> meta_path, db_data.coll_id);1259 sto_p->name, db_data.coll_id); 1324 1260 if (unlink(path_name) != 0) 1325 1261 { … … 1329 1265 1330 1266 DBPF_GET_BSTREAM_DIRNAME(path_name, PATH_MAX, 1331 sto_p-> data_path, db_data.coll_id);1267 sto_p->name, db_data.coll_id); 1332 1268 for(i = 0; i < DBPF_BSTREAM_MAX_NUM_BUCKETS; i++) 1333 1269 { … … 1375 1311 1376 1312 DBPF_GET_STRANDED_BSTREAM_DIRNAME(path_name, PATH_MAX, 1377 sto_p-> data_path, db_data.coll_id);1313 sto_p->name, db_data.coll_id); 1378 1314 1379 1315 /* remove stranded bstreams directory */ … … 1418 1354 1419 1355 DBPF_GET_COLL_DIRNAME(path_name, PATH_MAX, 1420 sto_p->meta_path, db_data.coll_id);1356 sto_p->name, db_data.coll_id); 1421 1357 if (rmdir(path_name) != 0) 1422 1358 { 1423 gossip_err("failure removing metadata collection directory\n"); 1424 ret = -trove_errno_to_trove_error(errno); 1425 goto collection_remove_failure; 1426 } 1427 1428 DBPF_GET_COLL_DIRNAME(path_name, PATH_MAX, 1429 sto_p->data_path, db_data.coll_id); 1430 if (rmdir(path_name) != 0) 1431 { 1432 gossip_err("failure removing data collection directory\n"); 1359 gossip_err("failure removing collection directory\n"); 1433 1360 ret = -trove_errno_to_trove_error(errno); 1434 1361 } … … 1651 1578 } 1652 1579 1653 dbpf_putdb_env(coll_p->coll_env, coll_p-> meta_path);1580 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1654 1581 free(coll_p->name); 1655 free(coll_p->data_path); 1656 free(coll_p->meta_path); 1582 free(coll_p->path_name); 1657 1583 PINT_dbpf_keyval_pcache_finalize(coll_p->pcache); 1658 1584 … … 1762 1688 return -TROVE_ENOMEM; 1763 1689 } 1764 /* Path to data collection dir */ 1765 snprintf(path_name, PATH_MAX, "/%s/%08x/", sto_p->data_path, 1766 coll_p->coll_id); 1767 coll_p->data_path = strdup(path_name); 1768 if (!coll_p->data_path) 1690 /* Path to collection */ 1691 snprintf(path_name, PATH_MAX, "/%s/%08x/", sto_p->name, coll_p->coll_id); 1692 coll_p->path_name = strdup(path_name); 1693 if (!coll_p->path_name) 1769 1694 { 1770 1695 free(coll_p->name); … … 1772 1697 return -TROVE_ENOMEM; 1773 1698 } 1774 1775 snprintf(path_name, PATH_MAX, "/%s/%08x/", 1776 sto_p->meta_path, coll_p->coll_id); 1777 coll_p->meta_path = strdup(path_name); 1778 if (!coll_p->meta_path) 1779 { 1780 free(coll_p->data_path); 1781 free(coll_p->name); 1782 free(coll_p); 1783 return -TROVE_ENOMEM; 1784 } 1785 1786 if ((coll_p->coll_env = dbpf_getdb_env(coll_p->meta_path, COLL_ENV_FLAGS, &ret)) == NULL) 1787 { 1788 free(coll_p->meta_path); 1789 free(coll_p->data_path); 1699 /* per-collection environment */ 1700 if ((coll_p->coll_env = dbpf_getdb_env(coll_p->path_name, COLL_ENV_FLAGS, &ret)) == NULL) 1701 { 1702 free(coll_p->path_name); 1790 1703 free(coll_p->name); 1791 1704 free(coll_p); … … 1794 1707 1795 1708 DBPF_GET_COLL_ATTRIB_DBNAME(path_name, PATH_MAX, 1796 sto_p->meta_path, coll_p->coll_id); 1797 1798 coll_p->coll_attr_db = dbpf_db_open(path_name, coll_p->coll_env, 1709 sto_p->name, coll_p->coll_id); 1710 coll_p->coll_attr_db = dbpf_db_open(sto_p->name, path_name, coll_p->coll_env, 1799 1711 &ret, NULL, 0); 1800 1712 if (coll_p->coll_attr_db == NULL) 1801 1713 { 1802 dbpf_putdb_env(coll_p->coll_env, coll_p->meta_path); 1803 free(coll_p->meta_path); 1804 free(coll_p->data_path); 1714 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1715 free(coll_p->path_name); 1805 1716 free(coll_p->name); 1806 1717 free(coll_p); … … 1826 1737 db_strerror(ret)); 1827 1738 db_close(coll_p->coll_attr_db); 1828 dbpf_putdb_env(coll_p->coll_env, coll_p->meta_path); 1829 free(coll_p->meta_path); 1830 free(coll_p->data_path); 1739 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1740 free(coll_p->path_name); 1831 1741 free(coll_p->name); 1832 1742 free(coll_p); … … 1870 1780 { 1871 1781 db_close(coll_p->coll_attr_db); 1872 dbpf_putdb_env(coll_p->coll_env, coll_p->meta_path); 1873 free(coll_p->meta_path); 1874 free(coll_p->data_path); 1782 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1783 free(coll_p->path_name); 1875 1784 free(coll_p->name); 1876 1785 free(coll_p); … … 1884 1793 1885 1794 DBPF_GET_DS_ATTRIB_DBNAME(path_name, PATH_MAX, 1886 sto_p-> meta_path, coll_p->coll_id);1795 sto_p->name, coll_p->coll_id); 1887 1796 1888 1797 if(sto_major == 0 && sto_minor == 1 && sto_inc < 3) … … 1890 1799 /* use old comparison function */ 1891 1800 coll_p->ds_db = dbpf_db_open( 1892 path_name, coll_p->coll_env, &ret,1801 sto_p->name, path_name, coll_p->coll_env, &ret, 1893 1802 &PINT_trove_dbpf_ds_attr_compare_reversed, 0); 1894 1803 } … … 1899 1808 */ 1900 1809 coll_p->ds_db = dbpf_db_open( 1901 path_name, coll_p->coll_env, &ret,1810 sto_p->name, path_name, coll_p->coll_env, &ret, 1902 1811 &PINT_trove_dbpf_ds_attr_compare, 0); 1903 1812 } … … 1906 1815 { 1907 1816 db_close(coll_p->coll_attr_db); 1908 dbpf_putdb_env(coll_p->coll_env, coll_p->meta_path); 1909 free(coll_p->meta_path); 1910 free(coll_p->data_path); 1817 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1818 free(coll_p->path_name); 1911 1819 free(coll_p->name); 1912 1820 free(coll_p); … … 1915 1823 1916 1824 DBPF_GET_KEYVAL_DBNAME(path_name, PATH_MAX, 1917 sto_p->meta_path, coll_p->coll_id); 1918 1919 coll_p->keyval_db = dbpf_db_open(path_name, coll_p->coll_env, 1825 sto_p->name, coll_p->coll_id); 1826 coll_p->keyval_db = dbpf_db_open(sto_p->name, path_name, coll_p->coll_env, 1920 1827 &ret, PINT_trove_dbpf_keyval_compare, 0); 1921 1828 if(coll_p->keyval_db == NULL) … … 1923 1830 db_close(coll_p->coll_attr_db); 1924 1831 db_close(coll_p->ds_db); 1925 dbpf_putdb_env(coll_p->coll_env, coll_p->meta_path); 1926 free(coll_p->meta_path); 1927 free(coll_p->data_path); 1832 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1833 free(coll_p->path_name); 1928 1834 free(coll_p->name); 1929 1835 free(coll_p); … … 1937 1843 db_close(coll_p->keyval_db); 1938 1844 db_close(coll_p->ds_db); 1939 dbpf_putdb_env(coll_p->coll_env, coll_p->meta_path); 1940 free(coll_p->meta_path); 1941 free(coll_p->data_path); 1845 dbpf_putdb_env(coll_p->coll_env, coll_p->path_name); 1846 free(coll_p->path_name); 1942 1847 free(coll_p->name); 1943 1848 free(coll_p); … … 1977 1882 */ 1978 1883 struct dbpf_storage *dbpf_storage_lookup( 1979 char * data_path, char *meta_path, int *error_p, TROVE_ds_flags flags)1884 char *stoname, int *error_p, TROVE_ds_flags flags) 1980 1885 { 1981 1886 char path_name[PATH_MAX] = {0}; … … 1988 1893 } 1989 1894 1990 if (stat( data_path, &sbuf) < 0)1895 if (stat(stoname, &sbuf) < 0) 1991 1896 { 1992 1897 *error_p = -TROVE_ENOENT; … … 1996 1901 { 1997 1902 *error_p = -TROVE_EINVAL; 1998 gossip_err("%s is not a directory\n", data_path);1903 gossip_err("%s is not a directory\n", stoname); 1999 1904 return NULL; 2000 }2001 2002 if (stat(meta_path, &sbuf) < 0)2003 {2004 *error_p = -TROVE_ENOENT;2005 return NULL;2006 }2007 if (!S_ISDIR(sbuf.st_mode))2008 {2009 *error_p = -TROVE_EINVAL;2010 gossip_err("%s is not a directory\n", meta_path);2011 return NULL;2012 1905 } 2013 1906 … … 2020 1913 memset(sto_p, 0, sizeof(struct dbpf_storage)); 2021 1914 2022 sto_p-> data_path = strdup(data_path);2023 if (sto_p-> data_path== NULL)1915 sto_p->name = strdup(stoname); 1916 if (sto_p->name == NULL) 2024 1917 { 2025 1918 free(sto_p); … … 2027 1920 return NULL; 2028 1921 } 2029 sto_p->meta_path = strdup(meta_path);2030 if (sto_p->meta_path == NULL)2031 {2032 free(sto_p->data_path);2033 free(sto_p);2034 *error_p = -TROVE_ENOMEM;2035 return NULL;2036 }2037 1922 sto_p->refct = 0; 2038 1923 sto_p->flags = flags; 2039 1924 2040 DBPF_GET_STO_ATTRIB_DBNAME(path_name, PATH_MAX, meta_path);1925 DBPF_GET_STO_ATTRIB_DBNAME(path_name, PATH_MAX, stoname); 2041 1926 2042 1927 /* we want to stat the attrib db first in case it doesn't … … 2049 1934 } 2050 1935 2051 sto_p->sto_attr_db = dbpf_db_open( path_name, NULL,1936 sto_p->sto_attr_db = dbpf_db_open(sto_p->name, path_name, NULL, 2052 1937 error_p, NULL, 0); 2053 1938 if (sto_p->sto_attr_db == NULL) 2054 1939 { 2055 free(sto_p->meta_path); 2056 free(sto_p->data_path); 1940 free(sto_p->name); 2057 1941 free(sto_p); 2058 1942 my_storage_p = NULL; … … 2060 1944 } 2061 1945 2062 DBPF_GET_COLLECTIONS_DBNAME(path_name, PATH_MAX, meta_path);2063 2064 sto_p->coll_db = dbpf_db_open( path_name, NULL,1946 DBPF_GET_COLLECTIONS_DBNAME(path_name, PATH_MAX, stoname); 1947 1948 sto_p->coll_db = dbpf_db_open(sto_p->name, path_name, NULL, 2065 1949 error_p, NULL, DB_RECNUM); 2066 1950 if (sto_p->coll_db == NULL) 2067 1951 { 2068 1952 db_close(sto_p->sto_attr_db); 2069 free(sto_p->meta_path); 2070 free(sto_p->data_path); 1953 free(sto_p->name); 2071 1954 free(sto_p); 2072 1955 my_storage_p = NULL; … … 2205 2088 * a db plus files storage region. 2206 2089 */ 2207 static int dbpf_db_create(char *dbname, 2090 static int dbpf_db_create(const char *sto_path, 2091 char *dbname, 2208 2092 DB_ENV *envp, 2209 2093 uint32_t flags) … … 2248 2132 */ 2249 2133 static DB *dbpf_db_open( 2250 c har *dbname, DB_ENV *envp, int *error_p,2134 const char *sto_path, char *dbname, DB_ENV *envp, int *error_p, 2251 2135 int (*compare_fn) (DB *db, const DBT *dbt1, const DBT *dbt2), 2252 2136 uint32_t flags) -
trunk/src/io/trove/trove-dbpf/dbpf-open-cache.c
r7952 r7958 428 428 429 429 DBPF_GET_BSTREAM_FILENAME(filename, PATH_MAX, 430 my_storage_p-> data_path, coll_id, llu(handle));430 my_storage_p->name, coll_id, llu(handle)); 431 431 432 432 ret = fast_unlink(filename, coll_id, handle); … … 460 460 461 461 DBPF_GET_BSTREAM_FILENAME(filename, PATH_MAX, 462 my_storage_p-> data_path, coll_id, llu(handle));462 my_storage_p->name, coll_id, llu(handle)); 463 463 464 464 gossip_debug(GOSSIP_DBPF_OPEN_CACHE_DEBUG, … … 548 548 } 549 549 DBPF_GET_STRANDED_BSTREAM_FILENAME(tmp_item->pathname, PATH_MAX, 550 my_storage_p-> data_path,550 my_storage_p->name, 551 551 coll_id, 552 552 llu(handle)); -
trunk/src/io/trove/trove-dbpf/dbpf.h
r7952 r7958 69 69 ((__handle) % DBPF_BSTREAM_MAX_NUM_BUCKETS) 70 70 71 #define DBPF_GET_DATA_DIRNAME(__buf, __path_max, __base) \ 72 do { snprintf(__buf, __path_max, "/%s", __base); } while (0) 73 74 #define DBPF_GET_META_DIRNAME(__buf, __path_max, __base) \ 75 do { snprintf(__buf, __path_max, "/%s", __base); } while (0) 71 #define DBPF_GET_STORAGE_DIRNAME(__buf, __path_max, __stoname) \ 72 do { snprintf(__buf, __path_max, "/%s", __stoname); } while (0) 76 73 77 74 #define STO_ATTRIB_DBNAME "storage_attributes.db" 78 #define DBPF_GET_STO_ATTRIB_DBNAME(__buf, __path_max, __ base)\75 #define DBPF_GET_STO_ATTRIB_DBNAME(__buf, __path_max, __stoname) \ 79 76 do { \ 80 snprintf(__buf, __path_max, "/%s/%s", __ base, STO_ATTRIB_DBNAME);\77 snprintf(__buf, __path_max, "/%s/%s", __stoname, STO_ATTRIB_DBNAME); \ 81 78 } while (0) 82 79 83 80 #define COLLECTIONS_DBNAME "collections.db" 84 #define DBPF_GET_COLLECTIONS_DBNAME(__buf, __path_max, __ base)\81 #define DBPF_GET_COLLECTIONS_DBNAME(__buf, __path_max, __stoname) \ 85 82 do { \ 86 snprintf(__buf, __path_max, "/%s/%s", __ base, COLLECTIONS_DBNAME);\83 snprintf(__buf, __path_max, "/%s/%s", __stoname, COLLECTIONS_DBNAME); \ 87 84 } while (0) 88 85 89 #define DBPF_GET_COLL_DIRNAME(__buf, __path_max, __ base, __collid)\86 #define DBPF_GET_COLL_DIRNAME(__buf, __path_max, __stoname, __collid) \ 90 87 do { \ 91 snprintf(__buf, __path_max, "/%s/%08x", __ base, __collid);\88 snprintf(__buf, __path_max, "/%s/%08x", __stoname, __collid); \ 92 89 } while (0) 93 90 94 91 #define COLL_ATTRIB_DBNAME "collection_attributes.db" 95 #define DBPF_GET_COLL_ATTRIB_DBNAME(__buf,__path_max,__ base,__collid)\92 #define DBPF_GET_COLL_ATTRIB_DBNAME(__buf,__path_max,__stoname,__collid) \ 96 93 do { \ 97 snprintf(__buf, __path_max, "/%s/%08x/%s", __ base, __collid,\94 snprintf(__buf, __path_max, "/%s/%08x/%s", __stoname, __collid, \ 98 95 COLL_ATTRIB_DBNAME); \ 99 96 } while (0) 100 97 101 98 #define DS_ATTRIB_DBNAME "dataspace_attributes.db" 102 #define DBPF_GET_DS_ATTRIB_DBNAME(__buf,__path_max,__ base,__collid)\99 #define DBPF_GET_DS_ATTRIB_DBNAME(__buf,__path_max,__stoname,__collid) \ 103 100 do { \ 104 snprintf(__buf, __path_max, "/%s/%08x/%s", __ base, __collid,\101 snprintf(__buf, __path_max, "/%s/%08x/%s", __stoname, __collid, \ 105 102 DS_ATTRIB_DBNAME); \ 106 103 } while (0) 107 104 108 105 #define BSTREAM_DIRNAME "bstreams" 109 #define DBPF_GET_BSTREAM_DIRNAME(__buf, __path_max, __ base, __collid)\106 #define DBPF_GET_BSTREAM_DIRNAME(__buf, __path_max, __stoname, __collid) \ 110 107 do { \ 111 snprintf(__buf, __path_max, "/%s/%08x/%s", __ base, __collid,\108 snprintf(__buf, __path_max, "/%s/%08x/%s", __stoname, __collid, \ 112 109 BSTREAM_DIRNAME); \ 113 110 } while (0) … … 115 112 #define STRANDED_BSTREAM_DIRNAME "stranded-bstreams" 116 113 #define DBPF_GET_STRANDED_BSTREAM_DIRNAME( \ 117 __buf, __path_max, __ base, __collid)\114 __buf, __path_max, __stoname, __collid) \ 118 115 do { \ 119 116 snprintf(__buf, __path_max, "/%s/%08x/%s", \ 120 __ base, __collid, STRANDED_BSTREAM_DIRNAME);\117 __stoname, __collid, STRANDED_BSTREAM_DIRNAME); \ 121 118 } while(0) 122 119 123 /* arguments are: buf, path_max, base, collid, handle */124 #define DBPF_GET_BSTREAM_FILENAME(__b, __pm, __ base, __cid, __handle)\120 /* arguments are: buf, path_max, stoname, collid, handle */ 121 #define DBPF_GET_BSTREAM_FILENAME(__b, __pm, __stoname, __cid, __handle) \ 125 122 do { \ 126 123 snprintf(__b, __pm, "/%s/%08x/%s/%.8llu/%08llx.bstream", \ 127 __ base, __cid, BSTREAM_DIRNAME,\124 __stoname, __cid, BSTREAM_DIRNAME, \ 128 125 llu(DBPF_BSTREAM_GET_BUCKET(__handle)), llu(__handle)); \ 129 126 } while (0) 130 127 131 /* arguments are: buf, path_max, base, collid, handle */128 /* arguments are: buf, path_max, stoname, collid, handle */ 132 129 #define DBPF_GET_STRANDED_BSTREAM_FILENAME( \ 133 __b, __pm, __ base, __cid, __handle)\130 __b, __pm, __stoname, __cid, __handle) \ 134 131 do { \ 135 132 snprintf(__b, __pm, "/%s/%08x/%s/%08llx.bstream", \ 136 __ base, __cid, STRANDED_BSTREAM_DIRNAME,\133 __stoname, __cid, STRANDED_BSTREAM_DIRNAME, \ 137 134 llu(__handle)); \ 138 135 } while(0) 139 136 140 /* arguments are: buf, path_max, base, collid */137 /* arguments are: buf, path_max, stoname, collid */ 141 138 #define KEYVAL_DBNAME "keyval.db" 142 #define DBPF_GET_KEYVAL_DBNAME(__buf,__path_max,__ base,__collid)\139 #define DBPF_GET_KEYVAL_DBNAME(__buf,__path_max,__stoname,__collid) \ 143 140 do { \ 144 snprintf(__buf, __path_max, "/%s/%08x/%s", __ base, __collid,\141 snprintf(__buf, __path_max, "/%s/%08x/%s", __stoname, __collid, \ 145 142 KEYVAL_DBNAME); \ 146 143 } while (0) … … 201 198 TROVE_ds_flags flags; 202 199 int refct; 203 char *data_path; /* path to data storage directory */ 204 char *meta_path; /* path to metadata storage directory */ 200 char *name; 205 201 DB *sto_attr_db; 206 202 DB *coll_db; … … 211 207 int refct; 212 208 char *name; 213 char *data_path; /* path to data collection directory */ 214 char *meta_path; /* path to metadata collection directory */ 209 char *path_name; 215 210 DB *coll_attr_db; 216 211 DB *ds_db; … … 695 690 696 691 struct dbpf_storage *dbpf_storage_lookup( 697 char *data_path, char *meta_path, int *error_p, TROVE_ds_flags flags); 698 699 int dbpf_storage_create(char *data_path, 700 char *meta_path, 692 char *stoname, int *error_p, TROVE_ds_flags flags); 693 694 int dbpf_storage_create(char *stoname, 701 695 void *user_ptr, 702 696 TROVE_op_id *out_op_id_p); 703 697 704 int dbpf_storage_remove(char *data_path, 705 char *meta_path, 698 int dbpf_storage_remove(char *stoname, 706 699 void *user_ptr, 707 700 TROVE_op_id *out_op_id_p); -
trunk/src/io/trove/trove-internal.h
r7952 r7958 390 390 { 391 391 int (*initialize)( 392 char *data_path, 393 char *meta_path, 392 char *stoname, 394 393 TROVE_ds_flags flags); 395 394 … … 397 396 398 397 int (*storage_create)( 399 char *data_path, 400 char *meta_path, 398 char *stoname, 401 399 void *user_ptr, 402 400 TROVE_op_id *out_op_id_p); 403 401 404 402 int (*storage_remove)( 405 char *data_path, 406 char *meta_path, 403 char *stoname, 407 404 void *user_ptr, 408 405 TROVE_op_id *out_op_id_p); 409 406 410 407 int (*collection_create)( 408 /* char *stoname, */ 411 409 char *collname, 412 410 TROVE_coll_id new_coll_id, … … 415 413 416 414 int (*collection_remove)( 415 /* char *stoname, */ 417 416 char *collname, 418 417 void *user_ptr, … … 420 419 421 420 int (*collection_lookup)( 421 /* char *stoname, */ 422 422 char *collname, 423 423 TROVE_coll_id *coll_id_p, -
trunk/src/io/trove/trove-mgmt.c
r7952 r7958 88 88 int trove_initialize(TROVE_method_id method_id, 89 89 TROVE_method_callback method_callback, 90 char *data_path, 91 char *meta_path, 90 char *stoname, 92 91 TROVE_ds_flags flags) 93 92 { … … 121 120 */ 122 121 ret = mgmt_method_table[method_id]->initialize( 123 data_path, meta_path, flags);122 stoname, flags); 124 123 if (ret > -1) 125 124 { … … 156 155 157 156 int trove_storage_create(TROVE_method_id method_id, 158 char *data_path, 159 char *meta_path, 157 char *stoname, 160 158 void *user_ptr, 161 159 TROVE_op_id *out_op_id_p) 162 160 { 163 161 int ret = mgmt_method_table[method_id]->storage_create( 164 data_path, meta_path, user_ptr, out_op_id_p);162 stoname, user_ptr, out_op_id_p); 165 163 166 164 return ((ret < 0) ? ret : 1); … … 169 167 170 168 int trove_storage_remove(TROVE_method_id method_id, 171 char *data_path, 172 char *meta_path, 169 char *stoname, 173 170 void *user_ptr, 174 171 TROVE_op_id *out_op_id_p) 175 172 { 176 173 int ret = mgmt_method_table[method_id]->storage_remove( 177 data_path, meta_path, user_ptr, out_op_id_p);174 stoname, user_ptr, out_op_id_p); 178 175 179 176 return ((ret < 0) ? ret : 1); -
trunk/src/io/trove/trove-migrate.c
r7952 r7958 43 43 * Prototypes 44 44 */ 45 static int migrate_collection_0_1_3 (TROVE_coll_id coll_id, 46 const char* data_path, 47 const char* meta_path); 45 static int migrate_collection_0_1_3 (TROVE_coll_id coll_id,const char* stoname); 48 46 49 47 /* … … 57 55 int minor; 58 56 int incremental; 59 int (*migrate)(TROVE_coll_id coll_id, 60 const char* data_path, 61 const char* meta_path); 57 int (*migrate)(TROVE_coll_id coll_id, const char* stoname); 62 58 }; 63 59 … … 248 244 * trove_migrate 249 245 * method_id - method used to for trove access 250 * data_path - path to data storage 251 * meta_path - path to metadata storage 246 * stoname - path to storage 252 247 * 253 248 * Iterate over all collections and migrate each one. 254 249 * \return 0 on success, non-zero on failure 255 250 */ 256 int trove_migrate (TROVE_method_id method_id, const char* data_path, 257 const char* meta_path) 251 int trove_migrate (TROVE_method_id method_id, const char* stoname) 258 252 { 259 253 TROVE_ds_position pos; … … 329 323 migrate_p->minor, 330 324 migrate_p->incremental); 331 ret = migrate_p->migrate(coll_id, data_path, meta_path);325 ret = migrate_p->migrate(coll_id, stoname); 332 326 if (ret < 0) 333 327 { 334 328 gossip_err("migrate failed: \ 335 ret=%d coll=%d metadir=%s datadir=%s major=%d minor=%d incremental=%d\n", 336 ret, coll_id, meta_path, data_path, 337 migrate_p->major, migrate_p->minor, 338 migrate_p->incremental); 329 ret=%d coll=%d stoname=%s major=%d minor=%d incremental=%d\n", 330 ret, coll_id, stoname, migrate_p->major, 331 migrate_p->minor, migrate_p->incremental); 339 332 goto complete; 340 333 } … … 386 379 /* 387 380 * migrate_collection_0_1_3 388 * coll_id - collection id 389 * data_path - path to data storage 390 * meta_path - path to metadata storage 381 * coll_id - collection id 382 * stoname - path to storage 391 383 * 392 384 * For each datafile handle, check the file length and update the … … 394 386 * \return 0 on success, non-zero on failure 395 387 */ 396 static int migrate_collection_0_1_3 (TROVE_coll_id coll_id, 397 const char* data_path, 398 const char* meta_path) 388 static int migrate_collection_0_1_3 (TROVE_coll_id coll_id, const char* stoname) 399 389 { 400 390 TROVE_context_id context_id = PVFS_CONTEXT_NULL; … … 560 550 DBPF_GET_BSTREAM_FILENAME(filename, 561 551 PATH_MAX, 562 data_path,552 stoname, 563 553 coll_id, 564 554 llu(handles[i])); -
trunk/src/io/trove/trove.h
r7952 r7958 100 100 TROVE_method_id method_id, 101 101 TROVE_method_callback method_callback, 102 char *data_path, 103 char *meta_path, 102 char *stoname, 104 103 TROVE_ds_flags flags); 105 104 106 105 int trove_finalize(TROVE_method_id method_id); 107 106 108 int trove_migrate(TROVE_method_id method_id, const char* data_path, 109 const char* meta_path); 107 int trove_migrate(TROVE_method_id method_id, const char* stoname); 110 108 111 109 int trove_open_context( … … 123 121 int trove_storage_create( 124 122 TROVE_method_id method_id, 125 char *data_path, 126 char *meta_path, 123 char *stoname, 127 124 void *user_ptr, 128 125 TROVE_op_id *out_op_id_p); … … 130 127 int trove_storage_remove( 131 128 TROVE_method_id method_id, 132 char *data_path, 133 char *meta_path, 129 char *stoname, 134 130 void *user_ptr, 135 131 TROVE_op_id *out_op_id_p); 136 132 137 133 int trove_collection_create( 134 /* char *stoname, */ 138 135 char *collname, 139 136 TROVE_coll_id new_coll_id, … … 143 140 int trove_collection_remove( 144 141 TROVE_method_id method_id, 142 /* char *stoname, */ 145 143 char *collname, 146 144 void *user_ptr, … … 149 147 int trove_collection_lookup( 150 148 TROVE_method_id method_id, 149 /* char *stoname, */ 151 150 char *collname, 152 151 TROVE_coll_id *out_coll_id_p, -
trunk/src/proto/endecode-funcs.h
r7952 r7958 110 110 *(pptr) += roundup8(4 + len + 1); \ 111 111 } else { \ 112 *(u_int32_t *) *(pptr) = 0; \112 *(u_int32_t *) (*(pptr)+4) = 0; \ 113 113 *(pptr) += 8; \ 114 114 } \ -
trunk/src/server/pvfs2-server.c
r7952 r7958 788 788 server_config.trove_method, 789 789 trove_coll_to_method_callback, 790 server_config.data_path, 791 server_config.meta_path, 790 server_config.storage_path, 792 791 init_flags); 793 792 if (ret < 0) … … 796 795 797 796 gossip_err("\n***********************************************\n"); 798 gossip_err("Invalid Storage Space: %s or %s\n\n",799 server_config. data_path, server_config.meta_path);797 gossip_err("Invalid Storage Space: %s\n\n", 798 server_config.storage_path); 800 799 gossip_err("Storage initialization failed. The most " 801 800 "common reason\nfor this is that the storage space " … … 1089 1088 * Migrate database if needed 1090 1089 */ 1091 ret = trove_migrate(server_config.trove_method, 1092 server_config.data_path, 1093 server_config.meta_path); 1090 ret = trove_migrate(server_config.trove_method,server_config.storage_path); 1094 1091 if (ret < 0) 1095 1092 { -
trunk/test/automated/README.tests
r7952 r7958 1 1 # 2 # $Date: 2009-09-0 1 18:55:53$2 # $Date: 2009-09-02 21:10:42 $ 3 3 # 4 4 # A brief description of the contents of the test/automated directory -
trunk/test/io/buffer/trove-init.c
r7952 r7958 72 72 73 73 ret = trove_initialize( 74 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);74 TROVE_METHOD_DBPF, NULL, storage_space, 0); 75 75 if (ret < 0) { 76 76 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/flow/test-bmi-cache-server.c
r7952 r7958 103 103 104 104 ret = trove_initialize( 105 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);105 TROVE_METHOD_DBPF, NULL, storage_space, 0); 106 106 if (ret < 0) 107 107 { -
trunk/test/io/flow/test-harness-server-trove.c
r7952 r7958 108 108 109 109 ret = trove_initialize( 110 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);110 TROVE_METHOD_DBPF, NULL, storage_space, 0); 111 111 if (ret < 0) 112 112 { -
trunk/test/io/flow/test1-server.c
r7952 r7958 105 105 106 106 ret = trove_initialize( 107 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);107 TROVE_METHOD_DBPF, NULL, storage_space, 0); 108 108 if (ret < 0) 109 109 { -
trunk/test/io/job/job-client-example.c
r7952 r7958 52 52 53 53 ret = trove_initialize( 54 TROVE_METHOD_DBPF, NULL, "/tmp/pvfs2-test-space", "/tmp/pvfs2-test-space",0);54 TROVE_METHOD_DBPF, NULL, "/tmp/pvfs2-test-space", 0); 55 55 if(ret < 0) 56 56 { -
trunk/test/io/job/job-server-example.c
r7952 r7958 57 57 58 58 ret = trove_initialize( 59 TROVE_METHOD_DBPF, NULL, "/tmp/pvfs2-test-space", "/tmp/pvfs2-test-space",0);59 TROVE_METHOD_DBPF, NULL, "/tmp/pvfs2-test-space", 0); 60 60 if(ret < 0) 61 61 { -
trunk/test/io/job/module.mk.in
r7952 r7958 6 6 $(DIR)/job-server-example.c \ 7 7 $(DIR)/trove-job-create-toy.c \ 8 $(DIR)/trove-job-io.c \9 8 $(DIR)/trove-job-ls.c \ 10 9 $(DIR)/trove-job-mkfs.c \ -
trunk/test/io/job/trove-job-create-toy.c
r7952 r7958 40 40 41 41 ret = trove_initialize( 42 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);42 TROVE_METHOD_DBPF, NULL, storage_space, 0); 43 43 if (ret < 0) { 44 44 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/job/trove-job-ls.c
r7952 r7958 48 48 49 49 ret = trove_initialize( 50 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);50 TROVE_METHOD_DBPF, NULL, storage_space, 0); 51 51 if (ret < 0) { 52 52 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/job/trove-job-mkfs.c
r7952 r7958 72 72 /* try to initialize; fails if storage space isn't there? */ 73 73 ret = trove_initialize( 74 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);74 TROVE_METHOD_DBPF, NULL, storage_space, 0); 75 75 if (ret < 0) { 76 76 fprintf(stderr, "warning: initialize failed. trying to create storage space.\n"); … … 79 79 /* Q: what good is the op_id here if we have to match on coll_id in test fn? */ 80 80 ret = trove_storage_create( 81 TROVE_METHOD_DBPF, storage_space, storage_space,NULL, &op_id);81 TROVE_METHOD_DBPF, storage_space, NULL, &op_id); 82 82 if (ret < 0) { 83 83 fprintf(stderr, "storage create failed.\n"); … … 87 87 /* second try at initialize, in case it failed first try. */ 88 88 ret = trove_initialize( 89 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);89 TROVE_METHOD_DBPF, NULL, storage_space, 0); 90 90 if (ret < 0) { 91 91 fprintf(stderr, "initialized failed second time.\n"); -
trunk/test/io/job/trove-job-touch.c
r7952 r7958 44 44 45 45 ret = trove_initialize( 46 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);46 TROVE_METHOD_DBPF, NULL, storage_space, 0); 47 47 if (ret < 0) { 48 48 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/test-listio.c
r7952 r7958 76 76 77 77 ret = trove_initialize( 78 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);78 TROVE_METHOD_DBPF, NULL, storage_space, 0); 79 79 if (ret < 0) { 80 80 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/trove/test-listio2.c
r7952 r7958 80 80 81 81 ret = trove_initialize( 82 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);82 TROVE_METHOD_DBPF, NULL, storage_space, 0); 83 83 if (ret < 0) { 84 84 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/trove/test-listio3.c
r7952 r7958 79 79 80 80 ret = trove_initialize( 81 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);81 TROVE_METHOD_DBPF, NULL, storage_space, 0); 82 82 if (ret < 0) { 83 83 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/trove/test-listio4.c
r7952 r7958 79 79 80 80 ret = trove_initialize( 81 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);81 TROVE_METHOD_DBPF, NULL, storage_space, 0); 82 82 if (ret < 0) { 83 83 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/trove/test-listio5.c
r7952 r7958 84 84 85 85 ret = trove_initialize( 86 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);86 TROVE_METHOD_DBPF, NULL, storage_space, 0); 87 87 if (ret < 0) { 88 88 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/trove/test-trove-cancel.c
r7952 r7958 79 79 80 80 ret = trove_initialize( 81 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);81 TROVE_METHOD_DBPF, NULL, storage_space, 0); 82 82 if (ret < 0) { 83 83 fprintf(stderr, "initialize failed: run trove-mkfs first.\n"); -
trunk/test/io/trove/trove-bstream.c
r7952 r7958 44 44 45 45 ret = trove_initialize( 46 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);46 TROVE_METHOD_DBPF, NULL, storage_space, 0); 47 47 if (ret < 0 ) { 48 48 fprintf(stderr, "initialize failed\n"); -
trunk/test/io/trove/trove-create-stress.c
r7952 r7958 47 47 48 48 ret = trove_initialize( 49 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);49 TROVE_METHOD_DBPF, NULL, storage_space, 0); 50 50 if (ret < 0) { 51 51 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-export.c
r7952 r7958 53 53 54 54 ret = trove_initialize( 55 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);55 TROVE_METHOD_DBPF, NULL, storage_space, 0); 56 56 if (ret < 0) { 57 57 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-import.c
r7952 r7958 58 58 59 59 ret = trove_initialize( 60 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);60 TROVE_METHOD_DBPF, NULL, storage_space, 0); 61 61 if (ret < 0) { 62 62 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-key-iterate.c
r7952 r7958 126 126 127 127 ret = trove_initialize( 128 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);128 TROVE_METHOD_DBPF, NULL, storage_space, 0); 129 129 if (ret < 0) { 130 130 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-ls.c
r7952 r7958 47 47 48 48 ret = trove_initialize( 49 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);49 TROVE_METHOD_DBPF, NULL, storage_space, 0); 50 50 if (ret < 0) { 51 51 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-mkdir.c
r7952 r7958 45 45 46 46 ret = trove_initialize( 47 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);47 TROVE_METHOD_DBPF, NULL, storage_space, 0); 48 48 if (ret < 0) { 49 49 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-mkfs.c
r7952 r7958 37 37 38 38 /* try to initialize; fails if storage space isn't there? */ 39 ret = trove_initialize(TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);39 ret = trove_initialize(TROVE_METHOD_DBPF, NULL, storage_space, 0); 40 40 if (ret < 0) { 41 41 fprintf(stderr, "warning: initialize failed. trying to create storage space.\n"); … … 43 43 /* create the storage space */ 44 44 /* Q: what good is the op_id here if we have to match on coll_id in test fn? */ 45 ret = trove_storage_create(TROVE_METHOD_DBPF, storage_space, storage_space,NULL, &op_id);45 ret = trove_storage_create(TROVE_METHOD_DBPF, storage_space, NULL, &op_id); 46 46 if (ret < 0) { 47 47 fprintf(stderr, "storage create failed.\n"); … … 50 50 51 51 /* second try at initialize, in case it failed first try. */ 52 ret = trove_initialize(TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);52 ret = trove_initialize(TROVE_METHOD_DBPF, NULL, storage_space, 0); 53 53 if (ret < 0) { 54 54 fprintf(stderr, "initialized failed second time.\n"); -
trunk/test/io/trove/trove-rm.c
r7952 r7958 42 42 43 43 ret = trove_initialize( 44 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);44 TROVE_METHOD_DBPF, NULL, storage_space, 0); 45 45 if (ret < 0) { 46 46 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-rmdir.c
r7952 r7958 42 42 43 43 ret = trove_initialize( 44 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);44 TROVE_METHOD_DBPF, NULL, storage_space, 0); 45 45 if (ret < 0) { 46 46 fprintf(stderr, "initialize failed.\n"); -
trunk/test/io/trove/trove-touch.c
r7952 r7958 44 44 45 45 ret = trove_initialize( 46 TROVE_METHOD_DBPF, NULL, storage_space, storage_space,0);46 TROVE_METHOD_DBPF, NULL, storage_space, 0); 47 47 if (ret < 0) { 48 48 fprintf(stderr, "initialize failed.\n"); -
trunk/test/server/showconfig.c
r7952 r7958 43 43 fprintf(stderr,"Server ID : %s\n", 44 44 serverconfig.host_id); 45 fprintf(stderr,"Data Storage Space : %s\n", 46 serverconfig.data_path); 47 fprintf(stderr,"Meta Storage Space : %s\n", 48 serverconfig.meta_path); 45 fprintf(stderr,"Storage Space : %s\n", 46 serverconfig.storage_path); 49 47 fprintf(stderr,"FS Config File Name : %s (%d bytes)\n", 50 48 serverconfig.fs_config_filename,
