Changeset b7fd2a0 in mainline for uspace/srv/volsrv
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/srv/volsrv
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/empty.c
r36f0738 rb7fd2a0 44 44 #include "empty.h" 45 45 46 static int empty_get_bsize(void *, size_t *);47 static int empty_get_nblocks(void *, aoff64_t *);48 static int empty_read(void *, aoff64_t, size_t, void *);49 static int empty_write(void *, aoff64_t, size_t, const void *);46 static errno_t empty_get_bsize(void *, size_t *); 47 static errno_t empty_get_nblocks(void *, aoff64_t *); 48 static errno_t empty_read(void *, aoff64_t, size_t, void *); 49 static errno_t empty_write(void *, aoff64_t, size_t, const void *); 50 50 51 51 /** Provide disk access to liblabel */ … … 57 57 }; 58 58 59 int volsrv_part_is_empty(service_id_t sid, bool *rempty)59 errno_t volsrv_part_is_empty(service_id_t sid, bool *rempty) 60 60 { 61 int rc;61 errno_t rc; 62 62 label_bd_t lbd; 63 63 … … 78 78 } 79 79 80 int volsrv_part_empty(service_id_t sid)80 errno_t volsrv_part_empty(service_id_t sid) 81 81 { 82 int rc;82 errno_t rc; 83 83 label_bd_t lbd; 84 84 … … 100 100 101 101 /** Get block size wrapper for liblabel */ 102 static int empty_get_bsize(void *arg, size_t *bsize)102 static errno_t empty_get_bsize(void *arg, size_t *bsize) 103 103 { 104 104 service_id_t svc_id = *(service_id_t *)arg; … … 107 107 108 108 /** Get number of blocks wrapper for liblabel */ 109 static int empty_get_nblocks(void *arg, aoff64_t *nblocks)109 static errno_t empty_get_nblocks(void *arg, aoff64_t *nblocks) 110 110 { 111 111 service_id_t svc_id = *(service_id_t *)arg; … … 114 114 115 115 /** Read blocks wrapper for liblabel */ 116 static int empty_read(void *arg, aoff64_t ba, size_t cnt, void *buf)116 static errno_t empty_read(void *arg, aoff64_t ba, size_t cnt, void *buf) 117 117 { 118 118 service_id_t svc_id = *(service_id_t *)arg; … … 121 121 122 122 /** Write blocks wrapper for liblabel */ 123 static int empty_write(void *arg, aoff64_t ba, size_t cnt, const void *data)123 static errno_t empty_write(void *arg, aoff64_t ba, size_t cnt, const void *data) 124 124 { 125 125 service_id_t svc_id = *(service_id_t *)arg; -
uspace/srv/volsrv/empty.h
r36f0738 rb7fd2a0 40 40 #include <loc.h> 41 41 42 extern int volsrv_part_is_empty(service_id_t, bool *);43 extern int volsrv_part_empty(service_id_t);42 extern errno_t volsrv_part_is_empty(service_id_t, bool *); 43 extern errno_t volsrv_part_empty(service_id_t); 44 44 45 45 #endif -
uspace/srv/volsrv/mkfs.c
r36f0738 rb7fd2a0 47 47 #include "mkfs.h" 48 48 49 static int cmd_runl(const char *path, ...)49 static errno_t cmd_runl(const char *path, ...) 50 50 { 51 51 va_list ap; … … 63 63 task_id_t id; 64 64 task_wait_t wait; 65 int rc = task_spawn(&id, &wait, path, cnt, ap);65 errno_t rc = task_spawn(&id, &wait, path, cnt, ap); 66 66 va_end(ap); 67 67 … … 102 102 103 103 104 int volsrv_part_mkfs(service_id_t sid, vol_fstype_t fstype, const char *label)104 errno_t volsrv_part_mkfs(service_id_t sid, vol_fstype_t fstype, const char *label) 105 105 { 106 106 const char *cmd; 107 107 char *svc_name; 108 int rc;108 errno_t rc; 109 109 110 110 cmd = NULL; -
uspace/srv/volsrv/mkfs.h
r36f0738 rb7fd2a0 41 41 #include <types/vol.h> 42 42 43 extern int volsrv_part_mkfs(service_id_t, vol_fstype_t, const char *);43 extern errno_t volsrv_part_mkfs(service_id_t, vol_fstype_t, const char *); 44 44 extern void volsrv_part_get_lsupp(vol_fstype_t, vol_label_supp_t *); 45 45 -
uspace/srv/volsrv/part.c
r36f0738 rb7fd2a0 50 50 #include "types/part.h" 51 51 52 static int vol_part_add_locked(service_id_t);52 static errno_t vol_part_add_locked(service_id_t); 53 53 static LIST_INITIALIZE(vol_parts); /* of vol_part_t */ 54 54 static FIBRIL_MUTEX_INITIALIZE(vol_parts_lock); … … 69 69 70 70 /** Check for new partitions */ 71 static int vol_part_check_new(void)71 static errno_t vol_part_check_new(void) 72 72 { 73 73 bool already_known; … … 75 75 service_id_t *svcs; 76 76 size_t count, i; 77 int rc;77 errno_t rc; 78 78 79 79 fibril_mutex_lock(&vol_parts_lock); … … 144 144 } 145 145 146 static int vol_part_probe(vol_part_t *part)146 static errno_t vol_part_probe(vol_part_t *part) 147 147 { 148 148 bool empty; … … 150 150 struct fsname_type *fst; 151 151 char *label; 152 int rc;152 errno_t rc; 153 153 154 154 log_msg(LOG_DEFAULT, LVL_NOTE, "Probe partition %s", part->svc_name); … … 204 204 } 205 205 206 static int vol_part_add_locked(service_id_t sid)206 static errno_t vol_part_add_locked(service_id_t sid) 207 207 { 208 208 vol_part_t *part; 209 int rc;209 errno_t rc; 210 210 211 211 assert(fibril_mutex_is_locked(&vol_parts_lock)); … … 244 244 } 245 245 246 int vol_part_add(service_id_t sid)247 { 248 int rc;246 errno_t vol_part_add(service_id_t sid) 247 { 248 errno_t rc; 249 249 250 250 fibril_mutex_lock(&vol_parts_lock); … … 260 260 } 261 261 262 int vol_part_init(void)263 { 264 return EOK; 265 } 266 267 int vol_part_discovery_start(void)268 { 269 int rc;262 errno_t vol_part_init(void) 263 { 264 return EOK; 265 } 266 267 errno_t vol_part_discovery_start(void) 268 { 269 errno_t rc; 270 270 271 271 rc = loc_register_cat_change_cb(vol_part_cat_change_cb); … … 280 280 281 281 /** Get list of partitions as array of service IDs. */ 282 int vol_part_get_ids(service_id_t *id_buf, size_t buf_size, size_t *act_size)282 errno_t vol_part_get_ids(service_id_t *id_buf, size_t buf_size, size_t *act_size) 283 283 { 284 284 size_t act_cnt; … … 308 308 } 309 309 310 int vol_part_find_by_id(service_id_t sid, vol_part_t **rpart)310 errno_t vol_part_find_by_id(service_id_t sid, vol_part_t **rpart) 311 311 { 312 312 list_foreach(vol_parts, lparts, vol_part_t, part) { … … 321 321 } 322 322 323 int vol_part_empty_part(vol_part_t *part)324 { 325 int rc;323 errno_t vol_part_empty_part(vol_part_t *part) 324 { 325 errno_t rc; 326 326 327 327 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part()"); … … 338 338 } 339 339 340 int vol_part_mkfs_part(vol_part_t *part, vol_fstype_t fstype,340 errno_t vol_part_mkfs_part(vol_part_t *part, vol_fstype_t fstype, 341 341 const char *label) 342 342 { 343 int rc;343 errno_t rc; 344 344 345 345 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part()"); … … 370 370 } 371 371 372 int vol_part_get_info(vol_part_t *part, vol_part_info_t *pinfo)372 errno_t vol_part_get_info(vol_part_t *part, vol_part_info_t *pinfo) 373 373 { 374 374 pinfo->pcnt = part->pcnt; -
uspace/srv/volsrv/part.h
r36f0738 rb7fd2a0 43 43 #include "types/part.h" 44 44 45 extern int vol_part_init(void);46 extern int vol_part_discovery_start(void);47 extern int vol_part_add(service_id_t);48 extern int vol_part_get_ids(service_id_t *, size_t, size_t *);49 extern int vol_part_find_by_id(service_id_t, vol_part_t **);50 extern int vol_part_empty_part(vol_part_t *);51 extern int vol_part_mkfs_part(vol_part_t *, vol_fstype_t, const char *);52 extern int vol_part_get_info(vol_part_t *, vol_part_info_t *);45 extern errno_t vol_part_init(void); 46 extern errno_t vol_part_discovery_start(void); 47 extern errno_t vol_part_add(service_id_t); 48 extern errno_t vol_part_get_ids(service_id_t *, size_t, size_t *); 49 extern errno_t vol_part_find_by_id(service_id_t, vol_part_t **); 50 extern errno_t vol_part_empty_part(vol_part_t *); 51 extern errno_t vol_part_mkfs_part(vol_part_t *, vol_fstype_t, const char *); 52 extern errno_t vol_part_get_info(vol_part_t *, vol_part_info_t *); 53 53 54 54 #endif -
uspace/srv/volsrv/volsrv.c
r36f0738 rb7fd2a0 54 54 static void vol_client_conn(ipc_callid_t, ipc_call_t *, void *); 55 55 56 static int vol_init(void)57 { 58 int rc;56 static errno_t vol_init(void) 57 { 58 errno_t rc; 59 59 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_init()"); 60 60 … … 90 90 size_t size; 91 91 size_t act_size; 92 int rc;92 errno_t rc; 93 93 94 94 if (!async_data_read_receive(&callid, &size)) { … … 112 112 } 113 113 114 int retval = async_data_read_finalize(callid, id_buf, size);114 errno_t retval = async_data_read_finalize(callid, id_buf, size); 115 115 free(id_buf); 116 116 … … 121 121 { 122 122 service_id_t sid; 123 int rc;123 errno_t rc; 124 124 125 125 sid = IPC_GET_ARG1(*icall); … … 139 139 vol_part_t *part; 140 140 vol_part_info_t pinfo; 141 int rc;141 errno_t rc; 142 142 143 143 sid = IPC_GET_ARG1(*icall); … … 185 185 service_id_t sid; 186 186 vol_part_t *part; 187 int rc;187 errno_t rc; 188 188 189 189 sid = IPC_GET_ARG1(*icall); … … 209 209 vol_fstype_t fstype; 210 210 vol_label_supp_t vlsupp; 211 int rc;211 errno_t rc; 212 212 213 213 fstype = IPC_GET_ARG1(*icall); … … 249 249 vol_fstype_t fstype; 250 250 char *label; 251 int rc;251 errno_t rc; 252 252 253 253 sid = IPC_GET_ARG1(*icall); … … 327 327 int main(int argc, char *argv[]) 328 328 { 329 int rc;329 errno_t rc; 330 330 331 331 printf("%s: Volume service\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.
