Changeset deacc58d in mainline for uspace/lib/label/include/types/liblabel.h
- Timestamp:
- 2017-06-20T17:34:02Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 80da8f70
- Parents:
- 63e27ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/label/include/types/liblabel.h
r63e27ef rdeacc58d 40 40 #include <types/label.h> 41 41 #include <offset.h> 42 #include <stddef.h> 42 43 #include <vol.h> 43 44 #include <uuid.h> … … 48 49 typedef struct label_part_info label_part_info_t; 49 50 typedef struct label_part_spec label_part_spec_t; 51 typedef struct label_bd label_bd_t; 52 typedef struct label_bd_ops label_bd_ops_t; 50 53 51 54 /** Ops for individual label type */ 52 55 typedef 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 **); 55 58 void (*close)(label_t *); 56 59 int (*destroy)(label_t *); … … 138 141 } label_mbr_t; 139 142 143 /** Block device operations */ 144 struct 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 */ 156 struct label_bd { 157 /** Ops structure */ 158 label_bd_ops_t *ops; 159 /** Argument */ 160 void *arg; 161 }; 162 140 163 /** Label instance */ 141 164 struct label { … … 144 167 /** Label type */ 145 168 label_type_t ltype; 146 /** Block device service ID*/147 service_id_t svc_id;169 /** Block device */ 170 label_bd_t bd; 148 171 /** Partitions */ 149 172 list_t parts; /* of label_part_t */
Note:
See TracChangeset
for help on using the changeset viewer.