Changeset ca7fa5b in mainline
- Timestamp:
- 2025-04-02T18:24:11Z (6 weeks ago)
- Children:
- 800d188
- Parents:
- bbcd06e
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hrctl/hrctl.c
rbbcd06e rca7fa5b 289 289 str_error(rc)); 290 290 } else { 291 printf("hrctl: auto assembled % lu volumes\n",291 printf("hrctl: auto assembled %zu volumes\n", 292 292 cnt); 293 293 } … … 431 431 printf("hrctl: auto assemble rc: %s\n", str_error(rc)); 432 432 } else { 433 printf("hrctl: auto assembled % lu volumes\n",433 printf("hrctl: auto assembled %zu volumes\n", 434 434 assembled_cnt); 435 435 } -
uspace/lib/device/src/hr.c
rbbcd06e rca7fa5b 195 195 printf("--- vol %zu ---\n", index); 196 196 197 printf("svc_id: % lu\n", vol_info->svc_id);197 printf("svc_id: %" PRIun "\n", vol_info->svc_id); 198 198 199 199 rc = loc_service_get_name(vol_info->svc_id, &devname); … … 211 211 if (vol_info->level == HR_LVL_0 || vol_info->level == HR_LVL_4) { 212 212 if (vol_info->strip_size / 1024 < 1) 213 printf("strip size in bytes: % u\n",213 printf("strip size in bytes: %" PRIu32 "\n", 214 214 vol_info->strip_size); 215 215 else 216 printf("strip size: % uK\n",216 printf("strip size: %" PRIu32 "K\n", 217 217 vol_info->strip_size / 1024); 218 218 } 219 printf("size in bytes: % luMiB\n",219 printf("size in bytes: %" PRIu64 "MiB\n", 220 220 vol_info->nblocks * vol_info->bsize / 1024 / 1024); 221 printf("size in blocks: % lu\n", vol_info->nblocks);221 printf("size in blocks: %" PRIu64 "\n", vol_info->nblocks); 222 222 printf("block size: %zu\n", vol_info->bsize); 223 223 -
uspace/srv/bd/hr/io.c
rbbcd06e rca7fa5b 37 37 #include <errno.h> 38 38 #include <hr.h> 39 #include <inttypes.h> 39 40 #include <stdio.h> 40 41 #include <str_error.h> … … 51 52 errno_t rc; 52 53 53 HR_DEBUG("WORKER on extent: %lu, ba: %lu, cnt: %lu\n", 54 io->extent, io->ba, io->cnt); 54 const char *debug_type_str = NULL; 55 switch (io->type) { 56 case HR_BD_SYNC: 57 debug_type_str = "SYNC"; 58 break; 59 case HR_BD_READ: 60 debug_type_str = "READ"; 61 break; 62 case HR_BD_WRITE: 63 debug_type_str = "WRITE"; 64 break; 65 } 66 67 HR_DEBUG("%s WORKER (%p) on extent: %zu, ba: %" PRIu64 ", " 68 "cnt: %" PRIu64 "\n", 69 debug_type_str, io, io->extent, io->ba, io->cnt); 55 70 56 71 switch (io->type) { … … 73 88 } 74 89 90 HR_DEBUG("WORKER (%p) rc: %s\n", io, str_error(rc)); 91 75 92 /* 76 93 * We don't have to invalidate extents who got ENOMEM … … 82 99 io->state_callback(io->vol, io->extent, rc); 83 100 84 HR_DEBUG("WORKER rc: %s\n", str_error(rc));85 86 101 return rc; 87 102 } -
uspace/srv/bd/hr/raid1.c
rbbcd06e rca7fa5b 38 38 #include <errno.h> 39 39 #include <hr.h> 40 #include <inttypes.h> 40 41 #include <io/log.h> 41 42 #include <ipc/hr.h> … … 522 523 } 523 524 524 HR_DEBUG("hr_raid1_rebuild(): rebuild finished on \"%s\" (% lu), "525 "extent no. % lu\n", vol->devname, vol->svc_id, rebuild_idx);525 HR_DEBUG("hr_raid1_rebuild(): rebuild finished on \"%s\" (%" PRIun "), " 526 "extent no. %zu\n", vol->devname, vol->svc_id, rebuild_idx); 526 527 527 528 fibril_rwlock_write_lock(&vol->states_lock); … … 616 617 hr_extent_t *rebuild_ext = &vol->extents[bad]; 617 618 618 HR_DEBUG("hr_raid1_rebuild(): starting REBUILD on extent no. % lu (%lu)"619 " \n", bad, rebuild_ext->svc_id);619 HR_DEBUG("hr_raid1_rebuild(): starting REBUILD on extent no. %zu " 620 "(%" PRIun ")\n", bad, rebuild_ext->svc_id); 620 621 621 622 atomic_store_explicit(&vol->rebuild_blk, 0, memory_order_relaxed); … … 687 688 if (i + 1 >= vol->extent_no) { 688 689 if (rc != ENOMEM) { 689 HR_ERROR("rebuild on \"%s\" (% lu), failed due"690 " to too many failed extents\n",690 HR_ERROR("rebuild on \"%s\" (%" PRIun "), " 691 "failed due to too many failed extents\n", 691 692 vol->devname, vol->svc_id); 692 693 } … … 694 695 /* for now we have to invalidate the rebuild extent */ 695 696 if (rc == ENOMEM) { 696 HR_ERROR("rebuild on \"%s\" (% lu), failed due"697 " to too many failed reads, because of not"698 " enough memory\n",697 HR_ERROR("rebuild on \"%s\" (%" PRIun "), " 698 "failed due to too many failed reads, " 699 "because of not enough memory\n", 699 700 vol->devname, vol->svc_id); 700 701 hr_raid1_ext_state_callback(vol, rebuild_idx, … … 718 719 hr_raid1_ext_state_callback(vol, rebuild_idx, rc); 719 720 720 HR_ERROR("rebuild on \"%s\" (% lu), failed due to "721 "the rebuilt extent no. % lu WRITE (rc: %s)\n",721 HR_ERROR("rebuild on \"%s\" (%" PRIun "), failed due to " 722 "the rebuilt extent no. %zu WRITE (rc: %s)\n", 722 723 vol->devname, vol->svc_id, rebuild_idx, str_error(rc)); 723 724 -
uspace/srv/bd/hr/raid5.c
rbbcd06e rca7fa5b 39 39 #include <errno.h> 40 40 #include <hr.h> 41 #include <inttypes.h> 41 42 #include <io/log.h> 42 43 #include <ipc/hr.h> … … 770 771 hr_extent_t *rebuild_ext = &vol->extents[bad]; 771 772 772 HR_DEBUG("hr_raid5_rebuild(): starting rebuild on (% lu)\n",773 HR_DEBUG("hr_raid5_rebuild(): starting rebuild on (%" PRIun ")\n", 773 774 rebuild_ext->svc_id); 774 775 … … 804 805 if (rc != EOK) { 805 806 hr_raid5_handle_extent_error(vol, i, rc); 806 HR_ERROR("rebuild on \"%s\" (%lu), failed due " 807 "to a failed ONLINE extent, number %lu\n", 807 HR_ERROR("rebuild on \"%s\" (%" PRIun "), " 808 "failed due to a failed ONLINE extent, " 809 "number %zu\n", 808 810 vol->devname, vol->svc_id, i); 809 811 goto end; … … 819 821 if (rc != EOK) { 820 822 hr_raid5_handle_extent_error(vol, bad, rc); 821 HR_ERROR("rebuild on \"%s\" (% lu), failed due to "822 "the rebuilt extent number % lu failing\n",823 HR_ERROR("rebuild on \"%s\" (%" PRIun "), failed due to " 824 "the rebuilt extent number %zu failing\n", 823 825 vol->devname, vol->svc_id, bad); 824 826 goto end; … … 838 840 } 839 841 840 HR_DEBUG("hr_raid5_rebuild(): rebuild finished on \"%s\" (% lu), "841 "extent number % lu\n", vol->devname, vol->svc_id, hotspare_idx);842 HR_DEBUG("hr_raid5_rebuild(): rebuild finished on \"%s\" (%" PRIun "), " 843 "extent number %zu\n", vol->devname, vol->svc_id, hotspare_idx); 842 844 843 845 hr_update_ext_status(vol, bad, HR_EXT_ONLINE); -
uspace/srv/bd/hr/superblock.c
rbbcd06e rca7fa5b 37 37 #include <byteorder.h> 38 38 #include <errno.h> 39 #include <inttypes.h> 39 40 #include <io/log.h> 40 41 #include <loc.h> … … 291 292 } 292 293 printf("\n"); 293 printf("\tnblocks: % lu\n", metadata->nblocks);294 printf("\tdata_blkno: % lu\n", metadata->data_blkno);295 printf("\ttruncated_blkno: % lu\n", metadata->truncated_blkno);296 printf("\tdata_offset: % lu\n", metadata->data_offset);297 printf("\tcounter: % lu\n", metadata->counter);298 printf("\tversion: % u\n", metadata->version);299 printf("\textent_no: % u\n", metadata->extent_no);300 printf("\tindex: % u\n", metadata->index);301 printf("\tlevel: % u\n", metadata->level);302 printf("\tlayout: % u\n", metadata->layout);303 printf("\tstrip_size: % u\n", metadata->strip_size);304 printf("\tbsize: % u\n", metadata->bsize);294 printf("\tnblocks: %" PRIu64 "\n", metadata->nblocks); 295 printf("\tdata_blkno: %" PRIu64 "\n", metadata->data_blkno); 296 printf("\ttruncated_blkno: %" PRIu64 "\n", metadata->truncated_blkno); 297 printf("\tdata_offset: %" PRIu64 "\n", metadata->data_offset); 298 printf("\tcounter: %" PRIu64 "\n", metadata->counter); 299 printf("\tversion: %" PRIu32 "\n", metadata->version); 300 printf("\textent_no: %" PRIu32 "\n", metadata->extent_no); 301 printf("\tindex: %" PRIu32 "\n", metadata->index); 302 printf("\tlevel: %" PRIu32 "\n", metadata->level); 303 printf("\tlayout: %" PRIu32 "\n", metadata->layout); 304 printf("\tstrip_size: %" PRIu32 "\n", metadata->strip_size); 305 printf("\tbsize: %" PRIu32 "\n", metadata->bsize); 305 306 printf("\tdevname: %s\n", metadata->devname); 306 307 } -
uspace/srv/bd/hr/util.c
rbbcd06e rca7fa5b 39 39 #include <fibril_synch.h> 40 40 #include <hr.h> 41 #include <inttypes.h> 41 42 #include <io/log.h> 42 43 #include <loc.h> … … 234 235 235 236 errno_t rc; 236 size_t i, blkno, bsize; 237 uint64_t blkno; 238 size_t i, bsize; 237 239 size_t last_bsize = 0; 238 240 … … 244 246 } 245 247 246 HR_DEBUG("%s(): block_init() on (%lu)\n", __func__, svc_id); 248 HR_DEBUG("%s(): block_init() on (%" PRIun ")\n", __func__, 249 svc_id); 247 250 rc = block_init(svc_id); 248 251 if (rc != EOK) { 249 HR_DEBUG("%s(): initing (% lu) failed, aborting\n",252 HR_DEBUG("%s(): initing (%" PRIun ") failed, aborting\n", 250 253 __func__, svc_id); 251 254 goto error; … … 298 301 for (i = 0; i < vol->extent_no; i++) { 299 302 if (vol->extents[i].svc_id != 0) { 300 HR_DEBUG("hr_fini_devs(): block_fini() on (% lu)\n",303 HR_DEBUG("hr_fini_devs(): block_fini() on (%" PRIun ")\n", 301 304 vol->extents[i].svc_id); 302 305 block_fini(vol->extents[i].svc_id); … … 306 309 for (i = 0; i < vol->hotspare_no; i++) { 307 310 if (vol->hotspares[i].svc_id != 0) { 308 HR_DEBUG("hr_fini_devs(): block_fini() on (% lu)\n",311 HR_DEBUG("hr_fini_devs(): block_fini() on (%" PRIun ")\n", 309 312 vol->hotspares[i].svc_id); 310 313 block_fini(vol->hotspares[i].svc_id); … … 370 373 } 371 374 372 void hr_update_ext_status(hr_volume_t *vol, size_t ext ent, hr_ext_status_t s)375 void hr_update_ext_status(hr_volume_t *vol, size_t ext_idx, hr_ext_status_t s) 373 376 { 374 377 if (vol->level != HR_LVL_0) … … 377 380 assert(fibril_rwlock_is_write_locked(&vol->states_lock)); 378 381 379 assert(ext ent< vol->extent_no);380 381 hr_ext_status_t old = vol->extents[ext ent].status;382 HR_WARN("\"%s\": changing extent % lu state: %s -> %s\n",383 vol->devname, ext ent, hr_get_ext_status_msg(old),382 assert(ext_idx < vol->extent_no); 383 384 hr_ext_status_t old = vol->extents[ext_idx].status; 385 HR_WARN("\"%s\": changing extent %zu state: %s -> %s\n", 386 vol->devname, ext_idx, hr_get_ext_status_msg(old), 384 387 hr_get_ext_status_msg(s)); 385 vol->extents[extent].status = s; 386 } 387 388 void hr_update_hotspare_status(hr_volume_t *vol, size_t hs, hr_ext_status_t s) 388 vol->extents[ext_idx].status = s; 389 } 390 391 void hr_update_hotspare_status(hr_volume_t *vol, size_t hs_idx, 392 hr_ext_status_t s) 389 393 { 390 394 assert(fibril_mutex_is_locked(&vol->hotspare_lock)); 391 395 392 assert(hs < vol->hotspare_no);393 394 hr_ext_status_t old = vol->hotspares[hs ].status;395 HR_WARN("\"%s\": changing hotspare % lu state: %s -> %s\n",396 vol->devname, hs , hr_get_ext_status_msg(old),396 assert(hs_idx < vol->hotspare_no); 397 398 hr_ext_status_t old = vol->hotspares[hs_idx].status; 399 HR_WARN("\"%s\": changing hotspare %zu state: %s -> %s\n", 400 vol->devname, hs_idx, hr_get_ext_status_msg(old), 397 401 hr_get_ext_status_msg(s)); 398 vol->hotspares[hs ].status = s;402 vol->hotspares[hs_idx].status = s; 399 403 } 400 404 … … 408 412 } 409 413 410 void hr_update_ext_svc_id(hr_volume_t *vol, size_t ext ent, service_id_t new)414 void hr_update_ext_svc_id(hr_volume_t *vol, size_t ext_idx, service_id_t new) 411 415 { 412 416 if (vol->level != HR_LVL_0) 413 417 assert(fibril_rwlock_is_write_locked(&vol->extents_lock)); 414 418 415 assert(extent < vol->extent_no); 416 417 service_id_t old = vol->extents[extent].svc_id; 418 HR_WARN("\"%s\": changing extent no. %lu svc_id: (%lu) -> (%lu)\n", 419 vol->devname, extent, old, new); 420 vol->extents[extent].svc_id = new; 421 } 422 423 void hr_update_hotspare_svc_id(hr_volume_t *vol, size_t hs, service_id_t new) 419 assert(ext_idx < vol->extent_no); 420 421 service_id_t old = vol->extents[ext_idx].svc_id; 422 HR_WARN("\"%s\": changing extent no. %zu svc_id: (%" PRIun ") -> " 423 "(%" PRIun ")\n", vol->devname, ext_idx, old, new); 424 vol->extents[ext_idx].svc_id = new; 425 } 426 427 void hr_update_hotspare_svc_id(hr_volume_t *vol, size_t hs_idx, 428 service_id_t new) 424 429 { 425 430 assert(fibril_mutex_is_locked(&vol->hotspare_lock)); 426 431 427 assert(hs < vol->hotspare_no);428 429 service_id_t old = vol->hotspares[hs ].svc_id;430 HR_WARN("\"%s\": changing hotspare no. % lu svc_id: (%lu) -> (%lu)\n",431 vol->devname, hs, old, new);432 vol->hotspares[hs ].svc_id = new;432 assert(hs_idx < vol->hotspare_no); 433 434 service_id_t old = vol->hotspares[hs_idx].svc_id; 435 HR_WARN("\"%s\": changing hotspare no. %zu svc_id: (%" PRIun ") -> " 436 "(%" PRIun ")\n", vol->devname, hs_idx, old, new); 437 vol->hotspares[hs_idx].svc_id = new; 433 438 } 434 439 … … 805 810 vol->extents[iter->md->index].svc_id = iter->svc_id; 806 811 807 size_t blkno;812 uint64_t blkno; 808 813 rc = block_get_nblocks(iter->svc_id, &blkno); 809 814 if (rc != EOK) … … 1049 1054 goto error; 1050 1055 1051 size_t hs_blkno;1056 uint64_t hs_blkno; 1052 1057 rc = block_get_nblocks(hotspare, &hs_blkno); 1053 1058 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.