Changeset 77f0a1d in mainline for uspace/srv/vfs
- Timestamp:
- 2018-03-22T22:54:52Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eed4139
- Parents:
- a46e56b
- Location:
- uspace/srv/vfs
- Files:
-
- 3 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 -
uspace/srv/vfs/vfs_pager.c
ra46e56b r77f0a1d 42 42 #include <as.h> 43 43 44 void vfs_page_in(cap_call_handle_t r id, ipc_call_t *request)44 void vfs_page_in(cap_call_handle_t req_handle, ipc_call_t *request) 45 45 { 46 46 aoff64_t offset = IPC_GET_ARG1(*request); … … 55 55 56 56 if (page == AS_MAP_FAILED) { 57 async_answer_0(r id, ENOMEM);57 async_answer_0(req_handle, ENOMEM); 58 58 return; 59 59 } … … 78 78 } while (total < page_size); 79 79 80 async_answer_1(r id, rc, (sysarg_t) page);80 async_answer_1(req_handle, rc, (sysarg_t) page); 81 81 82 82 /* -
uspace/srv/vfs/vfs_register.c
ra46e56b r77f0a1d 108 108 /** VFS_REGISTER protocol function. 109 109 * 110 * @param r id Hash of the call withthe request.111 * @param request Call structure with the request.112 * 113 */ 114 void vfs_register(cap_call_handle_t r id, ipc_call_t *request)110 * @param req_handle Call handle of the request. 111 * @param request Call structure with the request. 112 * 113 */ 114 void vfs_register(cap_call_handle_t req_handle, ipc_call_t *request) 115 115 { 116 116 dprintf("Processing VFS_REGISTER request received from %zx.\n", … … 124 124 dprintf("Failed to deliver the VFS info into our AS, rc=%d.\n", 125 125 rc); 126 async_answer_0(r id, rc);126 async_answer_0(req_handle, rc); 127 127 return; 128 128 } … … 134 134 if (!fs_info) { 135 135 dprintf("Could not allocate memory for FS info.\n"); 136 async_answer_0(r id, ENOMEM);136 async_answer_0(req_handle, ENOMEM); 137 137 return; 138 138 } … … 146 146 if (!vfs_info_sane(&fs_info->vfs_info)) { 147 147 free(fs_info); 148 async_answer_0(r id, EINVAL);148 async_answer_0(req_handle, EINVAL); 149 149 return; 150 150 } … … 163 163 fibril_mutex_unlock(&fs_list_lock); 164 164 free(fs_info); 165 async_answer_0(r id, EEXIST);165 async_answer_0(req_handle, EEXIST); 166 166 return; 167 167 } … … 184 184 fibril_mutex_unlock(&fs_list_lock); 185 185 free(fs_info); 186 async_answer_0(r id, EINVAL);186 async_answer_0(req_handle, EINVAL); 187 187 return; 188 188 } … … 203 203 free(fs_info); 204 204 async_answer_0(chandle, EINVAL); 205 async_answer_0(r id, EINVAL);205 async_answer_0(req_handle, EINVAL); 206 206 return; 207 207 } … … 217 217 free(fs_info); 218 218 async_answer_0(chandle, EINVAL); 219 async_answer_0(r id, EINVAL);219 async_answer_0(req_handle, EINVAL); 220 220 return; 221 221 } … … 235 235 */ 236 236 fs_info->fs_handle = (fs_handle_t) atomic_postinc(&fs_handle_next); 237 async_answer_1(r id, EOK, (sysarg_t) fs_info->fs_handle);237 async_answer_1(req_handle, EOK, (sysarg_t) fs_info->fs_handle); 238 238 239 239 fibril_condvar_broadcast(&fs_list_cv);
Note:
See TracChangeset
for help on using the changeset viewer.