Changeset 4198f9c3 in mainline for uspace/lib


Ignore:
Timestamp:
2009-06-28T13:43:15Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
852b801
Parents:
6408be3
Message:

Separate the VFS input and output protocols.

Location:
uspace/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/vfs/vfs.c

    r6408be3 r4198f9c3  
    138138        vfs_connect();
    139139       
    140         req = async_send_2(vfs_phone, VFS_MOUNT, dev_handle, flags, NULL);
     140        req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL);
    141141        rc = ipc_data_write_start(vfs_phone, (void *) mpa, mpa_size);
    142142        if (rc != EOK) {
     
    199199        vfs_connect();
    200200       
    201         req = async_send_3(vfs_phone, VFS_OPEN, lflag, oflag, 0, &answer);
     201        req = async_send_3(vfs_phone, VFS_IN_OPEN, lflag, oflag, 0, &answer);
    202202        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    203203        if (rc != EOK) {
     
    231231       
    232232        ipc_call_t answer;
    233         aid_t req = async_send_4(vfs_phone, VFS_OPEN_NODE, node->fs_handle,
     233        aid_t req = async_send_4(vfs_phone, VFS_IN_OPEN_NODE, node->fs_handle,
    234234            node->dev_handle, node->index, oflag, &answer);
    235235       
     
    253253        vfs_connect();
    254254       
    255         rc = async_req_1_0(vfs_phone, VFS_CLOSE, fildes);
     255        rc = async_req_1_0(vfs_phone, VFS_IN_CLOSE, fildes);
    256256       
    257257        async_serialize_end();
     
    271271        vfs_connect();
    272272       
    273         req = async_send_1(vfs_phone, VFS_READ, fildes, &answer);
     273        req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer);
    274274        rc = ipc_data_read_start(vfs_phone, (void *)buf, nbyte);
    275275        if (rc != EOK) {
     
    298298        vfs_connect();
    299299       
    300         req = async_send_1(vfs_phone, VFS_WRITE, fildes, &answer);
     300        req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer);
    301301        rc = ipc_data_write_start(vfs_phone, (void *)buf, nbyte);
    302302        if (rc != EOK) {
     
    322322       
    323323        ipcarg_t device;
    324         ipcarg_t rc = async_req_1_1(vfs_phone, VFS_DEVICE, fildes, &device);
     324        ipcarg_t rc = async_req_1_1(vfs_phone, VFS_IN_DEVICE, fildes, &device);
    325325       
    326326        async_serialize_end();
     
    342342        ipcarg_t dev_handle;
    343343        ipcarg_t index;
    344         ipcarg_t rc = async_req_1_3(vfs_phone, VFS_NODE, fildes, &fs_handle,
     344        ipcarg_t rc = async_req_1_3(vfs_phone, VFS_IN_NODE, fildes, &fs_handle,
    345345            &dev_handle, &index);
    346346       
     
    363363        vfs_connect();
    364364       
    365         ipcarg_t rc = async_req_1_0(vfs_phone, VFS_SYNC, fildes);
     365        ipcarg_t rc = async_req_1_0(vfs_phone, VFS_IN_SYNC, fildes);
    366366       
    367367        async_serialize_end();
     
    380380       
    381381        ipcarg_t newoffs;
    382         rc = async_req_3_1(vfs_phone, VFS_SEEK, fildes, offset, whence,
     382        rc = async_req_3_1(vfs_phone, VFS_IN_SEEK, fildes, offset, whence,
    383383            &newoffs);
    384384
     
    400400        vfs_connect();
    401401       
    402         rc = async_req_2_0(vfs_phone, VFS_TRUNCATE, fildes, length);
     402        rc = async_req_2_0(vfs_phone, VFS_IN_TRUNCATE, fildes, length);
    403403        async_serialize_end();
    404404        futex_up(&vfs_phone_futex);
     
    453453        vfs_connect();
    454454       
    455         req = async_send_1(vfs_phone, VFS_MKDIR, mode, NULL);
     455        req = async_send_1(vfs_phone, VFS_IN_MKDIR, mode, NULL);
    456456        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    457457        if (rc != EOK) {
     
    483483        vfs_connect();
    484484       
    485         req = async_send_0(vfs_phone, VFS_UNLINK, NULL);
     485        req = async_send_0(vfs_phone, VFS_IN_UNLINK, NULL);
    486486        rc = ipc_data_write_start(vfs_phone, pa, pa_size);
    487487        if (rc != EOK) {
     
    530530        vfs_connect();
    531531       
    532         req = async_send_0(vfs_phone, VFS_RENAME, NULL);
     532        req = async_send_0(vfs_phone, VFS_IN_RENAME, NULL);
    533533        rc = ipc_data_write_start(vfs_phone, olda, olda_size);
    534534        if (rc != EOK) {
  • uspace/lib/libc/include/ipc/console.h

    r6408be3 r4198f9c3  
    4040
    4141typedef enum {
    42         CONSOLE_GET_SIZE = VFS_LAST_SRV,
     42        CONSOLE_GET_SIZE = VFS_OUT_LAST,
    4343        CONSOLE_GET_EVENT,
    4444        CONSOLE_GOTO,
  • uspace/lib/libc/include/ipc/vfs.h

    r6408be3 r4198f9c3  
    5858
    5959typedef enum {
    60         VFS_OPEN_NODE = IPC_FIRST_USER_METHOD,
    61         VFS_READ,
    62         VFS_WRITE,
    63         VFS_TRUNCATE,
    64         VFS_MOUNT,
    65         VFS_UNMOUNT,
    66         VFS_DEVICE,
    67         VFS_SYNC,
    68         VFS_CLOSE,
    69         VFS_LAST_CMN  /* keep this the last member of this enum */
    70 } vfs_request_cmn_t;
     60        VFS_IN_OPEN = IPC_FIRST_USER_METHOD,
     61        VFS_IN_OPEN_NODE,
     62        VFS_IN_READ,
     63        VFS_IN_WRITE,
     64        VFS_IN_SEEK,
     65        VFS_IN_TRUNCATE,
     66        VFS_IN_CLOSE,
     67        VFS_IN_MOUNT,
     68        VFS_IN_UNMOUNT,
     69        VFS_IN_DEVICE,
     70        VFS_IN_SYNC,
     71        VFS_IN_REGISTER,
     72        VFS_IN_MKDIR,
     73        VFS_IN_UNLINK,
     74        VFS_IN_RENAME,
     75        VFS_IN_NODE
     76} vfs_in_request_t;
    7177
    7278typedef enum {
    73         VFS_LOOKUP = VFS_LAST_CMN,
    74         VFS_MOUNTED,
    75         VFS_DESTROY,
    76         VFS_LAST_CLNT  /* keep this the last member of this enum */
    77 } vfs_request_clnt_t;
    78 
    79 typedef enum {
    80         VFS_REGISTER = VFS_LAST_CMN,
    81         VFS_OPEN,
    82         VFS_SEEK,
    83         VFS_MKDIR,
    84         VFS_UNLINK,
    85         VFS_RENAME,
    86         VFS_NODE,
    87         VFS_LAST_SRV  /* keep this the last member of this enum */
    88 } vfs_request_srv_t;
     79        VFS_OUT_OPEN_NODE = IPC_FIRST_USER_METHOD,
     80        VFS_OUT_READ,
     81        VFS_OUT_WRITE,
     82        VFS_OUT_TRUNCATE,
     83        VFS_OUT_CLOSE,
     84        VFS_OUT_MOUNT,
     85        VFS_OUT_MOUNTED,
     86        VFS_OUT_UNMOUNT,
     87        VFS_OUT_DEVICE,
     88        VFS_OUT_SYNC,
     89        VFS_OUT_LOOKUP,
     90        VFS_OUT_DESTROY,
     91        VFS_OUT_LAST
     92} vfs_out_request_t;
    8993
    9094/*
  • uspace/lib/libfs/libfs.c

    r6408be3 r4198f9c3  
    7070         */
    7171        ipc_call_t answer;
    72         aid_t req = async_send_0(vfs_phone, VFS_REGISTER, &answer);
     72        aid_t req = async_send_0(vfs_phone, VFS_IN_REGISTER, &answer);
    7373
    7474        /*
     
    105105         
    106106        /*
    107          * Pick up the answer for the request to the VFS_REQUEST call.
     107         * Pick up the answer for the request to the VFS_IN_REQUEST call.
    108108         */
    109109        async_wait_for(req, NULL);
     
    187187       
    188188        ipc_call_t answer;
    189         aid_t msg = async_send_1(mountee_phone, VFS_MOUNTED, mr_dev_handle,
     189        aid_t msg = async_send_1(mountee_phone, VFS_OUT_MOUNTED, mr_dev_handle,
    190190            &answer);
    191191        ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
     
    214214 * @param fs_handle File system handle of the file system where to perform
    215215 *                  the lookup.
    216  * @param rid       Request ID of the VFS_LOOKUP request.
    217  * @param request   VFS_LOOKUP request data itself.
     216 * @param rid       Request ID of the VFS_OUT_LOOKUP request.
     217 * @param request   VFS_OUT_LOOKUP request data itself.
    218218 *
    219219 */
     
    238238
    239239        if (cur->mp_data.mp_active) {
    240                 ipc_forward_slow(rid, cur->mp_data.phone, VFS_LOOKUP,
     240                ipc_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP,
    241241                    next, last, cur->mp_data.dev_handle, lflag, index,
    242242                    IPC_FF_ROUTE_FROM_ME);
     
    273273                                next--;
    274274                               
    275                         ipc_forward_slow(rid, tmp->mp_data.phone, VFS_LOOKUP,
    276                             next, last, tmp->mp_data.dev_handle, lflag, index,
    277                             IPC_FF_ROUTE_FROM_ME);
     275                        ipc_forward_slow(rid, tmp->mp_data.phone,
     276                            VFS_OUT_LOOKUP, next, last, tmp->mp_data.dev_handle,
     277                            lflag, index, IPC_FF_ROUTE_FROM_ME);
    278278                        ops->node_put(cur);
    279279                        ops->node_put(tmp);
     
    433433 * @param ops       libfs operations structure with function pointers to
    434434 *                  file system implementation
    435  * @param rid       Request ID of the VFS_OPEN_NODE request.
    436  * @param request   VFS_OPEN_NODE request data itself.
     435 * @param rid       Request ID of the VFS_OUT_OPEN_NODE request.
     436 * @param request   VFS_OUT_OPEN_NODE request data itself.
    437437 *
    438438 */
Note: See TracChangeset for help on using the changeset viewer.