Changeset 2d78d88 in mainline for uspace/lib
- Timestamp:
- 2018-07-25T17:04:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efa3136
- Parents:
- bec18a9
- Location:
- uspace/lib
- Files:
-
- 9 edited
-
c/generic/vol.c (modified) (1 diff)
-
c/include/ipc/vol.h (modified) (1 diff)
-
c/include/types/label.h (modified) (1 diff)
-
c/include/vol.h (modified) (1 diff)
-
fdisk/include/fdisk.h (modified) (1 diff)
-
fdisk/src/fdisk.c (modified) (1 diff)
-
label/src/gpt.c (modified) (2 diffs)
-
label/src/mbr.c (modified) (2 diffs)
-
label/test/label.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vol.c
rbec18a9 r2d78d88 338 338 } 339 339 340 /** Set mount point for partition. 341 * 342 * @param vol Volume service 343 * @param sid Partition service ID 344 * @param mountp Mount point 345 * 346 * @return EOK on success or an error code 347 */ 348 errno_t vol_part_set_mountp(vol_t *vol, service_id_t sid, 349 const char *mountp) 350 { 351 async_exch_t *exch; 352 ipc_call_t answer; 353 errno_t retval; 354 355 exch = async_exchange_begin(vol->sess); 356 aid_t req = async_send_1(exch, VOL_PART_SET_MOUNTP, sid, 357 &answer); 358 359 retval = async_data_write_start(exch, mountp, str_size(mountp)); 360 if (retval != EOK) { 361 async_exchange_end(exch); 362 async_forget(req); 363 return retval; 364 } 365 366 async_exchange_end(exch); 367 async_wait_for(req, &retval); 368 369 if (retval != EOK) 370 return retval; 371 372 return EOK; 373 } 374 340 375 /** Format file system type as string. 341 376 * -
uspace/lib/c/include/ipc/vol.h
rbec18a9 r2d78d88 46 46 VOL_PART_EMPTY, 47 47 VOL_PART_LSUPP, 48 VOL_PART_MKFS 48 VOL_PART_MKFS, 49 VOL_PART_SET_MOUNTP 49 50 } vol_request_t; 50 51 -
uspace/lib/c/include/types/label.h
rbec18a9 r2d78d88 86 86 lf_can_create_log = 0x10, 87 87 /** Currently it is possible to delete a partition */ 88 lf_can_delete_part = 0x20 88 lf_can_delete_part = 0x20, 89 /** Currently it is possible to modify a partition */ 90 lf_can_modify_part = 0x40 89 91 } label_flags_t; 90 92 -
uspace/lib/c/include/vol.h
rbec18a9 r2d78d88 53 53 extern errno_t vol_part_mkfs(vol_t *, service_id_t, vol_fstype_t, const char *, 54 54 const char *); 55 extern errno_t vol_part_set_mountp(vol_t *, service_id_t, const char *); 55 56 56 57 extern errno_t vol_fstype_format(vol_fstype_t, char **); -
uspace/lib/fdisk/include/fdisk.h
rbec18a9 r2d78d88 71 71 fdisk_part_t **); 72 72 extern errno_t fdisk_part_destroy(fdisk_part_t *); 73 extern errno_t fdisk_part_set_mountp(fdisk_part_t *, const char *); 73 74 extern void fdisk_pspec_init(fdisk_part_spec_t *); 74 75 -
uspace/lib/fdisk/src/fdisk.c
rbec18a9 r2d78d88 820 820 } 821 821 822 /** Set partition mount point. 823 * 824 * @param part Fdisk partition 825 * @param mountp Mount point 826 * 827 * @return EOK on success or error code 828 */ 829 errno_t fdisk_part_set_mountp(fdisk_part_t *part, const char *mountp) 830 { 831 return vol_part_set_mountp(part->dev->fdisk->vol, 832 part->svc_id, mountp); 833 } 834 822 835 void fdisk_pspec_init(fdisk_part_spec_t *pspec) 823 836 { -
uspace/lib/label/src/gpt.c
rbec18a9 r2d78d88 580 580 } 581 581 582 static bool gpt_can_modify_part(label_t *label) 583 { 584 return list_count(&label->parts) > 0; 585 } 586 582 587 static errno_t gpt_get_info(label_t *label, label_info_t *linfo) 583 588 { … … 589 594 if (gpt_can_delete_part(label)) 590 595 linfo->flags = linfo->flags | lf_can_delete_part; 596 if (gpt_can_modify_part(label)) 597 linfo->flags = linfo->flags | lf_can_modify_part; 591 598 linfo->ablock0 = label->ablock0; 592 599 linfo->anblocks = label->anblocks; -
uspace/lib/label/src/mbr.c
rbec18a9 r2d78d88 428 428 } 429 429 430 static bool mbr_can_modify_part(label_t *label) 431 { 432 return list_count(&label->parts) > 0; 433 } 434 435 430 436 static errno_t mbr_get_info(label_t *label, label_info_t *linfo) 431 437 { … … 448 454 if (mbr_can_delete_part(label)) 449 455 linfo->flags |= lf_can_delete_part; 456 /* Can modify partition */ 457 if (mbr_can_modify_part(label)) 458 linfo->flags |= lf_can_modify_part; 450 459 451 460 linfo->ablock0 = label->ablock0; -
uspace/lib/label/test/label.c
rbec18a9 r2d78d88 357 357 PCUT_ASSERT_INT_EQUALS(lt_mbr, linfo.ltype); 358 358 PCUT_ASSERT_INT_EQUALS(lf_ext_supp | lf_can_create_pri | 359 lf_can_create_ext | lf_can_delete_part, linfo.flags); 359 lf_can_create_ext | lf_can_delete_part | lf_can_modify_part, 360 linfo.flags); 360 361 361 362 part = label_part_first(label); … … 443 444 PCUT_ASSERT_INT_EQUALS(lt_mbr, linfo.ltype); 444 445 PCUT_ASSERT_INT_EQUALS(lf_ext_supp | lf_can_create_pri | 445 lf_can_create_log | lf_can_delete_part, linfo.flags); 446 lf_can_create_log | lf_can_delete_part | lf_can_modify_part, 447 linfo.flags); 446 448 447 449 epart = label_part_first(label); … … 586 588 PCUT_ASSERT_INT_EQUALS(lt_gpt, linfo.ltype); 587 589 PCUT_ASSERT_INT_EQUALS(lf_can_create_pri | lf_ptype_uuid | 588 lf_can_delete_part , linfo.flags);590 lf_can_delete_part | lf_can_modify_part, linfo.flags); 589 591 590 592 part = label_part_first(label);
Note:
See TracChangeset
for help on using the changeset viewer.
