Changeset 132ab5d1 in mainline for uspace/srv/vfs/vfs_ops.c
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/srv/vfs/vfs_ops.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_ops.c
r8bfb163 r132ab5d1 86 86 } 87 87 88 int vfs_op_clone(int oldfd, int newfd, bool desc )88 int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd) 89 89 { 90 90 int rc; … … 102 102 103 103 if (newfd != -1) { 104 /* Make sure newfd is closed. */105 (void) vfs_fd_free(newfd);106 104 /* Assign the old file to newfd. */ 107 105 rc = vfs_fd_assign(oldfile, newfd); 106 *out_fd = newfd; 108 107 } else { 109 108 vfs_file_t *newfile; 110 int newfd = vfs_fd_alloc(&newfile, desc);111 if ( newfd >= 0) {109 rc = vfs_fd_alloc(&newfile, desc, out_fd); 110 if (rc == EOK) { 112 111 newfile->node = oldfile->node; 113 112 newfile->permissions = oldfile->permissions; … … 116 115 vfs_file_put(newfile); 117 116 } 118 rc = newfd;119 117 } 120 118 vfs_file_put(oldfile); … … 154 152 &answer); 155 153 /* Send the mount options */ 156 sysarg_t rc = async_data_write_start(exch, options, str_size(options));154 int rc = async_data_write_start(exch, options, str_size(options)); 157 155 if (rc != EOK) { 158 156 async_forget(msg); … … 194 192 { 195 193 fs_handle_t fs_handle = 0; 196 sysarg_t rc;194 int rc; 197 195 int retval; 198 196 … … 225 223 226 224 int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags, 227 unsigned instance, const char *opts, const char *fs_name, int *out fd)225 unsigned instance, const char *opts, const char *fs_name, int *out_fd) 228 226 { 229 227 int rc; 230 228 vfs_file_t *mp = NULL; 231 229 vfs_file_t *file = NULL; 232 intfd = -1;230 *out_fd = -1; 233 231 234 232 if (!(flags & VFS_MOUNT_CONNECT_ONLY)) { … … 256 254 257 255 if (!(flags & VFS_MOUNT_NO_REF)) { 258 fd = vfs_fd_alloc(&file, false); 259 if (fd < 0) { 260 rc = fd; 256 rc = vfs_fd_alloc(&file, false, out_fd); 257 if (rc != EOK) { 261 258 goto out; 262 259 } … … 297 294 vfs_file_put(file); 298 295 299 if (rc != EOK && fd >= 0) { 300 vfs_fd_free(fd); 301 fd = 0; 302 } 303 304 *outfd = fd; 296 if (rc != EOK && *out_fd >= 0) { 297 vfs_fd_free(*out_fd); 298 *out_fd = -1; 299 } 300 305 301 return rc; 306 302 } … … 402 398 } 403 399 404 sysarg_t rc;400 int rc; 405 401 async_wait_for(msg, &rc); 406 402 … … 681 677 vfs_exchange_release(fs_exch); 682 678 683 sysarg_t rc;679 int rc; 684 680 async_wait_for(msg, &rc); 685 681 … … 693 689 { 694 690 async_exch_t *exch = vfs_exchange_grab(fs_handle); 695 sysarg_t rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,691 int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE, 696 692 (sysarg_t) service_id, (sysarg_t) index, LOWER32(size), 697 693 UPPER32(size)); … … 830 826 } 831 827 832 int vfs_op_wait_handle(bool high_fd )833 { 834 return vfs_wait_handle_internal(high_fd );828 int vfs_op_wait_handle(bool high_fd, int *out_fd) 829 { 830 return vfs_wait_handle_internal(high_fd, out_fd); 835 831 } 836 832 … … 894 890 895 891 vfs_file_t *file; 896 int fd = vfs_fd_alloc(&file, false);897 if ( fd < 0) {892 rc = vfs_fd_alloc(&file, false, out_fd); 893 if (rc != EOK) { 898 894 vfs_node_put(node); 899 895 vfs_file_put(parent); 900 return fd;896 return rc; 901 897 } 902 898 assert(file != NULL); … … 912 908 fibril_rwlock_read_unlock(&namespace_rwlock); 913 909 914 *out_fd = fd;915 910 return EOK; 916 911 }
Note:
See TracChangeset
for help on using the changeset viewer.
