Changeset d3b2ffa in mainline for uspace/app/fdisk/fdisk.c


Ignore:
Timestamp:
2018-06-29T15:40:10Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e904dd
Parents:
1e472ee (diff), 1a9174e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge volume management improvements (still WIP).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/fdisk/fdisk.c

    r1e472ee rd3b2ffa  
    3737#include <cap.h>
    3838#include <errno.h>
     39#include <fdisk.h>
     40#include <io/label.h>
    3941#include <nchoice.h>
    4042#include <stdbool.h>
    4143#include <stdio.h>
    4244#include <stdlib.h>
    43 #include <fdisk.h>
    4445#include <str.h>
     46#include <vol.h>
    4547
    4648#define NO_LABEL_CAPTION "(No name)"
     
    6971} devac_t;
    7072
    71 static errno_t fdsk_pcnt_fs_format(vol_part_cnt_t pcnt, vol_fstype_t fstype,
    72     char **rstr)
    73 {
    74         errno_t rc;
    75         char *s;
    76 
    77         switch (pcnt) {
    78         case vpc_empty:
    79                 s = str_dup("Empty");
    80                 if (s == NULL)
    81                         return ENOMEM;
    82                 break;
    83         case vpc_fs:
    84                 rc = fdisk_fstype_format(fstype, &s);
    85                 if (rc != EOK)
    86                         return ENOMEM;
    87                 break;
    88         case vpc_unknown:
    89                 s = str_dup("Unknown");
    90                 if (s == NULL)
    91                         return ENOMEM;
    92                 break;
    93         }
    94 
    95         *rstr = s;
    96         return EOK;
    97 }
    98 
    9973/** Confirm user selection. */
    10074static errno_t fdsk_confirm(const char *msg, bool *rconfirm)
     
    305279
    306280        for (i = LT_FIRST; i < LT_LIMIT; i++) {
    307                 rc = fdisk_ltype_format(i, &sltype);
     281                rc = label_type_format(i, &sltype);
    308282                if (rc != EOK)
    309283                        goto error;
     
    413387
    414388        for (i = 0; i < VOL_FSTYPE_LIMIT; i++) {
    415                 rc = fdisk_fstype_format(i, &sfstype);
     389                rc = vol_fstype_format(i, &sfstype);
    416390                if (rc != EOK)
    417391                        goto error;
     
    598572                }
    599573
    600                 rc = fdisk_pkind_format(pinfo.pkind, &spkind);
     574                rc = label_pkind_format(pinfo.pkind, &spkind);
    601575                if (rc != EOK) {
    602576                        printf("\nOut of memory.\n");
     
    605579
    606580                if (pinfo.pkind != lpk_extended) {
    607                         rc = fdsk_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
     581                        rc = vol_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
    608582                        if (rc != EOK) {
    609583                                printf("Out of memory.\n");
     
    773747                break;
    774748        default:
    775                 rc = fdisk_ltype_format(linfo.ltype, &sltype);
     749                rc = label_type_format(linfo.ltype, &sltype);
    776750                if (rc != EOK) {
    777751                        assert(rc == ENOMEM);
     
    804778                }
    805779
    806                 rc = fdsk_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
     780                rc = vol_pcnt_fs_format(pinfo.pcnt, pinfo.fstype, &sfstype);
    807781                if (rc != EOK) {
    808782                        printf("Out of memory.\n");
     
    821795
    822796                if ((linfo.flags & lf_ext_supp) != 0) {
    823                         rc = fdisk_pkind_format(pinfo.pkind, &spkind);
     797                        rc = label_pkind_format(pinfo.pkind, &spkind);
    824798                        if (rc != EOK) {
    825799                                printf("\nOut of memory.\n");
Note: See TracChangeset for help on using the changeset viewer.