Changeset f0f8787 in mainline for uspace/srv/volsrv/volsrv.c


Ignore:
Timestamp:
2018-10-04T14:53:29Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
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)
Message:

Add vol insert subcommand to re-insert a previously ejected volume.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/volsrv/volsrv.c

    r1bb43d5 rf0f8787  
    210210        if (rc != EOK) {
    211211                async_answer_0(icall, ENOENT);
    212                 goto error;
     212                return;
    213213        }
    214214
    215215        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);
     222error:
     223        vol_part_del_ref(part);
     224}
     225
     226static 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);
    216242        if (rc != EOK) {
    217243                async_answer_0(icall, EIO);
     
    429455                        vol_part_empty_srv(parts, &call);
    430456                        break;
     457                case VOL_PART_INSERT:
     458                        vol_part_insert_srv(parts, &call);
     459                        break;
    431460                case VOL_PART_LSUPP:
    432461                        vol_part_get_lsupp_srv(parts, &call);
Note: See TracChangeset for help on using the changeset viewer.