Changes in uspace/srv/vfs/vfs.c [ffa2c8ef:41e9ef7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.c
rffa2c8ef r41e9ef7 36 36 */ 37 37 38 #include <vfs/vfs.h> 38 39 #include <ipc/services.h> 39 #include <ipc/ns.h> 40 #include <abi/ipc/event.h> 41 #include <event.h> 42 #include <ns.h> 40 43 #include <async.h> 41 44 #include <errno.h> … … 45 48 #include <as.h> 46 49 #include <atomic.h> 50 #include <macros.h> 47 51 #include "vfs.h" 48 52 49 53 #define NAME "vfs" 50 54 51 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall) 55 enum { 56 VFS_TASK_STATE_CHANGE 57 }; 58 59 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 52 60 { 53 bool keep_on_going= true;54 61 bool cont = true; 62 55 63 /* 56 64 * The connection was opened via the IPC_CONNECT_ME_TO call. … … 59 67 async_answer_0(iid, EOK); 60 68 61 while ( keep_on_going) {69 while (cont) { 62 70 ipc_call_t call; 63 71 ipc_callid_t callid = async_get_call(&call); 64 72 73 if (!IPC_GET_IMETHOD(call)) 74 break; 75 65 76 switch (IPC_GET_IMETHOD(call)) { 66 case IPC_M_PHONE_HUNGUP:67 keep_on_going = false;68 break;69 77 case VFS_IN_REGISTER: 70 78 vfs_register(callid, &call); 71 keep_on_going= false;79 cont = false; 72 80 break; 73 81 case VFS_IN_MOUNT: … … 80 88 vfs_open(callid, &call); 81 89 break; 82 case VFS_IN_OPEN_NODE:83 vfs_open_node(callid, &call);84 break;85 90 case VFS_IN_CLOSE: 86 91 vfs_close(callid, &call); … … 118 123 case VFS_IN_DUP: 119 124 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; 120 132 default: 121 133 async_answer_0(callid, ENOTSUP); … … 123 135 } 124 136 } 125 137 126 138 /* 127 139 * Open files for this client will be cleaned up when its last 128 140 * connection fibril terminates. 129 141 */ 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 } 130 157 } 131 158 … … 170 197 171 198 /* 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 /* 172 205 * Register at the naming service. 173 206 */
Note:
See TracChangeset
for help on using the changeset viewer.