Changeset f57ccb5 in mainline for uspace/lib/c/generic/vbd.c


Ignore:
Timestamp:
2015-08-11T16:03:59Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0bde8523
Parents:
1b23e33
Message:

Set partition type based on selected filesystem type.

File:
1 edited

Legend:

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

    r1b23e33 rf57ccb5  
    330330}
    331331
     332/** Suggest partition type based on partition content.
     333 *
     334 * @param vbd   Virtual Block Device
     335 * @param disk  Disk on which the partition will be created
     336 * @param pcnt  Partition content
     337 * @param ptype Place to store suggested partition type
     338 *
     339 * @return EOK on success or negative error code
     340 */
     341int vbd_suggest_ptype(vbd_t *vbd, service_id_t disk, label_pcnt_t pcnt,
     342    label_ptype_t *ptype)
     343{
     344        async_exch_t *exch;
     345        sysarg_t retval;
     346        ipc_call_t answer;
     347
     348        exch = async_exchange_begin(vbd->sess);
     349        aid_t req = async_send_2(exch, VBD_SUGGEST_PTYPE, disk, pcnt, &answer);
     350        int rc = async_data_read_start(exch, ptype, sizeof(label_ptype_t));
     351        async_exchange_end(exch);
     352
     353        if (rc != EOK) {
     354                async_forget(req);
     355                return EIO;
     356        }
     357
     358        async_wait_for(req, &retval);
     359        if (retval != EOK)
     360                return EIO;
     361
     362        return EOK;
     363}
     364
     365
    332366/** @}
    333367 */
Note: See TracChangeset for help on using the changeset viewer.