Changeset ee1b8ca in mainline for uspace/srv/vfs/vfs_rdwr.c
- Timestamp:
- 2007-12-25T20:02:25Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1bf5cb
- Parents:
- 1356a04c
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_rdwr.c
r1356a04c ree1b8ca 32 32 33 33 /** 34 * @file vfs_r ead.c34 * @file vfs_rdwr.c 35 35 * @brief 36 36 */ … … 41 41 #include <errno.h> 42 42 43 void vfs_read(ipc_callid_t rid, ipc_call_t *request)43 static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read) 44 44 { 45 45 … … 66 66 67 67 /* 68 * Now we need to receive a call with client's IPC_M_DATA_READ request. 68 * Now we need to receive a call with client's 69 * IPC_M_DATA_READ/IPC_M_DATA_WRITE request. 69 70 */ 70 71 ipc_callid_t callid; 71 if (!ipc_data_read_receive(&callid, NULL)) { 72 int res; 73 if (read) 74 res = ipc_data_read_receive(&callid, NULL); 75 else 76 res = ipc_data_write_receive(&callid, NULL, NULL); 77 if (!res) { 72 78 ipc_answer_0(callid, EINVAL); 73 79 ipc_answer_0(rid, EINVAL); … … 78 84 79 85 /* 80 * Make a VFS_READ request at the destination FS server.86 * Make a VFS_READ/VFS_WRITE request at the destination FS server. 81 87 */ 82 88 aid_t msg; 83 89 ipc_call_t answer; 84 msg = async_send_3(fs_phone, VFS_READ, file->node->dev_handle,85 file->node-> index, file->pos, &answer);90 msg = async_send_3(fs_phone, IPC_GET_METHOD(*request), 91 file->node->dev_handle, file->node->index, file->pos, &answer); 86 92 87 93 /* 88 * Forward the IPC_M_DATA_READ request to the destination FS server. 89 * The call will be routed as if sent by ourselves. Note that call 90 * arguments are immutable in this case so we don't have to bother. 94 * Forward the IPC_M_DATA_READ/IPC_M_DATA_WRITE request to the 95 * destination FS server. The call will be routed as if sent by 96 * ourselves. Note that call arguments are immutable in this case so we 97 * don't have to bother. 91 98 */ 92 99 ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); … … 113 120 } 114 121 122 123 void vfs_read(ipc_callid_t rid, ipc_call_t *request) 124 { 125 vfs_rdwr(rid, request, true); 126 } 127 128 void vfs_write(ipc_callid_t rid, ipc_call_t *request) 129 { 130 vfs_rdwr(rid, request, false); 131 } 132 115 133 /** 116 134 * @}
Note:
See TracChangeset
for help on using the changeset viewer.