Changeset a0edf5f in mainline for uspace/srv/vfs/vfs.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.