Changeset edebb4a1 in mainline for uspace/lib/c


Ignore:
Timestamp:
2015-10-14T22:30:12Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ea0ff6b
Parents:
4b6635a7
Message:

Handle dummy partition addition/removal during label destruction/creation. Handle dummy label properly in fdisk.

Location:
uspace/lib/c
Files:
5 edited

Legend:

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

    r4b6635a7 redebb4a1  
    188188}
    189189
     190/** Add partition.
     191 *
     192 * After a partition is created (e.g. as a result of deleting a label
     193 * the dummy partition is created), it can take some (unknown) time
     194 * until it is discovered.
     195 */
     196int vol_part_add(vol_t *vol, service_id_t sid)
     197{
     198        async_exch_t *exch;
     199        int retval;
     200
     201        exch = async_exchange_begin(vol->sess);
     202        retval = async_req_1_0(exch, VOL_PART_ADD, sid);
     203        async_exchange_end(exch);
     204
     205        if (retval != EOK)
     206                return retval;
     207
     208        return EOK;
     209}
     210
    190211/** Get partition information. */
    191212int vol_part_info(vol_t *vol, service_id_t sid, vol_part_info_t *vinfo)
  • uspace/lib/c/include/ipc/vol.h

    r4b6635a7 redebb4a1  
    3838typedef enum {
    3939        VOL_GET_PARTS = IPC_FIRST_USER_METHOD,
     40        VOL_PART_ADD,
    4041        VOL_PART_INFO,
    4142        VOL_PART_EMPTY
  • uspace/lib/c/include/types/label.h

    r4b6635a7 redebb4a1  
    8181        /** Currently it is possible to create an extended partition */
    8282        lf_can_create_ext = 0x8,
    83         /** Currrently it is possible to create a logical partition */
    84         lf_can_create_log = 0x10
     83        /** Currently it is possible to create a logical partition */
     84        lf_can_create_log = 0x10,
     85        /** Currently it is possible to delete a partition */
     86        lf_can_delete_part = 0x20
    8587} label_flags_t;
    8688
  • uspace/lib/c/include/types/vol.h

    r4b6635a7 redebb4a1  
    5555#define VOL_FSTYPE_LIMIT (fs_ext4 + 1)
    5656
     57/** Volume service */
     58typedef struct vol {
     59        /** Volume service session */
     60        async_sess_t *sess;
     61} vol_t;
     62
     63/** Partition information */
     64typedef struct {
     65        /** Partition content type */
     66        vol_part_cnt_t pcnt;
     67        /** Filesystem type */
     68        vol_fstype_t fstype;
     69} vol_part_info_t;
     70
    5771#endif
    5872
  • uspace/lib/c/include/vol.h

    r4b6635a7 redebb4a1  
    4242#include <types/vol.h>
    4343
    44 /** Volume service */
    45 typedef struct vol {
    46         /** Volume service session */
    47         async_sess_t *sess;
    48 } vol_t;
    49 
    50 /** Partition information */
    51 typedef struct {
    52         /** Partition content type */
    53         vol_part_cnt_t pcnt;
    54         /** Filesystem type */
    55         vol_fstype_t fstype;
    56 } vol_part_info_t;
    57 
    5844extern int vol_create(vol_t **);
    5945extern void vol_destroy(vol_t *);
    6046extern int vol_get_parts(vol_t *, service_id_t **, size_t *);
     47extern int vol_part_add(vol_t *, service_id_t);
    6148extern int vol_part_info(vol_t *, service_id_t, vol_part_info_t *);
    6249extern int vol_part_empty(vol_t *, service_id_t);
Note: See TracChangeset for help on using the changeset viewer.