Changes in uspace/srv/vfs/vfs_ops.c [b7fd2a0:25a179e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
rb7fd2a0 r25a179e 52 52 53 53 /* Forward declarations of static functions. */ 54 static errno_t vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,54 static int vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t, 55 55 aoff64_t); 56 56 … … 86 86 } 87 87 88 errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)89 { 90 errno_t rc;88 int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd) 89 { 90 int rc; 91 91 92 92 /* If the file descriptors are the same, do nothing. */ … … 121 121 } 122 122 123 errno_t vfs_op_put(int fd)123 int vfs_op_put(int fd) 124 124 { 125 125 return vfs_fd_free(fd); 126 126 } 127 127 128 static errno_t vfs_connect_internal(service_id_t service_id, unsigned flags,128 static int vfs_connect_internal(service_id_t service_id, unsigned flags, 129 129 unsigned instance, const char *options, const char *fsname, 130 130 vfs_node_t **root) … … 152 152 &answer); 153 153 /* Send the mount options */ 154 errno_t rc = async_data_write_start(exch, options, str_size(options));154 int rc = async_data_write_start(exch, options, str_size(options)); 155 155 if (rc != EOK) { 156 156 async_forget(msg); … … 188 188 } 189 189 190 errno_t vfs_op_fsprobe(const char *fs_name, service_id_t sid,190 int vfs_op_fsprobe(const char *fs_name, service_id_t sid, 191 191 vfs_fs_probe_info_t *info) 192 192 { 193 193 fs_handle_t fs_handle = 0; 194 errno_t rc;195 errno_t retval;194 int rc; 195 int retval; 196 196 197 197 fibril_mutex_lock(&fs_list_lock); … … 222 222 } 223 223 224 errno_t vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,224 int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags, 225 225 unsigned instance, const char *opts, const char *fs_name, int *out_fd) 226 226 { 227 errno_t rc;227 int rc; 228 228 vfs_file_t *mp = NULL; 229 229 vfs_file_t *file = NULL; … … 302 302 } 303 303 304 errno_t vfs_op_open(int fd, int mode)304 int vfs_op_open(int fd, int mode) 305 305 { 306 306 if (mode == 0) … … 336 336 } 337 337 338 errno_t rc = vfs_open_node_remote(file->node);338 int rc = vfs_open_node_remote(file->node); 339 339 if (rc != EOK) { 340 340 file->open_read = file->open_write = false; … … 347 347 } 348 348 349 typedef errno_t (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,349 typedef int (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t, 350 350 ipc_call_t *, bool, void *); 351 351 352 static errno_t rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,352 static int rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos, 353 353 ipc_call_t *answer, bool read, void *data) 354 354 { 355 355 size_t *bytes = (size_t *) data; 356 errno_t rc;356 int rc; 357 357 358 358 /* … … 378 378 } 379 379 380 static errno_t rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,380 static int rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos, 381 381 ipc_call_t *answer, bool read, void *data) 382 382 { … … 392 392 return EINVAL; 393 393 394 errno_t retval = async_data_read_start(exch, chunk->buffer, chunk->size);394 int retval = async_data_read_start(exch, chunk->buffer, chunk->size); 395 395 if (retval != EOK) { 396 396 async_forget(msg); … … 398 398 } 399 399 400 errno_t rc;400 int rc; 401 401 async_wait_for(msg, &rc); 402 402 403 403 chunk->size = IPC_GET_ARG1(*answer); 404 404 405 return ( errno_t) rc;406 } 407 408 static errno_t vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,405 return (int) rc; 406 } 407 408 static int vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb, 409 409 void *ipc_cb_data) 410 410 { … … 475 475 */ 476 476 ipc_call_t answer; 477 errno_t rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);477 int rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data); 478 478 479 479 vfs_exchange_release(fs_exch); … … 499 499 } 500 500 501 errno_t vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)501 int vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk) 502 502 { 503 503 return vfs_rdwr(fd, pos, read, rdwr_ipc_internal, chunk); 504 504 } 505 505 506 errno_t vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)506 int vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes) 507 507 { 508 508 return vfs_rdwr(fd, pos, true, rdwr_ipc_client, out_bytes); 509 509 } 510 510 511 errno_t vfs_op_rename(int basefd, char *old, char *new)511 int vfs_op_rename(int basefd, char *old, char *new) 512 512 { 513 513 vfs_file_t *base_file = vfs_file_get(basefd); … … 524 524 bool orig_unlinked = false; 525 525 526 errno_t rc;526 int rc; 527 527 528 528 size_t shared = shared_path(old, new); … … 610 610 } 611 611 612 errno_t vfs_op_resize(int fd, int64_t size)612 int vfs_op_resize(int fd, int64_t size) 613 613 { 614 614 vfs_file_t *file = vfs_file_get(fd); … … 618 618 fibril_rwlock_write_lock(&file->node->contents_rwlock); 619 619 620 errno_t rc = vfs_truncate_internal(file->node->fs_handle,620 int rc = vfs_truncate_internal(file->node->fs_handle, 621 621 file->node->service_id, file->node->index, size); 622 622 if (rc == EOK) … … 628 628 } 629 629 630 errno_t vfs_op_stat(int fd)630 int vfs_op_stat(int fd) 631 631 { 632 632 vfs_file_t *file = vfs_file_get(fd); … … 637 637 638 638 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 639 errno_t rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,639 int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT, 640 640 node->service_id, node->index, true, 0, NULL); 641 641 vfs_exchange_release(exch); … … 645 645 } 646 646 647 errno_t vfs_op_statfs(int fd)647 int vfs_op_statfs(int fd) 648 648 { 649 649 vfs_file_t *file = vfs_file_get(fd); … … 654 654 655 655 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 656 errno_t rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,656 int rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS, 657 657 node->service_id, node->index, false, 0, NULL); 658 658 vfs_exchange_release(exch); … … 662 662 } 663 663 664 errno_t vfs_op_sync(int fd)664 int vfs_op_sync(int fd) 665 665 { 666 666 vfs_file_t *file = vfs_file_get(fd); … … 677 677 vfs_exchange_release(fs_exch); 678 678 679 errno_t rc;679 int rc; 680 680 async_wait_for(msg, &rc); 681 681 … … 685 685 } 686 686 687 static errno_t vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,687 static int vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id, 688 688 fs_index_t index, aoff64_t size) 689 689 { 690 690 async_exch_t *exch = vfs_exchange_grab(fs_handle); 691 errno_t rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,691 int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE, 692 692 (sysarg_t) service_id, (sysarg_t) index, LOWER32(size), 693 693 UPPER32(size)); 694 694 vfs_exchange_release(exch); 695 695 696 return ( errno_t) rc;697 } 698 699 errno_t vfs_op_unlink(int parentfd, int expectfd, char *path)700 { 701 errno_t rc = EOK;696 return (int) rc; 697 } 698 699 int vfs_op_unlink(int parentfd, int expectfd, char *path) 700 { 701 int rc = EOK; 702 702 vfs_file_t *parent = NULL; 703 703 vfs_file_t *expect = NULL; … … 778 778 } 779 779 780 errno_t vfs_op_unmount(int mpfd)780 int vfs_op_unmount(int mpfd) 781 781 { 782 782 vfs_file_t *mp = vfs_file_get(mpfd); … … 806 806 807 807 async_exch_t *exch = vfs_exchange_grab(mp->node->mount->fs_handle); 808 errno_t rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,808 int rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED, 809 809 mp->node->mount->service_id); 810 810 vfs_exchange_release(exch); … … 826 826 } 827 827 828 errno_t vfs_op_wait_handle(bool high_fd, int *out_fd)828 int vfs_op_wait_handle(bool high_fd, int *out_fd) 829 829 { 830 830 return vfs_wait_handle_internal(high_fd, out_fd); … … 862 862 } 863 863 864 errno_t vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)864 int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd) 865 865 { 866 866 if (!walk_flags_valid(flags)) … … 874 874 875 875 vfs_lookup_res_t lr; 876 errno_t rc = vfs_lookup_internal(parent->node, path,876 int rc = vfs_lookup_internal(parent->node, path, 877 877 walk_lookup_flags(flags), &lr); 878 878 if (rc != EOK) { … … 911 911 } 912 912 913 errno_t vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)913 int vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes) 914 914 { 915 915 return vfs_rdwr(fd, pos, false, rdwr_ipc_client, out_bytes);
Note:
See TracChangeset
for help on using the changeset viewer.