Changes in uspace/lib/libfs/libfs.c [c888102:ed903174] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libfs/libfs.c
rc888102 red903174 37 37 #include "libfs.h" 38 38 #include "../../srv/vfs/vfs.h" 39 #include <macros.h> 39 40 #include <errno.h> 40 41 #include <async.h> … … 161 162 /* Accept the phone */ 162 163 callid = async_get_call(&call); 163 int mountee_phone = (int) IPC_GET_ARG1(call);164 int mountee_phone = (int) IPC_GET_ARG1(call); 164 165 if ((IPC_GET_METHOD(call) != IPC_M_CONNECTION_CLONE) || 165 166 (mountee_phone < 0)) { … … 172 173 ipc_answer_0(callid, EOK); 173 174 174 res = async_data_write_receive(&callid, NULL);175 if (!res) {176 ipc_hangup(mountee_phone);177 ipc_answer_0(callid, EINVAL);178 ipc_answer_0(rid, EINVAL);179 return;180 }181 182 175 fs_node_t *fn; 183 176 res = ops->node_get(&fn, mp_dev_handle, mp_fs_index); 184 177 if ((res != EOK) || (!fn)) { 185 178 ipc_hangup(mountee_phone); 186 ipc_answer_0(callid,combine_rc(res, ENOENT));179 async_data_write_void(combine_rc(res, ENOENT)); 187 180 ipc_answer_0(rid, combine_rc(res, ENOENT)); 188 181 return; … … 192 185 ipc_hangup(mountee_phone); 193 186 (void) ops->node_put(fn); 194 ipc_answer_0(callid,EBUSY);187 async_data_write_void(EBUSY); 195 188 ipc_answer_0(rid, EBUSY); 196 189 return; … … 201 194 ipc_hangup(mountee_phone); 202 195 (void) ops->node_put(fn); 203 ipc_answer_0(callid,rc);196 async_data_write_void(rc); 204 197 ipc_answer_0(rid, rc); 205 198 return; … … 207 200 208 201 ipc_call_t answer; 209 aid_t msg = async_send_1(mountee_phone, VFS_OUT_MOUNTED, mr_dev_handle, 210 &answer); 211 ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); 212 async_wait_for(msg, &rc); 202 rc = async_data_write_forward_1_1(mountee_phone, VFS_OUT_MOUNTED, 203 mr_dev_handle, &answer); 213 204 214 205 if (rc == EOK) { … … 408 399 ipc_answer_0(rid, rc); 409 400 } else { 410 ipc_answer_5(rid, EOK, 411 fs_handle, dev_handle, 401 aoff64_t size = ops->size_get(fn); 402 ipc_answer_5(rid, fs_handle, 403 dev_handle, 412 404 ops->index_get(fn), 413 ops->size_get(fn), 405 LOWER32(size), 406 UPPER32(size), 414 407 ops->lnkcnt_get(fn)); 415 408 (void) ops->node_put(fn); … … 488 481 ipc_answer_0(rid, rc); 489 482 } else { 490 ipc_answer_5(rid, EOK, 491 fs_handle, dev_handle, 483 aoff64_t size = ops->size_get(fn); 484 ipc_answer_5(rid, fs_handle, 485 dev_handle, 492 486 ops->index_get(fn), 493 ops->size_get(fn), 487 LOWER32(size), 488 UPPER32(size), 494 489 ops->lnkcnt_get(fn)); 495 490 (void) ops->node_put(fn); … … 511 506 unsigned int old_lnkcnt = ops->lnkcnt_get(cur); 512 507 rc = ops->unlink(par, cur, component); 513 ipc_answer_5(rid, (ipcarg_t) rc, fs_handle, dev_handle, 514 ops->index_get(cur), ops->size_get(cur), old_lnkcnt); 508 509 if (rc == EOK) { 510 aoff64_t size = ops->size_get(cur); 511 ipc_answer_5(rid, fs_handle, dev_handle, 512 ops->index_get(cur), LOWER32(size), UPPER32(size), 513 old_lnkcnt); 514 } else 515 ipc_answer_0(rid, rc); 516 515 517 goto out; 516 518 } … … 543 545 rc = ops->node_open(cur); 544 546 545 ipc_answer_5(rid, rc, fs_handle, dev_handle, 546 ops->index_get(cur), ops->size_get(cur), 547 ops->lnkcnt_get(cur)); 547 if (rc == EOK) { 548 aoff64_t size = ops->size_get(cur); 549 ipc_answer_5(rid, fs_handle, dev_handle, 550 ops->index_get(cur), LOWER32(size), UPPER32(size), 551 ops->lnkcnt_get(cur)); 552 } else 553 ipc_answer_0(rid, rc); 554 548 555 } else 549 556 ipc_answer_0(rid, rc); … … 612 619 dev_handle_t dev_handle = IPC_GET_ARG1(*request); 613 620 fs_index_t index = IPC_GET_ARG2(*request); 621 614 622 fs_node_t *fn; 615 int rc; 616 617 rc = ops->node_get(&fn, dev_handle, index); 623 int rc = ops->node_get(&fn, dev_handle, index); 618 624 on_error(rc, answer_and_return(rid, rc)); 619 625 … … 624 630 625 631 rc = ops->node_open(fn); 626 ipc_answer_3(rid, rc, ops->size_get(fn), ops->lnkcnt_get(fn), 632 aoff64_t size = ops->size_get(fn); 633 ipc_answer_4(rid, rc, LOWER32(size), UPPER32(size), ops->lnkcnt_get(fn), 627 634 (ops->is_file(fn) ? L_FILE : 0) | (ops->is_directory(fn) ? L_DIRECTORY : 0)); 628 635
Note:
See TracChangeset
for help on using the changeset viewer.