Ignore:
Timestamp:
2017-06-20T17:34:02Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
80da8f70
Parents:
63e27ef
Message:

Break liblabel dependency on libblock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/label/include/types/liblabel.h

    r63e27ef rdeacc58d  
    4040#include <types/label.h>
    4141#include <offset.h>
     42#include <stddef.h>
    4243#include <vol.h>
    4344#include <uuid.h>
     
    4849typedef struct label_part_info label_part_info_t;
    4950typedef struct label_part_spec label_part_spec_t;
     51typedef struct label_bd label_bd_t;
     52typedef struct label_bd_ops label_bd_ops_t;
    5053
    5154/** Ops for individual label type */
    5255typedef struct {
    53         int (*open)(service_id_t, label_t **);
    54         int (*create)(service_id_t, label_t **);
     56        int (*open)(label_bd_t *, label_t **);
     57        int (*create)(label_bd_t *, label_t **);
    5558        void (*close)(label_t *);
    5659        int (*destroy)(label_t *);
     
    138141} label_mbr_t;
    139142
     143/** Block device operations */
     144struct label_bd_ops {
     145        /** Get block size */
     146        int (*get_bsize)(void *, size_t *);
     147        /** Get number of blocks */
     148        int (*get_nblocks)(void *, aoff64_t *);
     149        /** Read blocks */
     150        int (*read)(void *, aoff64_t, size_t, void *);
     151        /** Write blocks */
     152        int (*write)(void *, aoff64_t, size_t, const void *);
     153};
     154
     155/** Block device */
     156struct label_bd {
     157        /** Ops structure */
     158        label_bd_ops_t *ops;
     159        /** Argument */
     160        void *arg;
     161};
     162
    140163/** Label instance */
    141164struct label {
     
    144167        /** Label type */
    145168        label_type_t ltype;
    146         /** Block device service ID */
    147         service_id_t svc_id;
     169        /** Block device */
     170        label_bd_t bd;
    148171        /** Partitions */
    149172        list_t parts; /* of label_part_t */
Note: See TracChangeset for help on using the changeset viewer.