Changeset 0ecfc62 in mainline for uspace/srv/volsrv


Ignore:
Timestamp:
2015-10-09T18:11:08Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a43785
Parents:
372df8f
Message:

Information structures need updating to new model.

Location:
uspace/srv/volsrv
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/volsrv/part.c

    r372df8f r0ecfc62  
    113113
    114114        link_initialize(&part->lparts);
    115         part->dcnt = dc_empty;
     115        part->pcnt = vpc_empty;
    116116
    117117        return part;
     
    149149        log_msg(LOG_DEFAULT, LVL_NOTE, "Probe partition %s", part->svc_name);
    150150
    151         part->dcnt = dc_unknown;
     151        part->pcnt = vpc_unknown;
    152152        list_append(&part->lparts, &vol_parts);
    153153
     
    227227int vol_part_empty_part(vol_part_t *part)
    228228{
    229         part->dcnt = dc_empty;
    230 
    231         return EOK;
    232 }
    233 
    234 int vol_part_get_info(vol_part_t *part, vol_part_info_t *dinfo)
    235 {
    236         dinfo->dcnt = part->dcnt;
     229        part->pcnt = vpc_empty;
     230
     231        return EOK;
     232}
     233
     234int vol_part_get_info(vol_part_t *part, vol_part_info_t *pinfo)
     235{
     236        pinfo->pcnt = part->pcnt;
     237        pinfo->fstype = part->fstype;
    237238        return EOK;
    238239}
  • uspace/srv/volsrv/types/part.h

    r372df8f r0ecfc62  
    4848        /** Service name */
    4949        char *svc_name;
    50         /** Disk contents */
    51         label_disk_cnt_t dcnt;
    52         /** Label type */
    53         label_type_t ltype;
     50        /** Partition contents */
     51        vol_part_cnt_t pcnt;
     52        /** Filesystem type */
     53        vol_fstype_t fstype;
    5454} vol_part_t;
    5555
  • uspace/srv/volsrv/volsrv.c

    r372df8f r0ecfc62  
    4040#include <ipc/vol.h>
    4141#include <loc.h>
     42#include <macros.h>
    4243#include <stdio.h>
    4344#include <stdlib.h>
     
    135136        }
    136137
    137         async_answer_3(iid, rc, pinfo.dcnt, pinfo.ltype, pinfo.flags);
     138        ipc_callid_t callid;
     139        size_t size;
     140        if (!async_data_read_receive(&callid, &size)) {
     141                async_answer_0(callid, EREFUSED);
     142                async_answer_0(iid, EREFUSED);
     143                return;
     144        }
     145
     146        if (size != sizeof(vol_part_info_t)) {
     147                async_answer_0(callid, EINVAL);
     148                async_answer_0(iid, EINVAL);
     149                return;
     150        }
     151
     152        rc = async_data_read_finalize(callid, &pinfo,
     153            min(size, sizeof(pinfo)));
     154        if (rc != EOK) {
     155                async_answer_0(callid, rc);
     156                async_answer_0(iid, rc);
     157                return;
     158        }
     159
     160        async_answer_0(iid, EOK);
    138161}
    139162
Note: See TracChangeset for help on using the changeset viewer.