Changeset 372df8f in mainline for uspace/lib/c/generic/vol.c


Ignore:
Timestamp:
2015-10-09T07:00:23Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ecfc62
Parents:
0bde8523
Message:

Let VBD handle unlabeled devices too. Now volsrv only cares about partitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/vol.c

    r0bde8523 r372df8f  
    175175}
    176176
    177 /** Get list of disks as array of service IDs.
     177/** Get list of partitions as array of service IDs.
    178178 *
    179179 * @param vol Volume service
     
    183183 * @return EOK on success or negative error code
    184184 */
    185 int vol_get_disks(vol_t *vol, service_id_t **data, size_t *count)
    186 {
    187         return vol_get_ids_internal(vol, VOL_GET_DISKS, 0, data, count);
    188 }
    189 
    190 /** Get disk information. */
    191 int vol_disk_info(vol_t *vol, service_id_t sid, vol_disk_info_t *vinfo)
     185int vol_get_parts(vol_t *vol, service_id_t **data, size_t *count)
     186{
     187        return vol_get_ids_internal(vol, VOL_GET_PARTS, 0, data, count);
     188}
     189
     190/** Get partition information. */
     191int vol_part_info(vol_t *vol, service_id_t sid, vol_part_info_t *vinfo)
    192192{
    193193        async_exch_t *exch;
     
    196196
    197197        exch = async_exchange_begin(vol->sess);
    198         retval = async_req_1_3(exch, VOL_DISK_INFO, sid, &dcnt, &ltype,
     198        retval = async_req_1_3(exch, VOL_PART_INFO, sid, &dcnt, &ltype,
    199199            &flags);
    200200        async_exchange_end(exch);
     
    209209}
    210210
    211 /** Create new label. */
    212 int vol_label_create(vol_t *vol, service_id_t sid, label_type_t ltype)
     211/** Erase partition (to the extent where we will consider it not containing
     212 * a file system. */
     213int vol_part_empty(vol_t *vol, service_id_t sid)
    213214{
    214215        async_exch_t *exch;
     
    216217
    217218        exch = async_exchange_begin(vol->sess);
    218         retval = async_req_2_0(exch, VOL_LABEL_CREATE, sid, ltype);
     219        retval = async_req_1_0(exch, VOL_PART_EMPTY, sid);
    219220        async_exchange_end(exch);
    220221
     
    225226}
    226227
    227 /** Erase disk (to the extent where we will consider it not containing
    228  * a label or file system. */
    229 int vol_disk_empty(vol_t *vol, service_id_t sid)
    230 {
    231         async_exch_t *exch;
    232         int retval;
    233 
    234         exch = async_exchange_begin(vol->sess);
    235         retval = async_req_1_0(exch, VOL_DISK_EMPTY, sid);
    236         async_exchange_end(exch);
    237 
    238         if (retval != EOK)
    239                 return EIO;
    240 
    241         return EOK;
    242 }
    243 
    244228/** @}
    245229 */
Note: See TracChangeset for help on using the changeset viewer.