Changeset d2c8533 in mainline for uspace/srv/vfs/vfs_ipc.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_ipc.c

    r582a0b8 rd2c8533  
    4545}
    4646
     47static void vfs_in_fsprobe(ipc_callid_t rid, ipc_call_t *request)
     48{
     49        service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);
     50        char *fs_name = NULL;
     51        ipc_callid_t callid;
     52        vfs_fs_probe_info_t info;
     53        size_t len;
     54        int rc;
     55       
     56        /*
     57         * Now we expect the client to send us data with the name of the file
     58         * system.
     59         */
     60        rc = async_data_write_accept((void **) &fs_name, true, 0,
     61            FS_NAME_MAXLEN, 0, NULL);
     62        if (rc != EOK) {
     63                async_answer_0(rid, rc);
     64                return;
     65        }
     66       
     67        rc = vfs_op_fsprobe(fs_name, service_id, &info);
     68        async_answer_0(rid, rc);
     69        if (rc != EOK)
     70                goto out;
     71       
     72        /* Now we should get a read request */
     73        if (!async_data_read_receive(&callid, &len))
     74                goto out;
     75
     76        if (len > sizeof(info))
     77                len = sizeof(info);
     78        (void) async_data_read_finalize(callid, &info, len);
     79
     80out:
     81        free(fs_name);
     82}
     83
    4784static void vfs_in_fstypes(ipc_callid_t rid, ipc_call_t *request)
    4885{
     
    297334                        vfs_in_clone(callid, &call);
    298335                        break;
     336                case VFS_IN_FSPROBE:
     337                        vfs_in_fsprobe(callid, &call);
     338                        break;
    299339                case VFS_IN_FSTYPES:
    300340                        vfs_in_fstypes(callid, &call);
Note: See TracChangeset for help on using the changeset viewer.