Changeset b14d9f9 in mainline for uspace/srv/vfs/vfs_ipc.c


Ignore:
Timestamp:
2017-05-05T17:37:36Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
951f6b9e
Parents:
75b24cd
Message:

Mount should be able to print the list of available file system types.

File:
1 edited

Legend:

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

    r75b24cd rb14d9f9  
    2727 */
    2828
     29#include <vfs/vfs.h>
    2930#include "vfs.h"
    3031
     
    4243        int ret = vfs_op_clone(oldfd, newfd, desc);
    4344        async_answer_0(rid, ret);
     45}
     46
     47static void vfs_in_fstypes(ipc_callid_t rid, ipc_call_t *request)
     48{
     49        ipc_callid_t callid;
     50        size_t len;
     51        vfs_fstypes_t fstypes;
     52        int rc;
     53
     54        rc = vfs_get_fstypes(&fstypes);
     55        if (rc != EOK) {
     56                async_answer_0(rid, ENOMEM);
     57                return;
     58        }
     59
     60        /* Send size of the data */
     61        async_answer_1(rid, EOK, fstypes.size);
     62
     63        /* Now we should get a read request */
     64        if (!async_data_read_receive(&callid, &len))
     65                goto out;
     66
     67        if (len > fstypes.size)
     68                len = fstypes.size;
     69        (void) async_data_read_finalize(callid, fstypes.buf, len);
     70
     71out:
     72        vfs_fstypes_free(&fstypes);
    4473}
    4574
     
    268297                        vfs_in_clone(callid, &call);
    269298                        break;
     299                case VFS_IN_FSTYPES:
     300                        vfs_in_fstypes(callid, &call);
     301                        break;
    270302                case VFS_IN_MOUNT:
    271303                        vfs_in_mount(callid, &call);
Note: See TracChangeset for help on using the changeset viewer.