Changeset d2c8533 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2017-05-08T20:38:47Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f066a87
Parents:
582a0b8
Message:

File system probing groundwork. Only MFS can do it for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    r582a0b8 rd2c8533  
    190190}
    191191
     192int vfs_op_fsprobe(const char *fs_name, service_id_t sid,
     193    vfs_fs_probe_info_t *info)
     194{
     195        fs_handle_t fs_handle = 0;
     196        sysarg_t rc;
     197        int retval;
     198       
     199        fibril_mutex_lock(&fs_list_lock);
     200        fs_handle = fs_name_to_handle(0, fs_name, false);
     201        fibril_mutex_unlock(&fs_list_lock);
     202       
     203        if (fs_handle == 0)
     204                return ENOFS;
     205       
     206        /* Send probe request to the file system server */
     207        ipc_call_t answer;
     208        async_exch_t *exch = vfs_exchange_grab(fs_handle);
     209        aid_t msg = async_send_1(exch, VFS_OUT_FSPROBE, (sysarg_t) sid,
     210            &answer);
     211        if (msg == 0)
     212                return EINVAL;
     213       
     214        /* Read probe information */
     215        retval = async_data_read_start(exch, info, sizeof(*info));
     216        if (retval != EOK) {
     217                async_forget(msg);
     218                return retval;
     219        }
     220       
     221        async_wait_for(msg, &rc);
     222        vfs_exchange_release(exch);
     223        return rc;
     224}
     225
    192226int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,
    193227    unsigned instance, const char *opts, const char *fs_name, int *outfd)
Note: See TracChangeset for help on using the changeset viewer.