Changeset 55f8c6e7 in mainline
- Timestamp:
- 2015-10-29T17:10:30Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dc2d582
- Parents:
- 03661d19
- Location:
- uspace
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fdisk/src/cap.c
r03661d19 r55f8c6e7 92 92 uint64_t rem; 93 93 int rc; 94 95 printf("fdisk_cap_to_blocks: m=%" PRIu64 ", dp=%d, cunit=%d\n",96 cap->m, cap->dp, cap->cunit);97 94 98 95 exp = cap->cunit * 3 - cap->dp; … … 122 119 } 123 120 124 printf("f=%" PRIu64 ", adj=%" PRId64 "\n", f, adj);125 121 bytes = cap->m * f + adj; 126 printf("bytes=%" PRIu64 "\n", bytes);127 122 if ((bytes - adj) / f != cap->m) 128 123 return ERANGE; … … 134 129 135 130 blocks = (bytes + rem) / block_size; 136 printf("blocks=%" PRIu64 "\n", blocks);137 131 138 132 *rblocks = blocks; … … 152 146 unsigned rdig; 153 147 int rc; 154 155 printf("before: m=%" PRIu64 " dp=%u cunit=%d\n",156 cap->m, cap->dp, cap->cunit);157 148 158 149 /* Change units so that we have at most @c scap_max_idig integer digits */ … … 183 174 cap->dp -= rdig; 184 175 } 185 186 printf("after: m=%" PRIu64 " dp=%u cunit=%d\n",187 cap->m, cap->dp, cap->cunit);188 176 } 189 177 -
uspace/lib/fdisk/src/fdisk.c
r03661d19 r55f8c6e7 128 128 list_initialize(&devlist->devinfos); 129 129 130 printf("vbd_get_disks()\n");131 130 rc = vbd_get_disks(fdisk->vbd, &svcs, &count); 132 printf(" -> %d\n", rc);133 131 if (rc != EOK) { 134 132 rc = EIO; … … 262 260 return ENOMEM; 263 261 264 printf("vbd_part_get_info(%zu)\n", partid);265 262 rc = vbd_part_get_info(dev->fdisk->vbd, partid, &pinfo); 266 263 if (rc != EOK) { … … 270 267 271 268 if (pinfo.svc_id != 0) { 272 printf("vol_part_add(%zu)...\n", pinfo.svc_id);273 269 /* 274 270 * Normally vol service discovers the partition asynchronously. … … 276 272 */ 277 273 rc = vol_part_add(dev->fdisk->vol, pinfo.svc_id); 278 printf("vol_part_add->rc = %d\n", rc);279 274 if (rc != EOK && rc != EEXIST) { 280 275 rc = EIO; … … 282 277 } 283 278 284 printf("vol_part_info(%zu)\n", pinfo.svc_id);285 279 rc = vol_part_info(dev->fdisk->vol, pinfo.svc_id, &vpinfo); 286 printf("vol_part_info->rc = %d\n", rc);287 280 if (rc != EOK) { 288 281 rc = EIO; … … 404 397 int rc; 405 398 406 printf("get label info\n");407 399 rc = fdisk_update_dev_info(dev); 408 400 if (rc != EOK) { 409 printf("failed\n");410 401 rc = EIO; 411 402 goto error; 412 403 } 413 404 414 printf("block size: %zu\n", dev->dinfo.block_size);415 printf("get partitions\n");416 405 rc = vbd_label_get_parts(dev->fdisk->vbd, dev->sid, &psids, &nparts); 417 406 if (rc != EOK) { 418 printf("failed\n");419 407 rc = EIO; 420 408 goto error; 421 409 } 422 printf("OK\n"); 423 424 printf("found %zu partitions.\n", nparts); 410 425 411 for (i = 0; i < nparts; i++) { 426 printf("add partition sid=%zu\n", psids[i]);427 412 rc = fdisk_part_add(dev, psids[i], NULL); 428 413 if (rc != EOK) { 429 printf("failed\n");430 414 goto error; 431 415 } 432 printf("OK\n");433 416 } 434 417 … … 476 459 } 477 460 478 printf("get label info\n");479 461 rc = fdisk_update_dev_info(dev); 480 462 if (rc != EOK) { 481 printf("failed\n");482 463 rc = EIO; 483 464 goto error; 484 465 } 485 466 486 printf("block size: %zu\n", dev->dinfo.block_size);487 printf("get partitions\n");488 467 rc = vbd_label_get_parts(fdisk->vbd, sid, &psids, &nparts); 489 468 if (rc != EOK) { 490 printf("failed\n");491 469 rc = EIO; 492 470 goto error; 493 471 } 494 printf("OK\n"); 495 496 printf("found %zu partitions.\n", nparts); 472 497 473 for (i = 0; i < nparts; i++) { 498 printf("add partition sid=%zu\n", psids[i]);499 474 rc = fdisk_part_add(dev, psids[i], NULL); 500 475 if (rc != EOK) { 501 printf("failed\n");502 476 goto error; 503 477 } 504 printf("OK\n");505 478 } 506 479 … … 528 501 int rc; 529 502 530 printf("fdisk_dev_erase.. check ltype\n");531 503 if (dev->dinfo.ltype != lt_none) 532 504 return EINVAL; 533 505 534 printf("fdisk_dev_erase.. get first part\n");535 506 part = fdisk_part_first(dev); 536 507 assert(part != NULL); 537 printf("fdisk_dev_erase.. check part\n");538 508 if (part->pcnt == vpc_empty) 539 509 return EINVAL; 540 510 541 printf("fdisk_dev_erase.. check part\n");542 511 rc = vol_part_empty(dev->fdisk->vol, part->svc_id); 543 512 if (rc != EOK) { 544 printf("vol_part_empty -> %d\n", rc);545 513 return rc; 546 514 } … … 682 650 int rc; 683 651 684 printf("fdisk_label_destroy: begin\n");685 686 652 part = fdisk_part_first(dev); 687 653 while (part != NULL) { … … 692 658 } 693 659 694 printf("fdisk_label_destroy: vbd_label_delete\n");695 696 660 rc = vbd_label_delete(dev->fdisk->vbd, dev->sid); 697 661 if (rc != EOK) 698 662 return EIO; 699 663 700 printf("fdisk_label_destroy: add parts\n");701 664 rc = fdisk_dev_add_parts(dev); 702 665 if (rc != EOK) 703 666 return rc; 704 667 705 printf("fdisk_label_destroy: erase dev\n");706 668 /* Make sure device is considered empty */ 707 669 fdisk_dev_get_flags(dev, &dflags); … … 712 674 } 713 675 714 printf("fdisk_label_destroy: done\n");715 676 return EOK; 716 677 } … … 807 768 int rc; 808 769 809 printf("fdisk_part_create()\n");810 811 770 rc = fdisk_part_spec_prepare(dev, pspec, &vpspec); 812 771 if (rc != EOK) 813 772 return EIO; 814 773 815 printf("fdisk_part_create() - call vbd_part_create\n");816 774 rc = vbd_part_create(dev->fdisk->vbd, dev->sid, &vpspec, &partid); 817 775 if (rc != EOK) 818 776 return EIO; 819 777 820 printf("fdisk_part_create() - call fdisk_part_add\n");821 778 rc = fdisk_part_add(dev, partid, &part); 822 779 if (rc != EOK) { … … 829 786 rc = vol_part_mkfs(dev->fdisk->vol, part->svc_id, pspec->fstype); 830 787 if (rc != EOK && rc != ENOTSUP) { 831 printf("mkfs failed\n");832 788 fdisk_part_remove(part); 833 789 (void) vbd_part_delete(dev->fdisk->vbd, partid); … … 836 792 } 837 793 838 printf("fdisk_part_create() - done\n");839 794 if (part->svc_id != 0) { 840 795 part->pcnt = vpc_fs; … … 986 941 do { 987 942 if (fdisk_free_range_get(&fr, &b0, &nb)) { 988 printf("free range: [%" PRIu64 ",+%" PRIu64 "]\n",989 b0, nb);990 943 if (nb >= nblocks) { 991 printf("accepted.\n");992 944 *rblock0 = b0; 993 945 *rnblocks = nb; … … 1049 1001 int rc; 1050 1002 1051 printf("fdisk_part_spec_prepare() - dev=%p pspec=%p vpspec=%p\n", dev, pspec,1052 vpspec);1053 1003 rc = fdisk_cap_to_blocks(&pspec->capacity, fcv_nom, dev->dinfo.block_size, 1054 1004 &nom_blocks); … … 1069 1019 min_blocks = fdisk_ba_align_up(dev, min_blocks); 1070 1020 max_blocks = fdisk_ba_align_up(dev, max_blocks); 1071 1072 printf("fdisk_part_spec_prepare: nom=%" PRIu64 ", min=%" PRIu641073 ", max=%" PRIu64, nom_blocks, min_blocks, max_blocks);1074 1021 1075 1022 pcnt = -1; … … 1155 1102 return EIO; 1156 1103 } 1157 1158 printf("fdisk_part_spec_prepare: hdrb=%" PRIu64 ", b0=%" PRIu641159 ", nblocks=%" PRIu64 ", pkind=%d\n", vpspec->hdr_blocks,1160 vpspec->block0, vpspec->nblocks, vpspec->pkind);1161 1104 1162 1105 return EOK; -
uspace/lib/label/src/mbr.c
r03661d19 r55f8c6e7 486 486 } 487 487 488 #include <io/log.h>489 488 static void mbr_part_get_info(label_part_t *part, label_part_info_t *pinfo) 490 489 { … … 493 492 pinfo->nblocks = part->nblocks; 494 493 495 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_part_get_info: index=%d ptype=%d",496 (int)part->index, (int)part->ptype.t.num);497 494 if (link_used(&part->llog)) 498 495 pinfo->pkind = lpk_logical; … … 512 509 int rc; 513 510 514 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_part_create");515 511 if (pspec->ptype.fmt != lptf_num) 516 512 return EINVAL; … … 621 617 } 622 618 623 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_part_create success");624 619 *rpart = part; 625 620 return EOK; … … 756 751 return EINVAL; 757 752 758 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_part_to_pte: a0=%" PRIu64759 " len=%" PRIu64 " ptype=%d", part->block0, part->nblocks,760 (int)part->ptype.t.num);761 753 memset(pte, 0, sizeof(mbr_pte_t)); 762 754 pte->ptype = part->ptype.t.num; … … 949 941 ba = part->block0 - part->hdr_blocks; 950 942 951 log_msg(LOG_DEFAULT, LVL_NOTE, "Write EBR to ba=%" PRIu64, ba);952 943 rc = block_write_direct(label->svc_id, ba, 1, br); 953 944 if (rc != EOK) { … … 998 989 ba = part->block0 - part->hdr_blocks; 999 990 1000 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_ebr_update_next ba=%" PRIu64,1001 ba);1002 1003 991 br = calloc(1, label->block_size); 1004 992 if (br == NULL) 1005 993 return ENOMEM; 1006 994 1007 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_ebr_update_next read ba=%" PRIu64,1008 ba);1009 1010 995 rc = block_read_direct(label->svc_id, ba, 1, br); 1011 996 if (rc != EOK) { … … 1017 1002 sgn = uint16_t_le2host(br->signature); 1018 1003 if (sgn != mbr_br_signature) { 1019 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_ebr_update_next signature error");1020 1004 rc = EIO; 1021 1005 goto error; … … 1024 1008 mbr_log_part_to_ptes(part, NULL, &br->pte[mbr_ebr_pte_next]); 1025 1009 1026 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_ebr_update_next write ba=%" PRIu64,1027 ba);1028 1029 1010 rc = block_write_direct(label->svc_id, ba, 1, br); 1030 1011 if (rc != EOK) { … … 1032 1013 goto error; 1033 1014 } 1034 1035 log_msg(LOG_DEFAULT, LVL_NOTE, "mbr_ebr_update_next success");1036 1015 1037 1016 free(br); -
uspace/srv/bd/vbd/disk.c
r03661d19 r55f8c6e7 173 173 static int vbds_part_by_pid(vbds_part_id_t partid, vbds_part_t **rpart) 174 174 { 175 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_by_pid(%zu)", partid);175 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_by_pid(%zu)", partid); 176 176 177 177 list_foreach(vbds_parts, lparts, vbds_part_t, part) { 178 log_msg(LOG_DEFAULT, LVL_ NOTE, "%zu == %zu ?", part->pid, partid);178 log_msg(LOG_DEFAULT, LVL_DEBUG, "%zu == %zu ?", part->pid, partid); 179 179 if (part->pid == partid) { 180 log_msg(LOG_DEFAULT, LVL_ NOTE, "Found match.");180 log_msg(LOG_DEFAULT, LVL_DEBUG, "Found match."); 181 181 *rpart = part; 182 182 return EOK; … … 184 184 } 185 185 186 log_msg(LOG_DEFAULT, LVL_ NOTE, "No match.");186 log_msg(LOG_DEFAULT, LVL_DEBUG, "No match."); 187 187 return ENOENT; 188 188 } … … 190 190 static int vbds_part_by_svcid(service_id_t svcid, vbds_part_t **rpart) 191 191 { 192 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_by_svcid(%zu)", svcid);192 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_by_svcid(%zu)", svcid); 193 193 194 194 list_foreach(vbds_parts, lparts, vbds_part_t, part) { 195 log_msg(LOG_DEFAULT, LVL_ NOTE, "%zu == %zu ?", part->svc_id, svcid);195 log_msg(LOG_DEFAULT, LVL_DEBUG, "%zu == %zu ?", part->svc_id, svcid); 196 196 if (part->svc_id == svcid) { 197 log_msg(LOG_DEFAULT, LVL_ NOTE, "Found match.");197 log_msg(LOG_DEFAULT, LVL_DEBUG, "Found match."); 198 198 *rpart = part; 199 199 return EOK; … … 201 201 } 202 202 203 log_msg(LOG_DEFAULT, LVL_ NOTE, "No match.");203 log_msg(LOG_DEFAULT, LVL_DEBUG, "No match."); 204 204 return ENOENT; 205 205 } … … 214 214 int rc; 215 215 216 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_add(%s, %p)",216 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_add(%s, %p)", 217 217 disk->svc_name, lpart); 218 218 … … 245 245 list_append(&part->lparts, &vbds_parts); 246 246 247 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_add -> %p", part);247 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_add -> %p", part); 248 248 249 249 if (rpart != NULL) … … 260 260 int rc; 261 261 262 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_remove(%p)", part);262 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_remove(%p)", part); 263 263 264 264 lpart = part->lpart; 265 265 266 266 if (part->open_cnt > 0) { 267 log_msg(LOG_DEFAULT, LVL_ NOTE, "part->open_cnt = %d",267 log_msg(LOG_DEFAULT, LVL_DEBUG, "part->open_cnt = %d", 268 268 part->open_cnt); 269 269 return EBUSY; … … 355 355 int rc; 356 356 357 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_disk_add(%zu)", sid);357 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_disk_add(%zu)", sid); 358 358 359 359 /* Check for duplicates */ … … 373 373 } 374 374 375 log_msg(LOG_DEFAULT, LVL_ NOTE, "block_init(%zu)", sid);375 log_msg(LOG_DEFAULT, LVL_DEBUG, "block_init(%zu)", sid); 376 376 rc = block_init(EXCHANGE_SERIALIZE, sid, 2048); 377 377 if (rc != EOK) { … … 394 394 rc = label_open(sid, &label); 395 395 if (rc != EOK) { 396 log_msg(LOG_DEFAULT, LVL_ NOTE, "Failed to open label in disk %s.",396 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to open label in disk %s.", 397 397 disk->svc_name); 398 398 rc = EIO; … … 414 414 label_close(label); 415 415 if (block_inited) { 416 log_msg(LOG_DEFAULT, LVL_ NOTE, "block_fini(%zu)", sid);416 log_msg(LOG_DEFAULT, LVL_DEBUG, "block_fini(%zu)", sid); 417 417 block_fini(sid); 418 418 } … … 428 428 int rc; 429 429 430 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_disk_remove(%zu)", sid);430 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_disk_remove(%zu)", sid); 431 431 432 432 rc = vbds_disk_by_svcid(sid, &disk); … … 442 442 list_remove(&disk->ldisks); 443 443 label_close(disk->label); 444 log_msg(LOG_DEFAULT, LVL_ NOTE, "block_fini(%zu)", sid);444 log_msg(LOG_DEFAULT, LVL_DEBUG, "block_fini(%zu)", sid); 445 445 block_fini(sid); 446 446 free(disk); … … 483 483 int rc; 484 484 485 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_disk_info(%zu)", sid);485 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_disk_info(%zu)", sid); 486 486 487 487 rc = vbds_disk_by_svcid(sid, &disk); … … 498 498 info->anblocks = linfo.anblocks; 499 499 info->block_size = disk->block_size; 500 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_disk_info - block_size=%zu",500 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_disk_info - block_size=%zu", 501 501 info->block_size); 502 502 return EOK; … … 540 540 int rc; 541 541 542 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_create(%zu)", sid);542 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu)", sid); 543 543 544 544 /* Find disk */ … … 547 547 return rc; 548 548 549 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_create(%zu) - label_close", sid);549 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu) - label_close", sid); 550 550 551 551 /* Verify that current label is a dummy label */ … … 569 569 disk->label = NULL; 570 570 571 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_create(%zu) - label_create", sid);571 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu) - label_create", sid); 572 572 573 573 rc = label_create(sid, ltype, &label); … … 578 578 disk->label = label; 579 579 580 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_create(%zu) - success", sid);580 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu) - success", sid); 581 581 return EOK; 582 582 error: 583 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_create(%zu) - failure", sid);583 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu) - failure", sid); 584 584 if (disk->label == NULL) { 585 585 rc = label_open(sid, &label); 586 586 if (rc != EOK) { 587 log_msg(LOG_DEFAULT, LVL_ NOTE, "Failed to open label in disk %s.",587 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to open label in disk %s.", 588 588 disk->svc_name); 589 589 } … … 599 599 int rc; 600 600 601 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_delete(%zu)", sid);601 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_delete(%zu)", sid); 602 602 603 603 rc = vbds_disk_by_svcid(sid, &disk); … … 621 621 rc = label_open(disk->svc_id, &label); 622 622 if (rc != EOK) { 623 log_msg(LOG_DEFAULT, LVL_ NOTE, "Failed to open label in disk %s.",623 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to open label in disk %s.", 624 624 disk->svc_name); 625 625 return EIO; … … 660 660 int rc; 661 661 662 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_create(%zu)", sid);662 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_create(%zu)", sid); 663 663 664 664 rc = vbds_disk_by_svcid(sid, &disk); 665 665 if (rc != EOK) { 666 log_msg(LOG_DEFAULT, LVL_ NOTE, "Disk %zu not found",666 log_msg(LOG_DEFAULT, LVL_ERROR, "Disk %zu not found", 667 667 sid); 668 668 goto error; 669 669 } 670 670 671 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_crate(%zu): "671 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_crate(%zu): " 672 672 "index=%d block0=%" PRIu64 " nblocks=%" PRIu64 673 673 " hdr_blocks=%" PRIu64 " pkind=%d", … … 760 760 rc = vbds_disk_by_svcid(sid, &disk); 761 761 if (rc != EOK) { 762 log_msg(LOG_DEFAULT, LVL_ NOTE, "Disk %zu not found",762 log_msg(LOG_DEFAULT, LVL_DEBUG, "Disk %zu not found", 763 763 sid); 764 764 goto error; … … 767 767 rc = label_suggest_ptype(disk->label, pcnt, ptype); 768 768 if (rc != EOK) { 769 log_msg(LOG_DEFAULT, LVL_ NOTE, "label_suggest_ptype() failed");769 log_msg(LOG_DEFAULT, LVL_DEBUG, "label_suggest_ptype() failed"); 770 770 goto error; 771 771 } … … 780 780 vbds_part_t *part = bd_srv_part(bd); 781 781 782 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_open()");782 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_bd_open()"); 783 783 part->open_cnt++; 784 784 return EOK; … … 789 789 vbds_part_t *part = bd_srv_part(bd); 790 790 791 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_close()");791 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_bd_close()"); 792 792 part->open_cnt--; 793 793 return EOK; … … 800 800 aoff64_t gba; 801 801 802 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_read_blocks()");802 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_bd_read_blocks()"); 803 803 804 804 if (cnt * part->disk->block_size < size) … … 816 816 aoff64_t gba; 817 817 818 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_sync_cache()");818 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_bd_sync_cache()"); 819 819 820 820 /* XXX Allow full-disk sync? */ … … 835 835 aoff64_t gba; 836 836 837 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_write_blocks()");837 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_bd_write_blocks()"); 838 838 839 839 if (cnt * part->disk->block_size < size) … … 850 850 vbds_part_t *part = bd_srv_part(bd); 851 851 852 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_get_block_size()");852 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_bd_get_block_size()"); 853 853 *rsize = part->disk->block_size; 854 854 return EOK; … … 859 859 vbds_part_t *part = bd_srv_part(bd); 860 860 861 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_get_num_blocks()");861 log_msg(LOG_DEFAULT, LVL_DEBUG2, "vbds_bd_get_num_blocks()"); 862 862 *rnb = part->nblocks; 863 863 return EOK; … … 870 870 service_id_t svcid; 871 871 872 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_conn()");872 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_bd_conn()"); 873 873 874 874 svcid = IPC_GET_ARG1(*icall); 875 875 876 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_conn() - svcid=%zu", svcid);876 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_bd_conn() - svcid=%zu", svcid); 877 877 878 878 rc = vbds_part_by_svcid(svcid, &part); 879 879 if (rc != EOK) { 880 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbd_bd_conn() - partition "880 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbd_bd_conn() - partition " 881 881 "not found."); 882 882 async_answer_0(iid, EINVAL); … … 884 884 } 885 885 886 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_bd_conn() - call bd_conn");886 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_bd_conn() - call bd_conn"); 887 887 bd_conn(iid, icall, &part->bds); 888 888 } … … 915 915 } 916 916 917 log_msg(LOG_DEFAULT, LVL_ NOTE, "loc_service_register('%s')",917 log_msg(LOG_DEFAULT, LVL_DEBUG, "loc_service_register('%s')", 918 918 name); 919 919 rc = loc_service_register(name, &psid); … … 952 952 int rc; 953 953 954 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_svc_unregister("954 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_svc_unregister(" 955 955 "disk->svc_name='%s', id=%zu)", part->disk->svc_name, part->svc_id); 956 956 … … 970 970 int rc; 971 971 972 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_indices_update()");972 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_indices_update()"); 973 973 974 974 /* First unregister services for partitions whose index has changed */ … … 977 977 rc = vbds_part_svc_unregister(part); 978 978 if (rc != EOK) { 979 log_msg(LOG_DEFAULT, LVL_ NOTE, "Error "979 log_msg(LOG_DEFAULT, LVL_ERROR, "Error " 980 980 "un-registering partition."); 981 981 return EIO; … … 990 990 rc = vbds_part_svc_register(part); 991 991 if (rc != EOK) { 992 log_msg(LOG_DEFAULT, LVL_ NOTE, "Error "992 log_msg(LOG_DEFAULT, LVL_ERROR, "Error " 993 993 "re-registering partition."); 994 994 return EIO; -
uspace/srv/bd/vbd/vbd.c
r03661d19 r55f8c6e7 58 58 { 59 59 int rc; 60 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_init()");60 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_init()"); 61 61 62 62 rc = vbds_disks_init(); … … 124 124 int rc; 125 125 126 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_disk_info_srv()");126 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_disk_info_srv()"); 127 127 128 128 disk_sid = IPC_GET_ARG1(*icall); … … 164 164 int rc; 165 165 166 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_create_srv()");166 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create_srv()"); 167 167 168 168 disk_sid = IPC_GET_ARG1(*icall); … … 177 177 int rc; 178 178 179 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_delete_srv()");179 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_delete_srv()"); 180 180 181 181 disk_sid = IPC_GET_ARG1(*icall); … … 192 192 int rc; 193 193 194 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_label_get_parts_srv()");194 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_get_parts_srv()"); 195 195 196 196 if (!async_data_read_receive(&callid, &size)) { … … 228 228 int rc; 229 229 230 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_get_info_srv()");230 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_get_info_srv()"); 231 231 232 232 part = IPC_GET_ARG1(*icall); … … 269 269 int rc; 270 270 271 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_create_srv()");271 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_create_srv()"); 272 272 273 273 disk_sid = IPC_GET_ARG1(*icall); … … 308 308 int rc; 309 309 310 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_part_delete_srv()");310 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_part_delete_srv()"); 311 311 312 312 part = IPC_GET_ARG1(*icall); … … 322 322 int rc; 323 323 324 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_suggest_ptype_srv()");324 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_suggest_ptype_srv()"); 325 325 326 326 disk_sid = IPC_GET_ARG1(*icall); … … 359 359 static void vbds_ctl_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 360 360 { 361 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_client_conn()");361 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_client_conn()"); 362 362 363 363 /* Accept the connection */ … … 413 413 service_id_t sid; 414 414 415 log_msg(LOG_DEFAULT, LVL_ NOTE, "vbds_client_conn()");415 log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_client_conn()"); 416 416 417 417 sid = (service_id_t)IPC_GET_ARG1(*icall); -
uspace/srv/volsrv/mkfs.c
r03661d19 r55f8c6e7 59 59 va_end(ap); 60 60 61 log_msg(LOG_DEFAULT, LVL_NOTE, "Calling task_spawn()");62 63 61 va_start(ap, path); 64 62 task_id_t id; … … 66 64 int rc = task_spawn(&id, &wait, path, cnt, ap); 67 65 va_end(ap); 68 69 log_msg(LOG_DEFAULT, LVL_NOTE, "task_spawn() -> rc = %d", rc);70 66 71 67 if (rc != EOK) { … … 75 71 } 76 72 77 log_msg(LOG_DEFAULT, LVL_NOTE, "task_spawn() -> id = %d", (int)id);78 79 73 if (!id) { 80 74 log_msg(LOG_DEFAULT, LVL_ERROR, "Error spawning %s " … … 83 77 } 84 78 85 log_msg(LOG_DEFAULT, LVL_NOTE, "call task_wait()");86 87 79 task_exit_t texit; 88 80 int retval; 89 81 rc = task_wait(&wait, &texit, &retval); 90 log_msg(LOG_DEFAULT, LVL_NOTE, "task_wait() -> rc = %d", rc);91 82 if (rc != EOK) { 92 83 log_msg(LOG_DEFAULT, LVL_ERROR, "Error waiting for %s (%s)", … … 95 86 } 96 87 97 log_msg(LOG_DEFAULT, LVL_NOTE, "task_wait() -> texit = %d", (int)texit);98 88 if (texit != TASK_EXIT_NORMAL) { 99 89 log_msg(LOG_DEFAULT, LVL_ERROR, "Command %s unexpectedly " … … 102 92 } 103 93 104 log_msg(LOG_DEFAULT, LVL_NOTE, "task_wait() -> retval = %d", (int)retval);105 94 if (retval != 0) { 106 95 log_msg(LOG_DEFAULT, LVL_ERROR, "Command %s returned non-zero " … … 141 130 return rc; 142 131 143 log_msg(LOG_DEFAULT, LVL_NOTE, "volsrv_part_mkfs: Run '%s %s'.",144 cmd, svc_name);145 146 132 rc = cmd_runl(cmd, cmd, svc_name, NULL); 147 133 free(svc_name); -
uspace/srv/volsrv/part.c
r03661d19 r55f8c6e7 141 141 return EEXIST; 142 142 143 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_add()");143 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_add_locked()"); 144 144 part = vol_part_new(); 145 145 if (part == NULL) … … 154 154 } 155 155 156 log_msg(LOG_DEFAULT, LVL_ NOTE, "Probe partition %s", part->svc_name);156 log_msg(LOG_DEFAULT, LVL_DEBUG, "Probe partition %s", part->svc_name); 157 157 rc = volsrv_part_is_empty(sid, &empty); 158 158 if (rc != EOK) { … … 255 255 int rc; 256 256 257 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_empty_part()");257 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part()"); 258 258 259 259 rc = volsrv_part_empty(part->svc_id); 260 260 if (rc != EOK) { 261 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_empty_part() - failed %d",261 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part() - failed %d", 262 262 rc); 263 263 return rc; 264 264 } 265 265 266 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_empty_part() - success");267 266 part->pcnt = vpc_empty; 268 267 return EOK; … … 273 272 int rc; 274 273 275 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_mkfs_part()");274 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part()"); 276 275 277 276 rc = volsrv_part_mkfs(part->svc_id, fstype); 278 277 if (rc != EOK) { 279 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_mkfs_part() - failed %d",278 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part() - failed %d", 280 279 rc); 281 280 return rc; 282 281 } 283 282 284 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_part() - success");285 283 part->pcnt = vpc_fs; 286 284 part->fstype = fstype; -
uspace/srv/volsrv/volsrv.c
r03661d19 r55f8c6e7 141 141 142 142 sid = IPC_GET_ARG1(*icall); 143 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_info_srv(%zu)",143 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_info_srv(%zu)", 144 144 sid); 145 145 rc = vol_part_find_by_id(sid, &part); 146 146 if (rc != EOK) { 147 147 async_answer_0(iid, ENOENT); 148 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_info_srv(%zu) - "149 "not found", sid);150 148 return; 151 149 } … … 154 152 if (rc != EOK) { 155 153 async_answer_0(iid, EIO); 156 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_info_srv(%zu) - "157 "get info failed (%d)", sid, rc);158 154 return; 159 155 } … … 164 160 async_answer_0(callid, EREFUSED); 165 161 async_answer_0(iid, EREFUSED); 166 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_info_srv(%zu) - "167 "read receive failed", sid);168 162 return; 169 163 } … … 172 166 async_answer_0(callid, EINVAL); 173 167 async_answer_0(iid, EINVAL); 174 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_info_srv(%zu) - "175 "incorrect size", sid);176 168 return; 177 169 } … … 182 174 async_answer_0(callid, rc); 183 175 async_answer_0(iid, rc); 184 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_info_srv(%zu) - " 185 "data read failed", sid); 186 return; 187 } 188 189 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_info_srv(%zu) - " 190 "success", sid); 176 return; 177 } 178 191 179 async_answer_0(iid, EOK); 192 180 } … … 199 187 200 188 sid = IPC_GET_ARG1(*icall); 201 log_msg(LOG_DEFAULT, LVL_ NOTE, "vol_part_empty_srv(%zu)", sid);189 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_srv(%zu)", sid); 202 190 203 191 rc = vol_part_find_by_id(sid, &part); 204 192 if (rc != EOK) { 205 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_empty_srv(%zu) - "206 "partition not found", sid);207 193 async_answer_0(iid, ENOENT); 208 194 return; 209 195 } 210 196 211 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_empty_srv(%zu) - "212 "call vol_part_empty_part()", sid);213 197 rc = vol_part_empty_part(part); 214 198 if (rc != EOK) { … … 230 214 fstype = IPC_GET_ARG2(*icall); 231 215 232 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv(%zu, %d)", sid,233 fstype);234 235 216 rc = vol_part_find_by_id(sid, &part); 236 217 if (rc != EOK) { 237 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv(%zu) - "238 "partition not found", sid);239 218 async_answer_0(iid, ENOENT); 240 219 return; 241 220 } 242 221 243 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv(%zu) - "244 "call vol_part_mkfs_part()", sid);245 222 rc = vol_part_mkfs_part(part, fstype); 246 223 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.