Changes in uspace/srv/volsrv/part.c [4285f384:9e45a41] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/part.c
r4285f384 r9e45a41 1 1 /* 2 * Copyright (c) 20 25 Jiri Svoboda2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 36 36 37 37 #include <adt/list.h> 38 #include <bd.h>39 38 #include <errno.h> 40 39 #include <fibril_synch.h> … … 53 52 #include "types/part.h" 54 53 #include "volume.h" 55 #include "volsrv.h"56 54 57 55 static errno_t vol_part_add_locked(vol_parts_t *, service_id_t); … … 405 403 part->cur_mp_auto = mp_auto; 406 404 407 if (str_cmp(mp, "/w") == 0) {408 log_msg(LOG_DEFAULT, LVL_NOTE, "Mounted system volume - "409 "loading additional configuration.");410 rc = vol_volumes_merge_to(part->parts->volumes,411 vol_cfg_file);412 if (rc != EOK) {413 log_msg(LOG_DEFAULT, LVL_ERROR, "Error loading "414 "additional configuration.");415 return rc;416 }417 }418 419 405 return rc; 420 406 } … … 643 629 } 644 630 645 static errno_t vol_part_eject_device(service_id_t svcid) 646 { 647 async_sess_t *sess; 648 errno_t rc; 649 bd_t *bd; 650 651 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_eject_device(%zu)", 652 (size_t)svcid); 653 654 sess = loc_service_connect(svcid, INTERFACE_BLOCK, 0); 655 if (sess == NULL) 656 return EIO; 657 658 rc = bd_open(sess, &bd); 659 if (rc != EOK) { 660 async_hangup(sess); 661 return EIO; 662 } 663 664 rc = bd_eject(bd); 665 if (rc != EOK) { 666 log_msg(LOG_DEFAULT, LVL_WARN, "vol_part_eject_device(): " 667 "eject fail"); 668 bd_close(bd); 669 async_hangup(sess); 670 return EIO; 671 } 672 673 bd_close(bd); 674 async_hangup(sess); 675 return EOK; 676 } 677 678 errno_t vol_part_eject_part(vol_part_t *part, vol_eject_flags_t flags) 631 errno_t vol_part_eject_part(vol_part_t *part) 679 632 { 680 633 int rc; … … 683 636 684 637 if (part->cur_mp == NULL) { 685 /* Partition is not mounted, nothing to do. */ 686 log_msg(LOG_DEFAULT, LVL_DEBUG, "Partition not mounted, " 687 "nothing to do."); 688 goto done; 638 log_msg(LOG_DEFAULT, LVL_DEBUG, "Attempt to mount unmounted " 639 "partition."); 640 return EINVAL; 689 641 } 690 642 … … 704 656 } 705 657 706 if ((flags & vef_physical) != 0) {707 rc = vol_part_eject_device(part->svc_id);708 if (rc != EOK) {709 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed physically "710 "ejecting device %s.", part->svc_name);711 }712 }713 714 658 free(part->cur_mp); 715 659 part->cur_mp = NULL; 716 660 part->cur_mp_auto = false; 717 done: 661 718 662 return EOK; 719 663 } … … 861 805 862 806 if (part->cur_mp != NULL) { 863 rc = vol_part_eject_part(part , vef_none);807 rc = vol_part_eject_part(part); 864 808 if (rc != EOK) 865 809 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.