Changeset 64ffd83 in mainline for uspace/srv/volsrv/volsrv.c


Ignore:
Timestamp:
2018-07-24T09:43:38Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bec18a9
Parents:
05208d9
git-author:
Jiri Svoboda <jiri@…> (2018-07-23 18:41:45)
git-committer:
Jiri Svoboda <jiri@…> (2018-07-24 09:43:38)
Message:

Configuring mount point for (newly created) paritions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/volsrv/volsrv.c

    r05208d9 r64ffd83  
    4949#include "mkfs.h"
    5050#include "part.h"
     51#include "volume.h"
    5152
    5253#define NAME  "volsrv"
     
    5758{
    5859        errno_t rc;
     60        vol_volumes_t *volumes = NULL;
    5961        vol_parts_t *parts = NULL;
    6062
    6163        log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_init()");
    6264
    63         rc = vol_parts_create(&parts);
     65        rc = vol_volumes_create(&volumes);
     66        if (rc != EOK)
     67                goto error;
     68
     69        rc = vol_parts_create(volumes, &parts);
    6470        if (rc != EOK)
    6571                goto error;
     
    8793        return EOK;
    8894error:
     95        vol_volumes_destroy(volumes);
    8996        vol_parts_destroy(parts);
    9097        return rc;
     
    131138        sid = IPC_GET_ARG1(*icall);
    132139
    133         rc = vol_part_add(parts, sid);
     140        rc = vol_part_add_part(parts, sid);
    134141        if (rc != EOK) {
    135142                async_answer_0(icall, rc);
     
    285292        vol_fstype_t fstype;
    286293        char *label;
     294        char *mountp;
    287295        errno_t rc;
    288296
     
    304312        }
    305313
     314        rc = async_data_write_accept((void **)&mountp, true, 0, VOL_MOUNTP_MAXLEN,
     315            0, NULL);
     316        if (rc != EOK) {
     317                free(label);
     318                async_answer_0(icall, rc);
     319                return;
     320        }
     321
     322        if (mountp != NULL) {
     323                log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv: mountp='%s'",
     324                    mountp);
     325        }
     326
    306327        rc = vol_part_find_by_id_ref(parts, sid, &part);
    307328        if (rc != EOK) {
     
    311332        }
    312333
    313         rc = vol_part_mkfs_part(part, fstype, label);
     334        rc = vol_part_mkfs_part(part, fstype, label, mountp);
    314335        if (rc != EOK) {
    315336                free(label);
Note: See TracChangeset for help on using the changeset viewer.