Changeset f0f8787 in mainline for uspace/srv
- Timestamp:
- 2018-10-04T14:53:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c5429fe
- Parents:
- 1bb43d5
- git-author:
- Jiri Svoboda <jiri@…> (2018-10-03 21:51:40)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-10-04 14:53:29)
- Location:
- uspace/srv/volsrv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/part.c
r1bb43d5 rf0f8787 602 602 } 603 603 604 /** Insert volume. 605 * 606 * Re-mount the volume in the partition, if applicable. 607 * 608 * @param part Partition 609 */ 610 errno_t vol_part_insert_part(vol_part_t *part) 611 { 612 int rc; 613 614 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_insert_part()"); 615 616 fibril_mutex_lock(&part->parts->lock); 617 618 if (part->cur_mp != NULL) { 619 fibril_mutex_unlock(&part->parts->lock); 620 return EOK; 621 } 622 623 rc = vol_part_probe(part); 624 if (rc != EOK) 625 goto error; 626 627 rc = vol_part_mount(part); 628 if (rc != EOK) 629 goto error; 630 631 fibril_mutex_unlock(&part->parts->lock); 632 633 return EOK; 634 error: 635 return rc; 636 } 637 604 638 /** Set mount point. 605 639 * -
uspace/srv/volsrv/part.h
r1bb43d5 rf0f8787 55 55 extern errno_t vol_part_eject_part(vol_part_t *); 56 56 extern errno_t vol_part_empty_part(vol_part_t *); 57 extern errno_t vol_part_insert_part(vol_part_t *); 57 58 extern errno_t vol_part_mkfs_part(vol_part_t *, vol_fstype_t, const char *, 58 59 const char *); -
uspace/srv/volsrv/volsrv.c
r1bb43d5 rf0f8787 210 210 if (rc != EOK) { 211 211 async_answer_0(icall, ENOENT); 212 goto error;212 return; 213 213 } 214 214 215 215 rc = vol_part_eject_part(part); 216 if (rc != EOK) { 217 async_answer_0(icall, EIO); 218 goto error; 219 } 220 221 async_answer_0(icall, EOK); 222 error: 223 vol_part_del_ref(part); 224 } 225 226 static void vol_part_insert_srv(vol_parts_t *parts, ipc_call_t *icall) 227 { 228 service_id_t sid; 229 vol_part_t *part; 230 errno_t rc; 231 232 sid = IPC_GET_ARG1(*icall); 233 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_insert_srv(%zu)", sid); 234 235 rc = vol_part_find_by_id_ref(parts, sid, &part); 236 if (rc != EOK) { 237 async_answer_0(icall, ENOENT); 238 return; 239 } 240 241 rc = vol_part_insert_part(part); 216 242 if (rc != EOK) { 217 243 async_answer_0(icall, EIO); … … 429 455 vol_part_empty_srv(parts, &call); 430 456 break; 457 case VOL_PART_INSERT: 458 vol_part_insert_srv(parts, &call); 459 break; 431 460 case VOL_PART_LSUPP: 432 461 vol_part_get_lsupp_srv(parts, &call);
Note:
See TracChangeset
for help on using the changeset viewer.