Changeset df908b3 in mainline
- Timestamp:
- 2010-08-27T17:04:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3249673, ecd2775
- Parents:
- ddd7118
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/libc.c
rddd7118 rdf908b3 50 50 #include <ipc/ipc.h> 51 51 #include <async.h> 52 #include <async_rel.h> 52 53 #include <as.h> 53 54 #include <loader/pcb.h> … … 65 66 __heap_init(); 66 67 __async_init(); 68 (void) async_rel_init(); 67 69 fibril_t *fibril = fibril_setup(); 68 70 __tcb_set(fibril->tcb); -
uspace/srv/vfs/vfs.h
rddd7118 rdf908b3 169 169 170 170 extern int vfs_grab_phone(fs_handle_t); 171 extern void vfs_release_phone( int);171 extern void vfs_release_phone(fs_handle_t, int); 172 172 173 173 extern fs_handle_t fs_name_to_handle(char *, bool); -
uspace/srv/vfs/vfs_lookup.c
rddd7118 rdf908b3 168 168 ipcarg_t rc; 169 169 async_wait_for(req, &rc); 170 vfs_release_phone( phone);170 vfs_release_phone(root->fs_handle, phone); 171 171 172 172 fibril_mutex_lock(&plb_mutex); … … 215 215 ipcarg_t rc; 216 216 async_wait_for(req, &rc); 217 vfs_release_phone( phone);217 vfs_release_phone(result->triplet.fs_handle, phone); 218 218 219 219 if (rc == EOK) { -
uspace/srv/vfs/vfs_node.c
rddd7118 rdf908b3 133 133 (ipcarg_t)node->dev_handle, (ipcarg_t)node->index); 134 134 assert(rc == EOK); 135 vfs_release_phone( phone);135 vfs_release_phone(node->fs_handle, phone); 136 136 } 137 137 if (free_vfs_node) -
uspace/srv/vfs/vfs_ops.c
rddd7118 rdf908b3 131 131 if (rc != EOK) { 132 132 async_wait_for(msg, NULL); 133 vfs_release_phone( phone);133 vfs_release_phone(fs_handle, phone); 134 134 fibril_rwlock_write_unlock(&namespace_rwlock); 135 135 ipc_answer_0(rid, rc); … … 137 137 } 138 138 async_wait_for(msg, &rc); 139 vfs_release_phone( phone);139 vfs_release_phone(fs_handle, phone); 140 140 141 141 if (rc != EOK) { … … 196 196 if (rc != EOK) { 197 197 async_wait_for(msg, NULL); 198 vfs_release_phone( mountee_phone);199 vfs_release_phone( phone);198 vfs_release_phone(fs_handle, mountee_phone); 199 vfs_release_phone(mp_res.triplet.fs_handle, phone); 200 200 /* Mount failed, drop reference to mp_node. */ 201 201 if (mp_node) … … 206 206 } 207 207 208 vfs_release_phone( mountee_phone);208 vfs_release_phone(fs_handle, mountee_phone); 209 209 210 210 /* send the mount options */ … … 212 212 if (rc != EOK) { 213 213 async_wait_for(msg, NULL); 214 vfs_release_phone( phone);214 vfs_release_phone(mp_res.triplet.fs_handle, phone); 215 215 /* Mount failed, drop reference to mp_node. */ 216 216 if (mp_node) … … 221 221 } 222 222 async_wait_for(msg, &rc); 223 vfs_release_phone( phone);223 vfs_release_phone(mp_res.triplet.fs_handle, phone); 224 224 225 225 if (rc == EOK) { … … 423 423 rc = async_req_1_0(phone, VFS_OUT_UNMOUNTED, 424 424 mr_node->dev_handle); 425 vfs_release_phone( phone);425 vfs_release_phone(mr_node->fs_handle, phone); 426 426 if (rc != EOK) { 427 427 fibril_rwlock_write_unlock(&namespace_rwlock); … … 460 460 rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, mp_node->dev_handle, 461 461 mp_node->index); 462 vfs_release_phone( phone);462 vfs_release_phone(mp_node->fs_handle, phone); 463 463 if (rc != EOK) { 464 464 fibril_rwlock_write_unlock(&namespace_rwlock); … … 716 716 async_wait_for(msg, &rc); 717 717 718 vfs_release_phone(f s_phone);718 vfs_release_phone(file->node->fs_handle, fs_phone); 719 719 fibril_mutex_unlock(&file->lock); 720 720 … … 747 747 async_wait_for(msg, &rc); 748 748 749 vfs_release_phone(f s_phone);749 vfs_release_phone(file->node->fs_handle, fs_phone); 750 750 fibril_mutex_unlock(&file->lock); 751 751 … … 846 846 } 847 847 848 vfs_release_phone(f s_phone);848 vfs_release_phone(file->node->fs_handle, fs_phone); 849 849 850 850 size_t bytes = IPC_GET_ARG1(answer); … … 970 970 rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t) dev_handle, 971 971 (ipcarg_t) index, LOWER32(size), UPPER32(size)); 972 vfs_release_phone(fs_ phone);972 vfs_release_phone(fs_handle, fs_phone); 973 973 return (int)rc; 974 974 } … … 1026 1026 ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); 1027 1027 async_wait_for(msg, &rc); 1028 vfs_release_phone(f s_phone);1028 vfs_release_phone(file->node->fs_handle, fs_phone); 1029 1029 1030 1030 fibril_mutex_unlock(&file->lock); … … 1077 1077 ipcarg_t rv; 1078 1078 async_wait_for(msg, &rv); 1079 vfs_release_phone( fs_phone);1079 vfs_release_phone(node->fs_handle, fs_phone); 1080 1080 1081 1081 ipc_answer_0(rid, rv); -
uspace/srv/vfs/vfs_register.c
rddd7118 rdf908b3 39 39 #include <ipc/services.h> 40 40 #include <async.h> 41 #include <async_rel.h> 41 42 #include <fibril.h> 43 #include <fibril_synch.h> 42 44 #include <errno.h> 43 45 #include <stdio.h> … … 46 48 #include <ctype.h> 47 49 #include <bool.h> 48 #include <fibril_synch.h>49 50 #include <adt/list.h> 50 51 #include <as.h> … … 252 253 int vfs_grab_phone(fs_handle_t handle) 253 254 { 255 link_t *cur; 256 fs_info_t *fs; 254 257 int phone; 255 258 … … 262 265 */ 263 266 fibril_mutex_lock(&fs_head_lock); 264 link_t *cur;265 fs_info_t *fs;266 267 for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { 267 268 fs = list_get_instance(cur, fs_info_t, fs_link); … … 269 270 fibril_mutex_unlock(&fs_head_lock); 270 271 fibril_mutex_lock(&fs->phone_lock); 271 phone = ipc_connect_me_to(fs->phone, 0, 0, 0);272 phone = async_relation_create(fs->phone); 272 273 fibril_mutex_unlock(&fs->phone_lock); 273 274 … … 284 285 * @param phone Phone to FS task. 285 286 */ 286 void vfs_release_phone(int phone) 287 { 288 /* TODO: implement connection caching */ 289 ipc_hangup(phone); 287 void vfs_release_phone(fs_handle_t handle, int phone) 288 { 289 link_t *cur; 290 fs_info_t *fs; 291 292 fibril_mutex_lock(&fs_head_lock); 293 for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { 294 fs = list_get_instance(cur, fs_info_t, fs_link); 295 if (fs->fs_handle == handle) { 296 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); 300 return; 301 } 302 } 303 /* should not really get here */ 304 abort(); 305 fibril_mutex_unlock(&fs_head_lock); 290 306 } 291 307
Note:
See TracChangeset
for help on using the changeset viewer.