Ignore:
File:
1 edited

Legend:

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

    rb7fd2a0 rcde999a  
    4444#include <vbd.h>
    4545
    46 static errno_t vbd_get_ids_internal(vbd_t *, sysarg_t, sysarg_t, sysarg_t **,
     46static int vbd_get_ids_internal(vbd_t *, sysarg_t, sysarg_t, sysarg_t **,
    4747    size_t *);
    4848
    49 errno_t vbd_create(vbd_t **rvbd)
     49int vbd_create(vbd_t **rvbd)
    5050{
    5151        vbd_t *vbd;
    5252        service_id_t vbd_svcid;
    53         errno_t rc;
     53        int rc;
    5454
    5555        vbd = calloc(1, sizeof(vbd_t));
     
    9797 * @return EOK on success or an error code
    9898 */
    99 errno_t vbd_get_disks(vbd_t *vbd, service_id_t **data, size_t *count)
     99int vbd_get_disks(vbd_t *vbd, service_id_t **data, size_t *count)
    100100{
    101101        return vbd_get_ids_internal(vbd, VBD_GET_DISKS, 0, data, count);
     
    103103
    104104/** Get disk information. */
    105 errno_t vbd_disk_info(vbd_t *vbd, service_id_t sid, vbd_disk_info_t *vinfo)
    106 {
    107         async_exch_t *exch;
    108         errno_t retval;
     105int vbd_disk_info(vbd_t *vbd, service_id_t sid, vbd_disk_info_t *vinfo)
     106{
     107        async_exch_t *exch;
     108        int retval;
    109109        ipc_call_t answer;
    110110
    111111        exch = async_exchange_begin(vbd->sess);
    112112        aid_t req = async_send_1(exch, VBD_DISK_INFO, sid, &answer);
    113         errno_t rc = async_data_read_start(exch, vinfo, sizeof(vbd_disk_info_t));
    114         async_exchange_end(exch);
    115 
    116         if (rc != EOK) {
    117                 async_forget(req);
    118                 return EIO;
    119         }
    120 
    121         async_wait_for(req, &retval);
    122         if (retval != EOK)
    123                 return EIO;
    124 
    125         return EOK;
    126 }
    127 
    128 errno_t vbd_label_create(vbd_t *vbd, service_id_t sid, label_type_t ltype)
    129 {
    130         async_exch_t *exch;
    131         errno_t retval;
     113        int rc = async_data_read_start(exch, vinfo, sizeof(vbd_disk_info_t));
     114        async_exchange_end(exch);
     115
     116        if (rc != EOK) {
     117                async_forget(req);
     118                return EIO;
     119        }
     120
     121        async_wait_for(req, &retval);
     122        if (retval != EOK)
     123                return EIO;
     124
     125        return EOK;
     126}
     127
     128int vbd_label_create(vbd_t *vbd, service_id_t sid, label_type_t ltype)
     129{
     130        async_exch_t *exch;
     131        int retval;
    132132
    133133        exch = async_exchange_begin(vbd->sess);
     
    141141}
    142142
    143 errno_t vbd_label_delete(vbd_t *vbd, service_id_t sid)
    144 {
    145         async_exch_t *exch;
    146         errno_t retval;
     143int vbd_label_delete(vbd_t *vbd, service_id_t sid)
     144{
     145        async_exch_t *exch;
     146        int retval;
    147147
    148148        exch = async_exchange_begin(vbd->sess);
     
    167167 * @return EOK on success or an error code.
    168168 */
    169 static errno_t vbd_get_ids_once(vbd_t *vbd, sysarg_t method, sysarg_t arg1,
     169static int vbd_get_ids_once(vbd_t *vbd, sysarg_t method, sysarg_t arg1,
    170170    sysarg_t *id_buf, size_t buf_size, size_t *act_size)
    171171{
     
    174174        ipc_call_t answer;
    175175        aid_t req = async_send_1(exch, method, arg1, &answer);
    176         errno_t rc = async_data_read_start(exch, id_buf, buf_size);
     176        int rc = async_data_read_start(exch, id_buf, buf_size);
    177177
    178178        async_exchange_end(exch);
     
    183183        }
    184184
    185         errno_t retval;
     185        int retval;
    186186        async_wait_for(req, &retval);
    187187
     
    205205 * @return       EOK on success or an error code
    206206 */
    207 static errno_t vbd_get_ids_internal(vbd_t *vbd, sysarg_t method, sysarg_t arg1,
     207static int vbd_get_ids_internal(vbd_t *vbd, sysarg_t method, sysarg_t arg1,
    208208    sysarg_t **data, size_t *count)
    209209{
     
    212212
    213213        size_t act_size = 0;
    214         errno_t rc = vbd_get_ids_once(vbd, method, arg1, NULL, 0, &act_size);
     214        int rc = vbd_get_ids_once(vbd, method, arg1, NULL, 0, &act_size);
    215215        if (rc != EOK)
    216216                return rc;
     
    249249 * @return EOK on success or an error code
    250250 */
    251 errno_t vbd_label_get_parts(vbd_t *vbd, service_id_t disk,
     251int vbd_label_get_parts(vbd_t *vbd, service_id_t disk,
    252252    service_id_t **data, size_t *count)
    253253{
     
    256256}
    257257
    258 errno_t vbd_part_get_info(vbd_t *vbd, vbd_part_id_t part, vbd_part_info_t *pinfo)
    259 {
    260         async_exch_t *exch;
    261         errno_t retval;
     258int vbd_part_get_info(vbd_t *vbd, vbd_part_id_t part, vbd_part_info_t *pinfo)
     259{
     260        async_exch_t *exch;
     261        int retval;
    262262        ipc_call_t answer;
    263263
    264264        exch = async_exchange_begin(vbd->sess);
    265265        aid_t req = async_send_1(exch, VBD_PART_GET_INFO, part, &answer);
    266         errno_t rc = async_data_read_start(exch, pinfo, sizeof(vbd_part_info_t));
    267         async_exchange_end(exch);
    268 
    269         if (rc != EOK) {
    270                 async_forget(req);
    271                 return EIO;
    272         }
    273 
    274         async_wait_for(req, &retval);
    275         if (retval != EOK)
    276                 return EIO;
    277 
    278         return EOK;
    279 }
    280 
    281 errno_t vbd_part_create(vbd_t *vbd, service_id_t disk, vbd_part_spec_t *pspec,
     266        int rc = async_data_read_start(exch, pinfo, sizeof(vbd_part_info_t));
     267        async_exchange_end(exch);
     268
     269        if (rc != EOK) {
     270                async_forget(req);
     271                return EIO;
     272        }
     273
     274        async_wait_for(req, &retval);
     275        if (retval != EOK)
     276                return EIO;
     277
     278        return EOK;
     279}
     280
     281int vbd_part_create(vbd_t *vbd, service_id_t disk, vbd_part_spec_t *pspec,
    282282    vbd_part_id_t *rpart)
    283283{
    284284        async_exch_t *exch;
    285         errno_t retval;
     285        int retval;
    286286        ipc_call_t answer;
    287287
    288288        exch = async_exchange_begin(vbd->sess);
    289289        aid_t req = async_send_1(exch, VBD_PART_CREATE, disk, &answer);
    290         errno_t rc = async_data_write_start(exch, pspec, sizeof(vbd_part_spec_t));
     290        int rc = async_data_write_start(exch, pspec, sizeof(vbd_part_spec_t));
    291291        async_exchange_end(exch);
    292292
     
    305305}
    306306
    307 errno_t vbd_part_delete(vbd_t *vbd, vbd_part_id_t part)
    308 {
    309         async_exch_t *exch;
    310         errno_t retval;
     307int vbd_part_delete(vbd_t *vbd, vbd_part_id_t part)
     308{
     309        async_exch_t *exch;
     310        int retval;
    311311
    312312        exch = async_exchange_begin(vbd->sess);
     
    334334 * @return EOK on success or an error code
    335335 */
    336 errno_t vbd_suggest_ptype(vbd_t *vbd, service_id_t disk, label_pcnt_t pcnt,
     336int vbd_suggest_ptype(vbd_t *vbd, service_id_t disk, label_pcnt_t pcnt,
    337337    label_ptype_t *ptype)
    338338{
    339339        async_exch_t *exch;
    340         errno_t retval;
     340        int retval;
    341341        ipc_call_t answer;
    342342
    343343        exch = async_exchange_begin(vbd->sess);
    344344        aid_t req = async_send_2(exch, VBD_SUGGEST_PTYPE, disk, pcnt, &answer);
    345         errno_t rc = async_data_read_start(exch, ptype, sizeof(label_ptype_t));
     345        int rc = async_data_read_start(exch, ptype, sizeof(label_ptype_t));
    346346        async_exchange_end(exch);
    347347
Note: See TracChangeset for help on using the changeset viewer.