Changes in uspace/srv/volsrv/part.c [9c2c7d2:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/part.c
r9c2c7d2 rb7fd2a0 37 37 #include <stdbool.h> 38 38 #include <errno.h> 39 #include <str_error.h> 39 40 #include <fibril_synch.h> 40 41 #include <io/log.h> … … 49 50 #include "types/part.h" 50 51 51 static int vol_part_add_locked(service_id_t);52 static errno_t vol_part_add_locked(service_id_t); 52 53 static LIST_INITIALIZE(vol_parts); /* of vol_part_t */ 53 54 static FIBRIL_MUTEX_INITIALIZE(vol_parts_lock); … … 68 69 69 70 /** Check for new partitions */ 70 static int vol_part_check_new(void)71 static errno_t vol_part_check_new(void) 71 72 { 72 73 bool already_known; … … 74 75 service_id_t *svcs; 75 76 size_t count, i; 76 int rc;77 errno_t rc; 77 78 78 79 fibril_mutex_lock(&vol_parts_lock); … … 143 144 } 144 145 145 static int vol_part_probe(vol_part_t *part)146 static errno_t vol_part_probe(vol_part_t *part) 146 147 { 147 148 bool empty; … … 149 150 struct fsname_type *fst; 150 151 char *label; 151 int rc;152 errno_t rc; 152 153 153 154 log_msg(LOG_DEFAULT, LVL_NOTE, "Probe partition %s", part->svc_name); … … 203 204 } 204 205 205 static int vol_part_add_locked(service_id_t sid)206 static errno_t vol_part_add_locked(service_id_t sid) 206 207 { 207 208 vol_part_t *part; 208 int rc;209 errno_t rc; 209 210 210 211 assert(fibril_mutex_is_locked(&vol_parts_lock)); … … 243 244 } 244 245 245 int vol_part_add(service_id_t sid)246 { 247 int rc;246 errno_t vol_part_add(service_id_t sid) 247 { 248 errno_t rc; 248 249 249 250 fibril_mutex_lock(&vol_parts_lock); … … 259 260 } 260 261 261 int vol_part_init(void)262 { 263 return EOK; 264 } 265 266 int vol_part_discovery_start(void)267 { 268 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; 269 270 270 271 rc = loc_register_cat_change_cb(vol_part_cat_change_cb); 271 272 if (rc != EOK) { 272 273 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering callback " 273 "for partition discovery (%d).", rc);274 "for partition discovery: %s.", str_error(rc)); 274 275 return rc; 275 276 } … … 279 280 280 281 /** Get list of partitions as array of service IDs. */ 281 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) 282 283 { 283 284 size_t act_cnt; … … 307 308 } 308 309 309 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) 310 311 { 311 312 list_foreach(vol_parts, lparts, vol_part_t, part) { … … 320 321 } 321 322 322 int vol_part_empty_part(vol_part_t *part)323 { 324 int rc;323 errno_t vol_part_empty_part(vol_part_t *part) 324 { 325 errno_t rc; 325 326 326 327 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part()"); … … 328 329 rc = volsrv_part_empty(part->svc_id); 329 330 if (rc != EOK) { 330 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part() - failed % d",331 rc);331 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_part() - failed %s", 332 str_error(rc)); 332 333 return rc; 333 334 } … … 337 338 } 338 339 339 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, 340 341 const char *label) 341 342 { 342 int rc;343 errno_t rc; 343 344 344 345 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part()"); … … 348 349 rc = volsrv_part_mkfs(part->svc_id, fstype, label); 349 350 if (rc != EOK) { 350 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part() - failed % d",351 rc);351 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_mkfs_part() - failed %s", 352 str_error(rc)); 352 353 fibril_mutex_unlock(&vol_parts_lock); 353 354 return rc; … … 369 370 } 370 371 371 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) 372 373 { 373 374 pinfo->pcnt = part->pcnt;
Note:
See TracChangeset
for help on using the changeset viewer.