Changes in uspace/srv/vfs/vfs_ipc.c [a35b458:77f0a1d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ipc.c
ra35b458 r77f0a1d 35 35 #include <vfs/canonify.h> 36 36 37 static void vfs_in_clone( ipc_callid_t rid, 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( ipc_callid_t rid, 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); 51 51 char *fs_name = NULL; 52 ipc_callid_t callid;52 cap_call_handle_t chandle; 53 53 vfs_fs_probe_info_t info; 54 54 size_t len; … … 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; 72 72 73 73 /* Now we should get a read request */ 74 if (!async_data_read_receive(&c allid, &len))74 if (!async_data_read_receive(&chandle, &len)) 75 75 goto out; 76 76 77 77 if (len > sizeof(info)) 78 78 len = sizeof(info); 79 (void) async_data_read_finalize(c allid, &info, len);79 (void) async_data_read_finalize(chandle, &info, len); 80 80 81 81 out: … … 83 83 } 84 84 85 static void vfs_in_fstypes( ipc_callid_t rid, ipc_call_t *request)86 { 87 ipc_callid_t callid;85 static void vfs_in_fstypes(cap_call_handle_t req_handle, ipc_call_t *request) 86 { 87 cap_call_handle_t chandle; 88 88 size_t len; 89 89 vfs_fstypes_t fstypes; … … 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 */ 102 if (!async_data_read_receive(&c allid, &len))102 if (!async_data_read_receive(&chandle, &len)) 103 103 goto out; 104 104 105 105 if (len > fstypes.size) 106 106 len = fstypes.size; 107 (void) async_data_read_finalize(c allid, fstypes.buf, len);107 (void) async_data_read_finalize(chandle, fstypes.buf, len); 108 108 109 109 out: … … 111 111 } 112 112 113 static void vfs_in_mount( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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( ipc_callid_t rid, 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);315 } 316 317 void vfs_connection( ipc_callid_t iid, ipc_call_t *icall, void *arg)314 async_answer_1(req_handle, rc, bytes); 315 } 316 317 void vfs_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 318 318 { 319 319 bool cont = true; … … 323 323 * This call needs to be answered. 324 324 */ 325 async_answer_0(i id, EOK);325 async_answer_0(icall_handle, EOK); 326 326 327 327 while (cont) { 328 328 ipc_call_t call; 329 ipc_callid_t callid= async_get_call(&call);329 cap_call_handle_t chandle = async_get_call(&call); 330 330 331 331 if (!IPC_GET_IMETHOD(call)) … … 334 334 switch (IPC_GET_IMETHOD(call)) { 335 335 case VFS_IN_CLONE: 336 vfs_in_clone(c allid, &call);336 vfs_in_clone(chandle, &call); 337 337 break; 338 338 case VFS_IN_FSPROBE: 339 vfs_in_fsprobe(c allid, &call);339 vfs_in_fsprobe(chandle, &call); 340 340 break; 341 341 case VFS_IN_FSTYPES: 342 vfs_in_fstypes(c allid, &call);342 vfs_in_fstypes(chandle, &call); 343 343 break; 344 344 case VFS_IN_MOUNT: 345 vfs_in_mount(c allid, &call);345 vfs_in_mount(chandle, &call); 346 346 break; 347 347 case VFS_IN_OPEN: 348 vfs_in_open(c allid, &call);348 vfs_in_open(chandle, &call); 349 349 break; 350 350 case VFS_IN_PUT: 351 vfs_in_put(c allid, &call);351 vfs_in_put(chandle, &call); 352 352 break; 353 353 case VFS_IN_READ: 354 vfs_in_read(c allid, &call);354 vfs_in_read(chandle, &call); 355 355 break; 356 356 case VFS_IN_REGISTER: 357 vfs_register(c allid, &call);357 vfs_register(chandle, &call); 358 358 cont = false; 359 359 break; 360 360 case VFS_IN_RENAME: 361 vfs_in_rename(c allid, &call);361 vfs_in_rename(chandle, &call); 362 362 break; 363 363 case VFS_IN_RESIZE: 364 vfs_in_resize(c allid, &call);364 vfs_in_resize(chandle, &call); 365 365 break; 366 366 case VFS_IN_STAT: 367 vfs_in_stat(c allid, &call);367 vfs_in_stat(chandle, &call); 368 368 break; 369 369 case VFS_IN_STATFS: 370 vfs_in_statfs(c allid, &call);370 vfs_in_statfs(chandle, &call); 371 371 break; 372 372 case VFS_IN_SYNC: 373 vfs_in_sync(c allid, &call);373 vfs_in_sync(chandle, &call); 374 374 break; 375 375 case VFS_IN_UNLINK: 376 vfs_in_unlink(c allid, &call);376 vfs_in_unlink(chandle, &call); 377 377 break; 378 378 case VFS_IN_UNMOUNT: 379 vfs_in_unmount(c allid, &call);379 vfs_in_unmount(chandle, &call); 380 380 break; 381 381 case VFS_IN_WAIT_HANDLE: 382 vfs_in_wait_handle(c allid, &call);382 vfs_in_wait_handle(chandle, &call); 383 383 break; 384 384 case VFS_IN_WALK: 385 vfs_in_walk(c allid, &call);385 vfs_in_walk(chandle, &call); 386 386 break; 387 387 case VFS_IN_WRITE: 388 vfs_in_write(c allid, &call);388 vfs_in_write(chandle, &call); 389 389 break; 390 390 default: 391 async_answer_0(c allid, ENOTSUP);391 async_answer_0(chandle, ENOTSUP); 392 392 break; 393 393 }
Note:
See TracChangeset
for help on using the changeset viewer.