Changes in uspace/srv/vfs/vfs.c [41e9ef7:ffa2c8ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.c
r41e9ef7 rffa2c8ef 36 36 */ 37 37 38 #include <vfs/vfs.h>39 38 #include <ipc/services.h> 40 #include <abi/ipc/event.h> 41 #include <event.h> 42 #include <ns.h> 39 #include <ipc/ns.h> 43 40 #include <async.h> 44 41 #include <errno.h> … … 48 45 #include <as.h> 49 46 #include <atomic.h> 50 #include <macros.h>51 47 #include "vfs.h" 52 48 53 49 #define NAME "vfs" 54 50 55 enum { 56 VFS_TASK_STATE_CHANGE 57 };51 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall) 52 { 53 bool keep_on_going = true; 58 54 59 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)60 {61 bool cont = true;62 63 55 /* 64 56 * The connection was opened via the IPC_CONNECT_ME_TO call. … … 67 59 async_answer_0(iid, EOK); 68 60 69 while ( cont) {61 while (keep_on_going) { 70 62 ipc_call_t call; 71 63 ipc_callid_t callid = async_get_call(&call); 72 64 73 if (!IPC_GET_IMETHOD(call)) 65 switch (IPC_GET_IMETHOD(call)) { 66 case IPC_M_PHONE_HUNGUP: 67 keep_on_going = false; 74 68 break; 75 76 switch (IPC_GET_IMETHOD(call)) {77 69 case VFS_IN_REGISTER: 78 70 vfs_register(callid, &call); 79 cont= false;71 keep_on_going = false; 80 72 break; 81 73 case VFS_IN_MOUNT: … … 87 79 case VFS_IN_OPEN: 88 80 vfs_open(callid, &call); 81 break; 82 case VFS_IN_OPEN_NODE: 83 vfs_open_node(callid, &call); 89 84 break; 90 85 case VFS_IN_CLOSE: … … 123 118 case VFS_IN_DUP: 124 119 vfs_dup(callid, &call); 125 break;126 case VFS_IN_WAIT_HANDLE:127 vfs_wait_handle(callid, &call);128 break;129 case VFS_IN_MTAB_GET:130 vfs_get_mtab(callid, &call);131 break;132 120 default: 133 121 async_answer_0(callid, ENOTSUP); … … 135 123 } 136 124 } 137 125 138 126 /* 139 127 * Open files for this client will be cleaned up when its last 140 128 * connection fibril terminates. 141 129 */ 142 }143 144 static void notification_received(ipc_callid_t callid, ipc_call_t *call)145 {146 switch (IPC_GET_IMETHOD(*call)) {147 case VFS_TASK_STATE_CHANGE:148 if (IPC_GET_ARG1(*call) == VFS_PASS_HANDLE)149 vfs_pass_handle(150 (task_id_t) MERGE_LOUP32(IPC_GET_ARG4(*call),151 IPC_GET_ARG5(*call)), call->in_task_id,152 (int) IPC_GET_ARG2(*call));153 break;154 default:155 break;156 }157 130 } 158 131 … … 197 170 198 171 /* 199 * Set notification handler and subscribe to notifications.200 */201 async_set_interrupt_received(notification_received);202 event_task_subscribe(EVENT_TASK_STATE_CHANGE, VFS_TASK_STATE_CHANGE);203 204 /*205 172 * Register at the naming service. 206 173 */
Note:
See TracChangeset
for help on using the changeset viewer.