Changeset ad7a6c9 in mainline for uspace/srv/vfs/vfs_register.c
- Timestamp:
- 2011-03-30T13:10:24Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4ae90f9
- Parents:
- 6e50466 (diff), d6b81941 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_register.c
r6e50466 rad7a6c9 36 36 */ 37 37 38 #include <ipc/ipc.h>39 38 #include <ipc/services.h> 40 39 #include <async.h> 41 #include <async_rel.h>42 40 #include <fibril.h> 43 41 #include <fibril_synch.h> … … 111 109 void vfs_register(ipc_callid_t rid, ipc_call_t *request) 112 110 { 111 int phone; 112 113 113 dprintf("Processing VFS_REGISTER request received from %p.\n", 114 114 request->in_phone_hash); … … 121 121 dprintf("Failed to deliver the VFS info into our AS, rc=%d.\n", 122 122 rc); 123 ipc_answer_0(rid, rc);123 async_answer_0(rid, rc); 124 124 return; 125 125 } … … 131 131 if (!fs_info) { 132 132 dprintf("Could not allocate memory for FS info.\n"); 133 ipc_answer_0(rid, ENOMEM);133 async_answer_0(rid, ENOMEM); 134 134 return; 135 135 } 136 136 137 137 link_initialize(&fs_info->fs_link); 138 fibril_mutex_initialize(&fs_info->phone_lock);139 138 fs_info->vfs_info = *vfs_info; 140 139 free(vfs_info); … … 144 143 if (!vfs_info_sane(&fs_info->vfs_info)) { 145 144 free(fs_info); 146 ipc_answer_0(rid, EINVAL);145 async_answer_0(rid, EINVAL); 147 146 return; 148 147 } … … 160 159 fibril_mutex_unlock(&fs_head_lock); 161 160 free(fs_info); 162 ipc_answer_0(rid, EEXISTS);161 async_answer_0(rid, EEXISTS); 163 162 return; 164 163 } … … 182 181 fibril_mutex_unlock(&fs_head_lock); 183 182 free(fs_info); 184 ipc_answer_0(callid, EINVAL); 185 ipc_answer_0(rid, EINVAL); 186 return; 187 } 188 fs_info->phone = IPC_GET_ARG5(call); 189 ipc_answer_0(callid, EOK); 183 async_answer_0(callid, EINVAL); 184 async_answer_0(rid, EINVAL); 185 return; 186 } 187 188 phone = IPC_GET_ARG5(call); 189 async_session_create(&fs_info->session, phone, 0); 190 async_answer_0(callid, EOK); 190 191 191 192 dprintf("Callback connection to FS created.\n"); … … 200 201 list_remove(&fs_info->fs_link); 201 202 fibril_mutex_unlock(&fs_head_lock); 202 ipc_hangup(fs_info->phone); 203 free(fs_info); 204 ipc_answer_0(callid, EINVAL); 205 ipc_answer_0(rid, EINVAL); 203 async_session_destroy(&fs_info->session); 204 async_hangup(phone); 205 free(fs_info); 206 async_answer_0(callid, EINVAL); 207 async_answer_0(rid, EINVAL); 206 208 return; 207 209 } … … 214 216 list_remove(&fs_info->fs_link); 215 217 fibril_mutex_unlock(&fs_head_lock); 216 ipc_hangup(fs_info->phone); 217 free(fs_info); 218 ipc_answer_0(callid, EINVAL); 219 ipc_answer_0(rid, EINVAL); 218 async_session_destroy(&fs_info->session); 219 async_hangup(phone); 220 free(fs_info); 221 async_answer_0(callid, EINVAL); 222 async_answer_0(rid, EINVAL); 220 223 return; 221 224 } … … 235 238 */ 236 239 fs_info->fs_handle = (fs_handle_t) atomic_postinc(&fs_handle_next); 237 ipc_answer_1(rid, EOK, (sysarg_t) fs_info->fs_handle);240 async_answer_1(rid, EOK, (sysarg_t) fs_info->fs_handle); 238 241 239 242 fibril_condvar_broadcast(&fs_head_cv); … … 269 272 if (fs->fs_handle == handle) { 270 273 fibril_mutex_unlock(&fs_head_lock); 271 fibril_mutex_lock(&fs->phone_lock); 272 phone = async_relation_create(fs->phone); 273 fibril_mutex_unlock(&fs->phone_lock); 274 phone = async_exchange_begin(&fs->session); 274 275 275 276 assert(phone > 0); … … 295 296 if (fs->fs_handle == handle) { 296 297 fibril_mutex_unlock(&fs_head_lock); 297 fibril_mutex_lock(&fs->phone_lock); 298 async_relation_destroy(fs->phone, phone); 299 fibril_mutex_unlock(&fs->phone_lock); 298 async_exchange_end(&fs->session, phone); 300 299 return; 301 300 }
Note:
See TracChangeset
for help on using the changeset viewer.