Changeset b82985e in mainline for uspace/lib/c


Ignore:
Timestamp:
2018-10-12T13:16:04Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d09eeb2
Parents:
6d00aff
Message:

Inserting volume by path.

Location:
uspace/lib/c
Files:
3 edited

Legend:

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

    r6d00aff rb82985e  
    312312}
    313313
     314/** Insert volume by path.
     315 *
     316 * @param vol Volume service
     317 * @param path Filesystem path
     318 *
     319 * @return EOK on success or an error code
     320 */
     321errno_t vol_part_insert_by_path(vol_t *vol, const char *path)
     322{
     323        async_exch_t *exch;
     324        ipc_call_t answer;
     325        errno_t retval;
     326
     327        exch = async_exchange_begin(vol->sess);
     328        aid_t req = async_send_0(exch, VOL_PART_INSERT_BY_PATH, &answer);
     329
     330        retval = async_data_write_start(exch, path, str_size(path));
     331        if (retval != EOK) {
     332                async_exchange_end(exch);
     333                async_forget(req);
     334                return retval;
     335        }
     336
     337        async_exchange_end(exch);
     338        async_wait_for(req, &retval);
     339
     340        if (retval != EOK)
     341                return retval;
     342
     343        return EOK;
     344}
     345
    314346/** Get volume label support.
    315347 *
  • uspace/lib/c/include/ipc/vol.h

    r6d00aff rb82985e  
    4646        VOL_PART_EMPTY,
    4747        VOL_PART_INSERT,
     48        VOL_PART_INSERT_BY_PATH,
    4849        VOL_PART_LSUPP,
    4950        VOL_PART_MKFS,
  • uspace/lib/c/include/vol.h

    r6d00aff rb82985e  
    5151extern errno_t vol_part_empty(vol_t *, service_id_t);
    5252extern errno_t vol_part_insert(vol_t *, service_id_t);
     53extern errno_t vol_part_insert_by_path(vol_t *, const char *);
    5354extern errno_t vol_part_get_lsupp(vol_t *, vol_fstype_t, vol_label_supp_t *);
    5455extern 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.