Changeset fe91f66 in mainline
- Timestamp:
- 2017-03-26T20:57:06Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5b5d84
- Parents:
- fcab7ef
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
rfcab7ef rfe91f66 708 708 proto_add_oper(p, VFS_IN_TRUNCATE, o); 709 709 o = oper_new("fstat", 1, arg_def, V_ERRNO, 0, resp_def); 710 proto_add_oper(p, VFS_IN_ FSTAT, o);710 proto_add_oper(p, VFS_IN_STAT, o); 711 711 o = oper_new("close", 1, arg_def, V_ERRNO, 0, resp_def); 712 712 proto_add_oper(p, VFS_IN_CLOSE, o); … … 723 723 o = oper_new("walk", 2, arg_def, V_INT_ERRNO, 0, resp_def); 724 724 proto_add_oper(p, VFS_IN_WALK, o); 725 o = oper_new("open 2", 2, arg_def, V_ERRNO, 0, resp_def);726 proto_add_oper(p, VFS_IN_OPEN 2, o);727 o = oper_new("unlink 2", 3, arg_def, V_ERRNO, 0, resp_def);728 proto_add_oper(p, VFS_IN_UNLINK 2, o);725 o = oper_new("open", 2, arg_def, V_ERRNO, 0, resp_def); 726 proto_add_oper(p, VFS_IN_OPEN, o); 727 o = oper_new("unlink", 3, arg_def, V_ERRNO, 0, resp_def); 728 proto_add_oper(p, VFS_IN_UNLINK, o); 729 729 730 730 proto_register(SERVICE_VFS, p); -
uspace/lib/c/generic/vfs/vfs.c
rfcab7ef rfe91f66 160 160 { 161 161 async_exch_t *exch = vfs_exchange_begin(); 162 sysarg_t rc = async_req_2_0(exch, VFS_IN_OPEN 2, fildes, mode);162 sysarg_t rc = async_req_2_0(exch, VFS_IN_OPEN, fildes, mode); 163 163 vfs_exchange_end(exch); 164 164 … … 654 654 async_exch_t *exch = vfs_exchange_begin(); 655 655 656 req = async_send_1(exch, VFS_IN_ FSTAT, fildes, NULL);656 req = async_send_1(exch, VFS_IN_STAT, fildes, NULL); 657 657 rc = async_data_read_start(exch, (void *) stat, sizeof(struct stat)); 658 658 if (rc != EOK) { … … 808 808 } 809 809 810 static int _vfs_unlink 2(int parent, const char *path, int expect, int wflag)810 static int _vfs_unlink(int parent, const char *path, int expect, int wflag) 811 811 { 812 812 sysarg_t rc; … … 815 815 async_exch_t *exch = vfs_exchange_begin(); 816 816 817 req = async_send_3(exch, VFS_IN_UNLINK 2, parent, expect, wflag, NULL);817 req = async_send_3(exch, VFS_IN_UNLINK, parent, expect, wflag, NULL); 818 818 rc = async_data_write_start(exch, path, str_size(path)); 819 819 … … 849 849 } 850 850 851 int rc = _vfs_unlink 2(root, pa, -1, 0);851 int rc = _vfs_unlink(root, pa, -1, 0); 852 852 853 853 if (rc != EOK) { … … 882 882 } 883 883 884 int rc = _vfs_unlink 2(root, pa, -1, WALK_DIRECTORY);884 int rc = _vfs_unlink(root, pa, -1, WALK_DIRECTORY); 885 885 if (rc != EOK) { 886 886 errno = rc; -
uspace/lib/c/include/ipc/vfs.h
rfcab7ef rfe91f66 66 66 VFS_IN_WRITE, 67 67 VFS_IN_TRUNCATE, 68 VFS_IN_ FSTAT,68 VFS_IN_STAT, 69 69 VFS_IN_CLOSE, 70 70 VFS_IN_MOUNT, … … 76 76 VFS_IN_STATFS, 77 77 VFS_IN_WALK, 78 VFS_IN_OPEN 2,79 VFS_IN_UNLINK 2,78 VFS_IN_OPEN, 79 VFS_IN_UNLINK, 80 80 VFS_IN_CLONE, 81 81 } vfs_in_request_t; -
uspace/srv/vfs/vfs.h
rfcab7ef rfe91f66 206 206 extern int vfs_op_clone(int oldfd, int newfd, bool desc); 207 207 extern int vfs_op_close(int fd); 208 extern int vfs_op_fstat(int fd);209 208 extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd); 210 209 extern int vfs_op_mtab_get(void); 211 extern int vfs_op_open 2(int fd, int flags);210 extern int vfs_op_open(int fd, int flags); 212 211 extern int vfs_op_read(int fd, aoff64_t, size_t *out_bytes); 213 212 extern int vfs_op_rename(int basefd, char *old, char *new); 213 extern int vfs_op_stat(int fd); 214 214 extern int vfs_op_statfs(int fd); 215 215 extern int vfs_op_sync(int fd); 216 216 extern int vfs_op_truncate(int fd, int64_t size); 217 extern int vfs_op_unlink 2(int parentfd, int expectfd, int wflag, char *path);217 extern int vfs_op_unlink(int parentfd, int expectfd, int wflag, char *path); 218 218 extern int vfs_op_unmount(int mpfd); 219 219 extern int vfs_op_wait_handle(bool high_fd); -
uspace/srv/vfs/vfs_ipc.c
rfcab7ef rfe91f66 51 51 } 52 52 53 static void vfs_in_fstat(ipc_callid_t rid, ipc_call_t *request)54 {55 int fd = IPC_GET_ARG1(*request);56 int rc = vfs_op_fstat(fd);57 async_answer_0(rid, rc);58 }59 60 53 static void vfs_in_mount(ipc_callid_t rid, ipc_call_t *request) 61 54 { … … 103 96 } 104 97 105 static void vfs_in_open 2(ipc_callid_t rid, ipc_call_t *request)98 static void vfs_in_open(ipc_callid_t rid, ipc_call_t *request) 106 99 { 107 100 int fd = IPC_GET_ARG1(*request); 108 101 int flags = IPC_GET_ARG2(*request); 109 102 110 int rc = vfs_op_open 2(fd, flags);103 int rc = vfs_op_open(fd, flags); 111 104 async_answer_0(rid, rc); 112 105 } … … 167 160 } 168 161 162 static void vfs_in_stat(ipc_callid_t rid, ipc_call_t *request) 163 { 164 int fd = IPC_GET_ARG1(*request); 165 int rc = vfs_op_stat(fd); 166 async_answer_0(rid, rc); 167 } 168 169 169 static void vfs_in_statfs(ipc_callid_t rid, ipc_call_t *request) 170 170 { … … 190 190 } 191 191 192 static void vfs_in_unlink 2(ipc_callid_t rid, ipc_call_t *request)192 static void vfs_in_unlink(ipc_callid_t rid, ipc_call_t *request) 193 193 { 194 194 int parentfd = IPC_GET_ARG1(*request); … … 199 199 int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL); 200 200 if (rc == EOK) 201 rc = vfs_op_unlink 2(parentfd, expectfd, wflag, path);201 rc = vfs_op_unlink(parentfd, expectfd, wflag, path); 202 202 203 203 async_answer_0(rid, rc); … … 272 272 vfs_in_close(callid, &call); 273 273 break; 274 case VFS_IN_FSTAT:275 vfs_in_fstat(callid, &call);276 break;277 274 case VFS_IN_MOUNT: 278 275 vfs_in_mount(callid, &call); 279 276 break; 280 case VFS_IN_OPEN 2:281 vfs_in_open 2(callid, &call);277 case VFS_IN_OPEN: 278 vfs_in_open(callid, &call); 282 279 break; 283 280 case VFS_IN_READ: … … 291 288 vfs_in_rename(callid, &call); 292 289 break; 290 case VFS_IN_STAT: 291 vfs_in_stat(callid, &call); 292 break; 293 293 case VFS_IN_STATFS: 294 294 vfs_in_statfs(callid, &call); … … 300 300 vfs_in_truncate(callid, &call); 301 301 break; 302 case VFS_IN_UNLINK 2:303 vfs_in_unlink 2(callid, &call);302 case VFS_IN_UNLINK: 303 vfs_in_unlink(callid, &call); 304 304 break; 305 305 case VFS_IN_UNMOUNT: -
uspace/srv/vfs/vfs_ops.c
rfcab7ef rfe91f66 130 130 } 131 131 132 int vfs_op_fstat(int fd)133 {134 vfs_file_t *file = vfs_file_get(fd);135 if (!file)136 return EBADF;137 138 vfs_node_t *node = file->node;139 140 async_exch_t *exch = vfs_exchange_grab(node->fs_handle);141 int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,142 node->service_id, node->index, true, 0, NULL);143 vfs_exchange_release(exch);144 145 vfs_file_put(file);146 return rc;147 }148 149 132 static int vfs_connect_internal(service_id_t service_id, unsigned flags, 150 133 unsigned instance, const char *options, const char *fsname, … … 291 274 } 292 275 293 int vfs_op_open 2(int fd, int flags)276 int vfs_op_open(int fd, int flags) 294 277 { 295 278 if (flags == 0) … … 602 585 } 603 586 587 int vfs_op_stat(int fd) 588 { 589 vfs_file_t *file = vfs_file_get(fd); 590 if (!file) 591 return EBADF; 592 593 vfs_node_t *node = file->node; 594 595 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 596 int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT, 597 node->service_id, node->index, true, 0, NULL); 598 vfs_exchange_release(exch); 599 600 vfs_file_put(file); 601 return rc; 602 } 603 604 604 int vfs_op_statfs(int fd) 605 605 { … … 672 672 } 673 673 674 int vfs_op_unlink 2(int parentfd, int expectfd, int wflag, char *path)674 int vfs_op_unlink(int parentfd, int expectfd, int wflag, char *path) 675 675 { 676 676 int rc = EOK;
Note:
See TracChangeset
for help on using the changeset viewer.