Changeset 77f0a1d in mainline for uspace/srv/vfs/vfs_ipc.c
- Timestamp:
- 2018-03-22T22:54:52Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eed4139
- Parents:
- a46e56b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ipc.c
ra46e56b r77f0a1d 35 35 #include <vfs/canonify.h> 36 36 37 static void vfs_in_clone(cap_call_handle_t r id, ipc_call_t *request)37 static void vfs_in_clone(cap_call_handle_t req_handle, ipc_call_t *request) 38 38 { 39 39 int oldfd = IPC_GET_ARG1(*request); … … 43 43 int outfd = -1; 44 44 errno_t rc = vfs_op_clone(oldfd, newfd, desc, &outfd); 45 async_answer_1(r id, rc, outfd);46 } 47 48 static void vfs_in_fsprobe(cap_call_handle_t r id, ipc_call_t *request)45 async_answer_1(req_handle, rc, outfd); 46 } 47 48 static void vfs_in_fsprobe(cap_call_handle_t req_handle, ipc_call_t *request) 49 49 { 50 50 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); … … 62 62 FS_NAME_MAXLEN, 0, NULL); 63 63 if (rc != EOK) { 64 async_answer_0(r id, rc);64 async_answer_0(req_handle, rc); 65 65 return; 66 66 } 67 67 68 68 rc = vfs_op_fsprobe(fs_name, service_id, &info); 69 async_answer_0(r id, rc);69 async_answer_0(req_handle, rc); 70 70 if (rc != EOK) 71 71 goto out; … … 83 83 } 84 84 85 static void vfs_in_fstypes(cap_call_handle_t r id, ipc_call_t *request)85 static void vfs_in_fstypes(cap_call_handle_t req_handle, ipc_call_t *request) 86 86 { 87 87 cap_call_handle_t chandle; … … 92 92 rc = vfs_get_fstypes(&fstypes); 93 93 if (rc != EOK) { 94 async_answer_0(r id, ENOMEM);94 async_answer_0(req_handle, ENOMEM); 95 95 return; 96 96 } 97 97 98 98 /* Send size of the data */ 99 async_answer_1(r id, EOK, fstypes.size);99 async_answer_1(req_handle, EOK, fstypes.size); 100 100 101 101 /* Now we should get a read request */ … … 111 111 } 112 112 113 static void vfs_in_mount(cap_call_handle_t r id, ipc_call_t *request)113 static void vfs_in_mount(cap_call_handle_t req_handle, ipc_call_t *request) 114 114 { 115 115 int mpfd = IPC_GET_ARG1(*request); … … 132 132 MAX_MNTOPTS_LEN, 0, NULL); 133 133 if (rc != EOK) { 134 async_answer_0(r id, rc);134 async_answer_0(req_handle, rc); 135 135 return; 136 136 } … … 143 143 if (rc != EOK) { 144 144 free(opts); 145 async_answer_0(r id, rc);145 async_answer_0(req_handle, rc); 146 146 return; 147 147 } … … 150 150 rc = vfs_op_mount(mpfd, service_id, flags, instance, opts, fs_name, 151 151 &outfd); 152 async_answer_1(r id, rc, outfd);152 async_answer_1(req_handle, rc, outfd); 153 153 154 154 free(opts); … … 156 156 } 157 157 158 static void vfs_in_open(cap_call_handle_t r id, ipc_call_t *request)158 static void vfs_in_open(cap_call_handle_t req_handle, ipc_call_t *request) 159 159 { 160 160 int fd = IPC_GET_ARG1(*request); … … 162 162 163 163 errno_t rc = vfs_op_open(fd, mode); 164 async_answer_0(r id, rc);165 } 166 167 static void vfs_in_put(cap_call_handle_t r id, ipc_call_t *request)164 async_answer_0(req_handle, rc); 165 } 166 167 static void vfs_in_put(cap_call_handle_t req_handle, ipc_call_t *request) 168 168 { 169 169 int fd = IPC_GET_ARG1(*request); 170 170 errno_t rc = vfs_op_put(fd); 171 async_answer_0(r id, rc);172 } 173 174 static void vfs_in_read(cap_call_handle_t r id, ipc_call_t *request)171 async_answer_0(req_handle, rc); 172 } 173 174 static void vfs_in_read(cap_call_handle_t req_handle, ipc_call_t *request) 175 175 { 176 176 int fd = IPC_GET_ARG1(*request); … … 180 180 size_t bytes = 0; 181 181 errno_t rc = vfs_op_read(fd, pos, &bytes); 182 async_answer_1(r id, rc, bytes);183 } 184 185 static void vfs_in_rename(cap_call_handle_t r id, ipc_call_t *request)182 async_answer_1(req_handle, rc, bytes); 183 } 184 185 static void vfs_in_rename(cap_call_handle_t req_handle, ipc_call_t *request) 186 186 { 187 187 /* The common base directory. */ … … 219 219 220 220 out: 221 async_answer_0(r id, rc);221 async_answer_0(req_handle, rc); 222 222 223 223 if (old) … … 227 227 } 228 228 229 static void vfs_in_resize(cap_call_handle_t r id, ipc_call_t *request)229 static void vfs_in_resize(cap_call_handle_t req_handle, ipc_call_t *request) 230 230 { 231 231 int fd = IPC_GET_ARG1(*request); 232 232 int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*request), IPC_GET_ARG3(*request)); 233 233 errno_t rc = vfs_op_resize(fd, size); 234 async_answer_0(r id, rc);235 } 236 237 static void vfs_in_stat(cap_call_handle_t r id, ipc_call_t *request)234 async_answer_0(req_handle, rc); 235 } 236 237 static void vfs_in_stat(cap_call_handle_t req_handle, ipc_call_t *request) 238 238 { 239 239 int fd = IPC_GET_ARG1(*request); 240 240 errno_t rc = vfs_op_stat(fd); 241 async_answer_0(r id, rc);242 } 243 244 static void vfs_in_statfs(cap_call_handle_t r id, ipc_call_t *request)241 async_answer_0(req_handle, rc); 242 } 243 244 static void vfs_in_statfs(cap_call_handle_t req_handle, ipc_call_t *request) 245 245 { 246 246 int fd = (int) IPC_GET_ARG1(*request); 247 247 248 248 errno_t rc = vfs_op_statfs(fd); 249 async_answer_0(r id, rc);250 } 251 252 static void vfs_in_sync(cap_call_handle_t r id, ipc_call_t *request)249 async_answer_0(req_handle, rc); 250 } 251 252 static void vfs_in_sync(cap_call_handle_t req_handle, ipc_call_t *request) 253 253 { 254 254 int fd = IPC_GET_ARG1(*request); 255 255 errno_t rc = vfs_op_sync(fd); 256 async_answer_0(r id, rc);257 } 258 259 static void vfs_in_unlink(cap_call_handle_t r id, ipc_call_t *request)256 async_answer_0(req_handle, rc); 257 } 258 259 static void vfs_in_unlink(cap_call_handle_t req_handle, ipc_call_t *request) 260 260 { 261 261 int parentfd = IPC_GET_ARG1(*request); … … 267 267 rc = vfs_op_unlink(parentfd, expectfd, path); 268 268 269 async_answer_0(r id, rc);270 } 271 272 static void vfs_in_unmount(cap_call_handle_t r id, ipc_call_t *request)269 async_answer_0(req_handle, rc); 270 } 271 272 static void vfs_in_unmount(cap_call_handle_t req_handle, ipc_call_t *request) 273 273 { 274 274 int mpfd = IPC_GET_ARG1(*request); 275 275 errno_t rc = vfs_op_unmount(mpfd); 276 async_answer_0(r id, rc);277 } 278 279 static void vfs_in_wait_handle(cap_call_handle_t r id, ipc_call_t *request)276 async_answer_0(req_handle, rc); 277 } 278 279 static void vfs_in_wait_handle(cap_call_handle_t req_handle, ipc_call_t *request) 280 280 { 281 281 bool high_fd = IPC_GET_ARG1(*request); 282 282 int fd = -1; 283 283 errno_t rc = vfs_op_wait_handle(high_fd, &fd); 284 async_answer_1(r id, rc, fd);285 } 286 287 static void vfs_in_walk(cap_call_handle_t r id, ipc_call_t *request)284 async_answer_1(req_handle, rc, fd); 285 } 286 287 static void vfs_in_walk(cap_call_handle_t req_handle, ipc_call_t *request) 288 288 { 289 289 /* … … 301 301 free(path); 302 302 } 303 async_answer_1(r id, rc, fd);304 } 305 306 static void vfs_in_write(cap_call_handle_t r id, ipc_call_t *request)303 async_answer_1(req_handle, rc, fd); 304 } 305 306 static void vfs_in_write(cap_call_handle_t req_handle, ipc_call_t *request) 307 307 { 308 308 int fd = IPC_GET_ARG1(*request); … … 312 312 size_t bytes = 0; 313 313 errno_t rc = vfs_op_write(fd, pos, &bytes); 314 async_answer_1(r id, rc, bytes);314 async_answer_1(req_handle, rc, bytes); 315 315 } 316 316
Note:
See TracChangeset
for help on using the changeset viewer.