Changeset 4285f384 in mainline for uspace/app/vol/vol.c
- Timestamp:
- 2025-02-25T20:25:43Z (17 hours ago)
- Branches:
- master
- Parents:
- d231a54
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vol/vol.c
rd231a54 r4285f384 1 1 /* 2 * Copyright (c) 20 17Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 36 36 #include <io/table.h> 37 37 #include <loc.h> 38 #include <stdbool.h> 38 39 #include <stdio.h> 39 40 #include <stdlib.h> … … 107 108 } 108 109 109 static errno_t vol_cmd_eject(const char *volspec )110 static errno_t vol_cmd_eject(const char *volspec, bool physical) 110 111 { 111 112 vol_t *vol = NULL; … … 125 126 } 126 127 127 rc = vol_part_eject(vol, part_id); 128 rc = vol_part_eject(vol, part_id, physical ? vef_physical : 129 vef_none); 128 130 if (rc != EOK) { 129 131 printf("Error ejecting volume.\n"); … … 323 325 { 324 326 printf("Syntax:\n"); 325 printf(" %s List present volumes\n", NAME); 326 printf(" %s -c List volume configuration entries\n", NAME); 327 printf(" %s -h Print help\n", NAME); 328 printf(" %s eject <mp> Eject volume mounted in a directory\n", NAME); 329 printf(" %s insert <svc> Insert volume based on service identifier\n", NAME); 330 printf(" %s insert -p <mp> Insert volume based on filesystem path\n", NAME); 327 printf(" %s List present volumes\n", NAME); 328 printf(" %s -c List volume configuration entries\n", NAME); 329 printf(" %s -h Print help\n", NAME); 330 printf(" %s eject [-s] <mp> Eject volume mounted in a directory\n", NAME); 331 printf(" -s to eject physically\n"); 332 printf(" %s insert <svc> Insert volume based on service identifier\n", NAME); 333 printf(" %s insert -p <mp> Insert volume based on filesystem path\n", NAME); 331 334 } 332 335 … … 336 339 char *volspec; 337 340 vol_cmd_t vcmd; 341 bool physical = false; 338 342 int i; 339 343 errno_t rc = EINVAL; … … 351 355 } else if (str_cmp(cmd, "eject") == 0) { 352 356 vcmd = vcmd_eject; 357 if (str_cmp(argv[i], "-s") == 0) { 358 physical = true; 359 ++i; 360 } 361 353 362 if (argc <= i) { 354 363 printf("Parameter missing.\n"); … … 382 391 switch (vcmd) { 383 392 case vcmd_eject: 384 rc = vol_cmd_eject(volspec );393 rc = vol_cmd_eject(volspec, physical); 385 394 break; 386 395 case vcmd_insert:
Note:
See TracChangeset
for help on using the changeset viewer.