Changeset 03bc76a in mainline for uspace/srv/fs/minixfs/mfs.c
- Timestamp:
- 2011-09-04T12:33:10Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c699b0c
- Parents:
- 8ff0bd2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/minixfs/mfs.c
r8ff0bd2 r03bc76a 38 38 */ 39 39 40 #define _MAIN41 42 40 #include <ipc/services.h> 43 41 #include <ns.h> … … 55 53 .write_retains_size = false, 56 54 }; 57 58 59 /**60 * This connection fibril processes VFS requests from VFS.61 *62 * In order to support simultaneous VFS requests, our design is as follows.63 * The connection fibril accepts VFS requests from VFS. If there is only one64 * instance of the fibril, VFS will need to serialize all VFS requests it sends65 * to MinixFS. To overcome this bottleneck, VFS can send MinixFS the IPC_M_CONNECT_ME_TO66 * call. In that case, a new connection fibril will be created, which in turn67 * will accept the call. Thus, a new phone will be opened for VFS.68 *69 * There are few issues with this arrangement. First, VFS can run out of70 * available phones. In that case, VFS can close some other phones or use one71 * phone for more serialized requests. Similarily, MinixFS can refuse to duplicate72 * the connection. VFS should then just make use of already existing phones and73 * route its requests through them. To avoid paying the fibril creation price74 * upon each request, MinixFS might want to keep the connections open after the75 * request has been completed.76 */77 78 static void mfs_connection(ipc_callid_t iid, ipc_call_t *icall)79 {80 if (iid) {81 /*82 * This only happens for connections opened by83 * IPC_M_CONNECT_ME_TO calls as opposed to callback connections84 * created by IPC_M_CONNECT_TO_ME.85 */86 async_answer_0(iid, EOK);87 }88 89 while (1) {90 ipc_callid_t callid;91 ipc_call_t call;92 93 callid = async_get_call(&call);94 int method = IPC_GET_IMETHOD(call);95 96 /*mfsdebug(NAME "method = %d\n", method);*/97 switch (method) {98 case VFS_OUT_MOUNTED:99 mfs_mounted(callid, &call);100 break;101 case VFS_OUT_MOUNT:102 mfs_mount(callid, &call);103 break;104 case VFS_OUT_STAT:105 mfs_stat(callid, &call);106 break;107 case VFS_OUT_LOOKUP:108 mfs_lookup(callid, &call);109 break;110 case VFS_OUT_READ:111 mfs_read(callid, &call);112 break;113 case VFS_OUT_OPEN_NODE:114 mfs_open_node(callid, &call);115 break;116 case VFS_OUT_CLOSE:117 mfs_close(callid, &call);118 break;119 case VFS_OUT_WRITE:120 mfs_write(callid, &call);121 break;122 case VFS_OUT_TRUNCATE:123 mfs_truncate(callid, &call);124 break;125 case VFS_OUT_DESTROY:126 mfs_destroy(callid, &call);127 break;128 case VFS_OUT_UNMOUNTED:129 mfs_unmounted(callid, &call);130 break;131 case VFS_OUT_UNMOUNT:132 mfs_unmount(callid, &call);133 break;134 case VFS_OUT_SYNC:135 mfs_sync(callid, &call);136 break;137 default:138 async_answer_0(callid, ENOTSUP);139 break;140 }141 }142 }143 144 55 145 56 int main(int argc, char **argv) … … 163 74 } 164 75 165 rc = fs_register(vfs_sess, &mfs_ reg, &mfs_vfs_info, mfs_connection);76 rc = fs_register(vfs_sess, &mfs_vfs_info, &mfs_ops, &mfs_libfs_ops); 166 77 if (rc != EOK) 167 78 goto err;
Note:
See TracChangeset
for help on using the changeset viewer.