Changeset a0edf5f in mainline


Ignore:
Timestamp:
2007-09-16T11:02:33Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b006bfb8
Parents:
2b20947
Message:

VFS work.

Added mandatory VFS_LOOKUP

Handling of VFS_REGISTER request should be now more or less complete.
Added code that inserts the new fs_info structure into the list of registered
filesystems and creates a callback connection to the client FS.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ipc/ipc.h

    r2b20947 ra0edf5f  
    103103 *
    104104 * The protocol for negotiating is:
    105  * - sys_connect_to_me - sends a message IPC_M_CONNECTTOME
     105 * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME
    106106 * - sys_wait_for_call - upon receipt tries to allocate new phone
    107107 *                       - if it fails, responds with ELIMIT
     
    111111 *                       the call is accepted and the response is sent back.
    112112 *                     - the allocated phoneid is passed to userspace
    113  *                       (on the receiving sid) as ARG3 of the call.
     113 *                       (on the receiving side) as ARG3 of the call.
    114114 *                     - the caller obtains taskid of the called thread
    115115 */
  • uspace/srv/vfs/vfs.c

    r2b20947 ra0edf5f  
    8686                return false;
    8787        if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_UNMOUNT)] != VFS_OP_DEFINED)
     88                return false;
     89        if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] != VFS_OP_DEFINED)
    8890                return false;
    8991        if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_OPEN)] != VFS_OP_DEFINED)
     
    193195                }
    194196        }
    195        
    196         /*
    197          * TODO:
    198          * 1. send the client the IPC_M_CONNECT_TO_ME call so that it makes a
    199          *    callback connection.
    200          * 2. add the fs_info into fs_head
    201          */
     197
     198        /*
     199         * Add fs_info to the list of registered FS's.
     200         */
     201        list_append(&fs_info->fs_link, &fs_head);
     202
     203        /*
     204         * ACK receiving a properly formatted, non-duplicit vfs_info.
     205         */
     206        ipc_answer_fast(callid, EOK, 0, 0);
     207       
     208        /*
     209         * Now we want the client to send us the IPC_M_CONNECT_TO_ME call so
     210         * that a callback connection is created and we have a phone through
     211         * which to forward VFS requests to it.
     212         */
     213        callid = async_get_call(&call);
     214        if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) {
     215                list_remove(&fs_info->fs_link);
     216                futex_up(&fs_head_futex);
     217                free(fs_info);
     218                ipc_answer_fast(callid, EINVAL, 0, 0);
     219                ipc_answer_fast(rid, EINVAL, 0, 0);
     220                return;
     221        }
     222        fs_info->phone = IPC_GET_ARG3(call);
     223        ipc_answer_fast(callid, EOK, 0, 0);
    202224
    203225        futex_up(&fs_head_futex);
     226
     227        /*
     228         * That was it. The FS has been registered.
     229         */
     230        ipc_answer_fast(rid, EOK, 0, 0);
    204231}
    205232
  • uspace/srv/vfs/vfs.h

    r2b20947 ra0edf5f  
    4444        VFS_MOUNT,
    4545        VFS_UNMOUNT,
     46        VFS_LOOKUP,
    4647        VFS_OPEN,
    4748        VFS_CREATE,
     
    8485        link_t fs_link;
    8586        vfs_info_t vfs_info;
     87        ipcarg_t phone;
    8688} fs_info_t;
    8789
Note: See TracChangeset for help on using the changeset viewer.