Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fdisk/src/fdisk.c

    rd1582b50 r25444332  
    11/*
    2  * Copyright (c) 2015 Jiri Svoboda
     2 * Copyright (c) 2026 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    673673        info->fstype = part->fstype;
    674674        info->pkind = part->pkind;
     675        info->index = part->index;
    675676        info->label = part->label;
    676677        info->svc_id = part->svc_id;
     
    810811}
    811812
     813/** Destroy partition.
     814 *
     815 * @param part Partition
     816 * @return EOK on success or error code
     817 */
    812818errno_t fdisk_part_destroy(fdisk_part_t *part)
    813819{
    814820        errno_t rc;
     821
     822        rc = vol_part_eject(part->dev->fdisk->vol, part->svc_id, vef_none);
     823        if (rc != EOK)
     824                return EIO;
    815825
    816826        rc = vbd_part_delete(part->dev->fdisk->vbd, part->part_id);
     
    10221032
    10231033        if (pspec->pkind != lpk_logical) {
    1024                 rc = fdisk_part_get_free_idx(dev, &index);
    1025                 if (rc != EOK)
    1026                         return EIO;
     1034                if (pspec->index == 0) {
     1035                        /* allocate first free index */
     1036                        rc = fdisk_part_get_free_idx(dev, &index);
     1037                        if (rc != EOK)
     1038                                return EIO;
     1039                } else {
     1040                        /* user-specified index */
     1041                        index = pspec->index;
     1042                }
    10271043        } else {
    10281044                index = 0;
Note: See TracChangeset for help on using the changeset viewer.