Changeset b7a4d06 in mainline for uspace/lib/c


Ignore:
Timestamp:
2015-07-18T12:55:12Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c43db5f
Parents:
70815a24
Message:

Most of extended (but not logical) partition support.

Location:
uspace/lib/c
Files:
5 edited

Legend:

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

    r70815a24 rb7a4d06  
    264264{
    265265        async_exch_t *exch;
    266         sysarg_t index;
    267         sysarg_t b0_lo, b0_hi;
    268         sysarg_t nb_lo, nb_hi;
    269         int retval;
    270 
    271         exch = async_exchange_begin(vbd->sess);
    272         retval = async_req_1_5(exch, VBD_PART_GET_INFO, part, &index,
    273             &b0_lo, &b0_hi, &nb_lo, &nb_hi);
    274         async_exchange_end(exch);
    275 
    276         if (retval != EOK)
    277                 return EIO;
    278 
    279         pinfo->index = index;
    280         pinfo->block0 = MERGE_LOUP32(b0_lo, b0_hi);
    281         pinfo->nblocks = MERGE_LOUP32(nb_lo, nb_hi);
     266        sysarg_t retval;
     267        ipc_call_t answer;
     268
     269        exch = async_exchange_begin(vbd->sess);
     270        aid_t req = async_send_1(exch, VBD_PART_GET_INFO, part, &answer);
     271        int rc = async_data_read_start(exch, pinfo, sizeof(vbd_part_info_t));
     272        async_exchange_end(exch);
     273
     274        if (rc != EOK) {
     275                async_forget(req);
     276                return EIO;
     277        }
     278
     279        async_wait_for(req, &retval);
     280        if (retval != EOK)
     281                return EIO;
     282
    282283        return EOK;
    283284}
  • uspace/lib/c/generic/vol.c

    r70815a24 rb7a4d06  
    192192{
    193193        async_exch_t *exch;
    194         sysarg_t dcnt, ltype;
     194        sysarg_t dcnt, ltype, flags;
    195195        int retval;
    196196
    197197        exch = async_exchange_begin(vol->sess);
    198         retval = async_req_1_2(exch, VOL_DISK_INFO, sid, &dcnt, &ltype);
     198        retval = async_req_1_3(exch, VOL_DISK_INFO, sid, &dcnt, &ltype,
     199            &flags);
    199200        async_exchange_end(exch);
    200201
     
    204205        vinfo->dcnt = (label_disk_cnt_t)dcnt;
    205206        vinfo->ltype = (label_type_t)ltype;
     207        vinfo->flags = (label_flags_t)flags;
    206208        return EOK;
    207209}
  • uspace/lib/c/include/types/label.h

    r70815a24 rb7a4d06  
    5858#define LT_LIMIT (lt_gpt + 1)
    5959
     60/** Partition kind */
     61typedef enum {
     62        /** Primary partition */
     63        lpk_primary,
     64        /** Extended partition */
     65        lpk_extended,
     66        /** Logical partition */
     67        lpk_logical
     68} label_pkind_t;
     69
     70/** Label flags */
     71typedef enum {
     72        /** Label supports extended (and logical) partitions */
     73        lf_ext_supp = 0x1,
     74        /** Currently it is possible to create a primary partition */
     75        lf_can_create_pri = 0x2,
     76        /** Currently it is possible to create an extended partition */
     77        lf_can_create_ext = 0x4,
     78        /** Currrently it is possible to create a logical partition */
     79        lf_can_create_log = 0x8
     80} label_flags_t;
    6081
    6182#endif
  • uspace/lib/c/include/vbd.h

    r70815a24 rb7a4d06  
    5151        /** Label type */
    5252        label_type_t ltype;
     53        /** Label flags */
     54        label_flags_t flags;
    5355        /** First block that can be allocated */
    5456        aoff64_t ablock0;
     
    6769        /** Number of blocks */
    6870        aoff64_t nblocks;
     71        /** Partition kind */
     72        label_pkind_t pkind;
    6973        /** Partition type */
    7074        uint64_t ptype;
     
    7579        /** Partition index */
    7680        int index;
     81        /** Partition kind */
     82        label_pkind_t pkind;
    7783        /** First block */
    7884        aoff64_t block0;
  • uspace/lib/c/include/vol.h

    r70815a24 rb7a4d06  
    5353        /** Label type, if disk contents is label */
    5454        label_type_t ltype;
     55        /** Label flags */
     56        label_flags_t flags;
    5557} vol_disk_info_t;
    5658
Note: See TracChangeset for help on using the changeset viewer.