Changeset 150adbd2 in mainline for uspace/app
- Timestamp:
- 2025-06-29T10:08:40Z (4 months ago)
- Children:
- 40ab4901
- Parents:
- 93ea452
- File:
-
- 1 edited
-
uspace/app/hrctl/hrctl.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hrctl/hrctl.c
r93ea452 r150adbd2 52 52 static errno_t fill_config_devs(int, char **, hr_config_t *); 53 53 static errno_t get_vol_configs_from_sif(const char *, hr_config_t **, size_t *); 54 static int create_from_config(hr_t *, const char * );55 static int create_from_argv(hr_t *, int, char ** );54 static int create_from_config(hr_t *, const char *, uint8_t); 55 static int create_from_argv(hr_t *, int, char **, uint8_t); 56 56 static int handle_create(hr_t *, int, char **); 57 57 static int assemble_from_config(hr_t *, const char *); … … 70 70 " -h, --help Display this message and exit.\n" 71 71 "\n" 72 " -c, --create Create a volume, options:\n"72 " -c, --create [--no_meta] Create a volume, options:\n" 73 73 " name {-l , --level level} device... manual device specification, or\n" 74 74 " -f configuration.sif create from configuration file.\n" … … 108 108 "\n" 109 109 "Notes:\n" 110 " Add --no_meta after --create to disable storing on-disk metadata.\n" 110 111 " Simulating an extent failure with -m volume -f index is dangerous. It marks\n" 111 112 " metadata as dirty in other healthy extents, and zeroes out the superblock\n" … … 341 342 } 342 343 343 static int create_from_config(hr_t *hr, const char *config_path) 344 static int create_from_config(hr_t *hr, const char *config_path, 345 uint8_t vol_flags) 344 346 { 345 347 hr_config_t *vol_configs = NULL; … … 351 353 return EXIT_FAILURE; 352 354 } 355 356 for (size_t i = 0; i < vol_count; i++) 357 vol_configs[i].vol_flags |= vol_flags; 353 358 354 359 for (size_t i = 0; i < vol_count; i++) { … … 368 373 } 369 374 370 static int create_from_argv(hr_t *hr, int argc, char **argv )375 static int create_from_argv(hr_t *hr, int argc, char **argv, uint8_t vol_flags) 371 376 { 372 377 /* we need name + --level + arg + at least one extent */ … … 381 386 return EXIT_FAILURE; 382 387 } 388 389 vol_config->vol_flags |= vol_flags; 383 390 384 391 const char *name = argv[optind++]; … … 441 448 { 442 449 int rc; 450 uint8_t vol_flags = 0; 443 451 444 452 if (optind >= argc) { 445 453 printf(NAME ": no arguments to --create\n"); 446 454 return EXIT_FAILURE; 455 } 456 457 if (str_cmp(argv[optind], "--no_meta") == 0) { 458 vol_flags |= HR_VOL_FLAG_NOOP_META; 459 optind++; 447 460 } 448 461 … … 461 474 } 462 475 463 rc = create_from_config(hr, config_path );476 rc = create_from_config(hr, config_path, vol_flags); 464 477 } else { 465 rc = create_from_argv(hr, argc, argv );478 rc = create_from_argv(hr, argc, argv, vol_flags); 466 479 } 467 480
Note:
See TracChangeset
for help on using the changeset viewer.
