Changeset f0f8787 in mainline for uspace/lib


Ignore:
Timestamp:
2018-10-04T14:53:29Z (7 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.

Location:
uspace/lib/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/vol.c

    r1bb43d5 rf0f8787  
    196196 * the dummy partition is created), it can take some (unknown) time
    197197 * until it is discovered.
     198 *
     199 * @param vol Volume service
     200 * @param sid Service ID of the partition
     201 * @return EOK on success or an error code
    198202 */
    199203errno_t vol_part_add(vol_t *vol, service_id_t sid)
     
    212216}
    213217
    214 /** Get partition information. */
     218/** Get partition information.
     219 *
     220 * @param vol Volume service
     221 * @param sid Service ID of the partition
     222 * @param vinfo Place to sore partition information
     223 * @return EOK on success or an error code
     224 */
    215225errno_t vol_part_info(vol_t *vol, service_id_t sid, vol_part_info_t *vinfo)
    216226{
     
    236246}
    237247
    238 /** Unmount partition (and possibly eject the media). */
     248/** Unmount partition (and possibly eject the media).
     249 *
     250 * @param vol Volume service
     251 * @param sid Service ID of the partition
     252 * @return EOK on success or an error code
     253 */
    239254errno_t vol_part_eject(vol_t *vol, service_id_t sid)
    240255{
     
    254269/** Erase partition (to the extent where we will consider it not containing
    255270 * a file system.
     271 *
     272 * @param vol Volume service
     273 * @param sid Service ID of the partition
     274 * @return EOK on success or an error code
    256275 */
    257276errno_t vol_part_empty(vol_t *vol, service_id_t sid)
     
    270289}
    271290
    272 /** Get volume label support. */
     291/** Insert volume.
     292 *
     293 * This will re-mount the volume if it has been ejected previously.
     294 *
     295 * @param vol Volume service
     296 * @param sid Service ID of the partition
     297 * @return EOK on success or an error code
     298 */
     299errno_t vol_part_insert(vol_t *vol, service_id_t sid)
     300{
     301        async_exch_t *exch;
     302        errno_t retval;
     303
     304        exch = async_exchange_begin(vol->sess);
     305        retval = async_req_1_0(exch, VOL_PART_INSERT, sid);
     306        async_exchange_end(exch);
     307
     308        if (retval != EOK)
     309                return retval;
     310
     311        return EOK;
     312}
     313
     314/** Get volume label support.
     315 *
     316 * @param vol Volume service
     317 * @param fstype File system type
     318 * @param vlsupp Place to store volume label support information
     319 * @return EOK on success or an error code
     320 */
    273321errno_t vol_part_get_lsupp(vol_t *vol, vol_fstype_t fstype,
    274322    vol_label_supp_t *vlsupp)
  • uspace/lib/c/include/ipc/vol.h

    r1bb43d5 rf0f8787  
    4545        VOL_PART_EJECT,
    4646        VOL_PART_EMPTY,
     47        VOL_PART_INSERT,
    4748        VOL_PART_LSUPP,
    4849        VOL_PART_MKFS,
  • uspace/lib/c/include/vol.h

    r1bb43d5 rf0f8787  
    5050extern errno_t vol_part_eject(vol_t *, service_id_t);
    5151extern errno_t vol_part_empty(vol_t *, service_id_t);
     52extern errno_t vol_part_insert(vol_t *, service_id_t);
    5253extern errno_t vol_part_get_lsupp(vol_t *, vol_fstype_t, vol_label_supp_t *);
    5354extern errno_t vol_part_mkfs(vol_t *, service_id_t, vol_fstype_t, const char *,
Note: See TracChangeset for help on using the changeset viewer.