Changeset 925a21e in mainline for uspace/lib/fs/libfs.c
- Timestamp:
- 2011-09-24T14:20:29Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bf76c1
- Parents:
- 867e2555 (diff), 1ab4aca (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/lib/fs/libfs.c
r867e2555 r925a21e 77 77 static void vfs_out_mounted(ipc_callid_t rid, ipc_call_t *req) 78 78 { 79 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);79 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 80 80 char *opts; 81 81 int rc; … … 91 91 aoff64_t size; 92 92 unsigned lnkcnt; 93 rc = vfs_out_ops->mounted( devmap_handle, opts, &index, &size, &lnkcnt);93 rc = vfs_out_ops->mounted(service_id, opts, &index, &size, &lnkcnt); 94 94 95 95 if (rc == EOK) … … 109 109 static void vfs_out_unmounted(ipc_callid_t rid, ipc_call_t *req) 110 110 { 111 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);111 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 112 112 int rc; 113 113 114 rc = vfs_out_ops->unmounted( devmap_handle);114 rc = vfs_out_ops->unmounted(service_id); 115 115 116 116 async_answer_0(rid, rc); … … 130 130 static void vfs_out_read(ipc_callid_t rid, ipc_call_t *req) 131 131 { 132 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);132 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 133 133 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 134 134 aoff64_t pos = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*req), … … 137 137 int rc; 138 138 139 rc = vfs_out_ops->read( devmap_handle, index, pos, &rbytes);139 rc = vfs_out_ops->read(service_id, index, pos, &rbytes); 140 140 141 141 if (rc == EOK) … … 147 147 static void vfs_out_write(ipc_callid_t rid, ipc_call_t *req) 148 148 { 149 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);149 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 150 150 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 151 151 aoff64_t pos = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*req), … … 155 155 int rc; 156 156 157 rc = vfs_out_ops->write( devmap_handle, index, pos, &wbytes, &nsize);157 rc = vfs_out_ops->write(service_id, index, pos, &wbytes, &nsize); 158 158 159 159 if (rc == EOK) … … 165 165 static void vfs_out_truncate(ipc_callid_t rid, ipc_call_t *req) 166 166 { 167 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);167 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 168 168 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 169 169 aoff64_t size = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*req), … … 171 171 int rc; 172 172 173 rc = vfs_out_ops->truncate( devmap_handle, index, size);173 rc = vfs_out_ops->truncate(service_id, index, size); 174 174 175 175 async_answer_0(rid, rc); … … 178 178 static void vfs_out_close(ipc_callid_t rid, ipc_call_t *req) 179 179 { 180 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);180 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 181 181 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 182 182 int rc; 183 183 184 rc = vfs_out_ops->close( devmap_handle, index);184 rc = vfs_out_ops->close(service_id, index); 185 185 186 186 async_answer_0(rid, rc); … … 189 189 static void vfs_out_destroy(ipc_callid_t rid, ipc_call_t *req) 190 190 { 191 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);191 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 192 192 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 193 193 int rc; 194 194 195 rc = vfs_out_ops->destroy( devmap_handle, index);195 rc = vfs_out_ops->destroy(service_id, index); 196 196 197 197 async_answer_0(rid, rc); … … 210 210 static void vfs_out_sync(ipc_callid_t rid, ipc_call_t *req) 211 211 { 212 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);212 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 213 213 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 214 214 int rc; 215 215 216 rc = vfs_out_ops->sync( devmap_handle, index);216 rc = vfs_out_ops->sync(service_id, index); 217 217 218 218 async_answer_0(rid, rc); … … 380 380 ipc_call_t *req) 381 381 { 382 devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);382 service_id_t mp_service_id = (service_id_t) IPC_GET_ARG1(*req); 383 383 fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*req); 384 384 fs_handle_t mr_fs_handle = (fs_handle_t) IPC_GET_ARG3(*req); 385 devmap_handle_t mr_devmap_handle = (devmap_handle_t) IPC_GET_ARG4(*req);385 service_id_t mr_service_id = (service_id_t) IPC_GET_ARG4(*req); 386 386 387 387 async_sess_t *mountee_sess = async_clone_receive(EXCHANGE_PARALLEL); … … 392 392 393 393 fs_node_t *fn; 394 int res = ops->node_get(&fn, mp_ devmap_handle, mp_fs_index);394 int res = ops->node_get(&fn, mp_service_id, mp_fs_index); 395 395 if ((res != EOK) || (!fn)) { 396 396 async_hangup(mountee_sess); … … 422 422 ipc_call_t answer; 423 423 int rc = async_data_write_forward_1_1(exch, VFS_OUT_MOUNTED, 424 mr_ devmap_handle, &answer);424 mr_service_id, &answer); 425 425 async_exchange_end(exch); 426 426 … … 428 428 fn->mp_data.mp_active = true; 429 429 fn->mp_data.fs_handle = mr_fs_handle; 430 fn->mp_data. devmap_handle = mr_devmap_handle;430 fn->mp_data.service_id = mr_service_id; 431 431 fn->mp_data.sess = mountee_sess; 432 432 } … … 441 441 void libfs_unmount(libfs_ops_t *ops, ipc_callid_t rid, ipc_call_t *req) 442 442 { 443 devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*req);443 service_id_t mp_service_id = (service_id_t) IPC_GET_ARG1(*req); 444 444 fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*req); 445 445 fs_node_t *fn; 446 446 int res; 447 447 448 res = ops->node_get(&fn, mp_ devmap_handle, mp_fs_index);448 res = ops->node_get(&fn, mp_service_id, mp_fs_index); 449 449 if ((res != EOK) || (!fn)) { 450 450 async_answer_0(rid, combine_rc(res, ENOENT)); … … 465 465 */ 466 466 async_exch_t *exch = async_exchange_begin(fn->mp_data.sess); 467 res = async_req_1_0(exch, VFS_OUT_UNMOUNTED, fn->mp_data. devmap_handle);467 res = async_req_1_0(exch, VFS_OUT_UNMOUNTED, fn->mp_data.service_id); 468 468 async_exchange_end(exch); 469 469 … … 475 475 fn->mp_data.mp_active = false; 476 476 fn->mp_data.fs_handle = 0; 477 fn->mp_data. devmap_handle= 0;477 fn->mp_data.service_id = 0; 478 478 fn->mp_data.sess = NULL; 479 479 … … 510 510 unsigned int last = IPC_GET_ARG2(*req); 511 511 unsigned int next = first; 512 devmap_handle_t devmap_handle= IPC_GET_ARG3(*req);512 service_id_t service_id = IPC_GET_ARG3(*req); 513 513 int lflag = IPC_GET_ARG4(*req); 514 514 fs_index_t index = IPC_GET_ARG5(*req); … … 524 524 fs_node_t *tmp = NULL; 525 525 526 rc = ops->root_get(&cur, devmap_handle);526 rc = ops->root_get(&cur, service_id); 527 527 on_error(rc, goto out_with_answer); 528 528 … … 530 530 async_exch_t *exch = async_exchange_begin(cur->mp_data.sess); 531 531 async_forward_slow(rid, exch, VFS_OUT_LOOKUP, next, last, 532 cur->mp_data. devmap_handle, lflag, index,532 cur->mp_data.service_id, lflag, index, 533 533 IPC_FF_ROUTE_FROM_ME); 534 534 async_exchange_end(exch); … … 591 591 async_exch_t *exch = async_exchange_begin(tmp->mp_data.sess); 592 592 async_forward_slow(rid, exch, VFS_OUT_LOOKUP, next, 593 last, tmp->mp_data. devmap_handle, lflag, index,593 last, tmp->mp_data.service_id, lflag, index, 594 594 IPC_FF_ROUTE_FROM_ME); 595 595 async_exchange_end(exch); … … 620 620 fs_node_t *fn; 621 621 if (lflag & L_CREATE) 622 rc = ops->create(&fn, devmap_handle,622 rc = ops->create(&fn, service_id, 623 623 lflag); 624 624 else 625 rc = ops->node_get(&fn, devmap_handle,625 rc = ops->node_get(&fn, service_id, 626 626 index); 627 627 on_error(rc, goto out_with_answer); … … 638 638 aoff64_t size = ops->size_get(fn); 639 639 async_answer_5(rid, fs_handle, 640 devmap_handle,640 service_id, 641 641 ops->index_get(fn), 642 642 LOWER32(size), … … 706 706 fs_node_t *fn; 707 707 if (lflag & L_CREATE) 708 rc = ops->create(&fn, devmap_handle, lflag);708 rc = ops->create(&fn, service_id, lflag); 709 709 else 710 rc = ops->node_get(&fn, devmap_handle, index);710 rc = ops->node_get(&fn, service_id, index); 711 711 on_error(rc, goto out_with_answer); 712 712 … … 722 722 aoff64_t size = ops->size_get(fn); 723 723 async_answer_5(rid, fs_handle, 724 devmap_handle,724 service_id, 725 725 ops->index_get(fn), 726 726 LOWER32(size), … … 748 748 if (rc == EOK) { 749 749 aoff64_t size = ops->size_get(cur); 750 async_answer_5(rid, fs_handle, devmap_handle,750 async_answer_5(rid, fs_handle, service_id, 751 751 ops->index_get(cur), LOWER32(size), UPPER32(size), 752 752 old_lnkcnt); … … 786 786 if (rc == EOK) { 787 787 aoff64_t size = ops->size_get(cur); 788 async_answer_5(rid, fs_handle, devmap_handle,788 async_answer_5(rid, fs_handle, service_id, 789 789 ops->index_get(cur), LOWER32(size), UPPER32(size), 790 790 ops->lnkcnt_get(cur)); … … 810 810 ipc_call_t *request) 811 811 { 812 devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);812 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 813 813 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 814 814 815 815 fs_node_t *fn; 816 int rc = ops->node_get(&fn, devmap_handle, index);816 int rc = ops->node_get(&fn, service_id, index); 817 817 on_error(rc, answer_and_return(rid, rc)); 818 818 … … 831 831 832 832 stat.fs_handle = fs_handle; 833 stat. devmap_handle = devmap_handle;833 stat.service_id = service_id; 834 834 stat.index = index; 835 835 stat.lnkcnt = ops->lnkcnt_get(fn); … … 837 837 stat.is_directory = ops->is_directory(fn); 838 838 stat.size = ops->size_get(fn); 839 stat. device = ops->device_get(fn);839 stat.service = ops->service_get(fn); 840 840 841 841 ops->node_put(fn); … … 856 856 ipc_call_t *request) 857 857 { 858 devmap_handle_t devmap_handle= IPC_GET_ARG1(*request);858 service_id_t service_id = IPC_GET_ARG1(*request); 859 859 fs_index_t index = IPC_GET_ARG2(*request); 860 860 861 861 fs_node_t *fn; 862 int rc = ops->node_get(&fn, devmap_handle, index);862 int rc = ops->node_get(&fn, service_id, index); 863 863 on_error(rc, answer_and_return(rid, rc)); 864 864
Note:
See TracChangeset
for help on using the changeset viewer.