Changeset b7fd2a0 in mainline for uspace/srv/vfs
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/srv/vfs
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.c
r36f0738 rb7fd2a0 88 88 int main(int argc, char **argv) 89 89 { 90 int rc;90 errno_t rc; 91 91 92 92 printf("%s: HelenOS VFS server\n", NAME); -
uspace/srv/vfs/vfs.h
r36f0738 rb7fd2a0 176 176 extern fs_handle_t fs_name_to_handle(unsigned int instance, const char *, bool); 177 177 extern vfs_info_t *fs_handle_to_info(fs_handle_t); 178 extern int vfs_get_fstypes(vfs_fstypes_t *);179 180 extern int vfs_lookup_internal(vfs_node_t *, char *, int, vfs_lookup_res_t *);181 extern int vfs_link_internal(vfs_node_t *, char *, vfs_triplet_t *);178 extern errno_t vfs_get_fstypes(vfs_fstypes_t *); 179 180 extern errno_t vfs_lookup_internal(vfs_node_t *, char *, int, vfs_lookup_res_t *); 181 extern errno_t vfs_link_internal(vfs_node_t *, char *, vfs_triplet_t *); 182 182 183 183 extern bool vfs_nodes_init(void); … … 194 194 195 195 extern void vfs_op_pass_handle(task_id_t, task_id_t, int); 196 extern int vfs_wait_handle_internal(bool, int *);196 extern errno_t vfs_wait_handle_internal(bool, int *); 197 197 198 198 extern vfs_file_t *vfs_file_get(int); 199 199 extern void vfs_file_put(vfs_file_t *); 200 extern int vfs_fd_assign(vfs_file_t *, int);201 extern int vfs_fd_alloc(vfs_file_t **file, bool desc, int *);202 extern int vfs_fd_free(int);200 extern errno_t vfs_fd_assign(vfs_file_t *, int); 201 extern errno_t vfs_fd_alloc(vfs_file_t **file, bool desc, int *); 202 extern errno_t vfs_fd_free(int); 203 203 204 204 extern void vfs_node_addref(vfs_node_t *); 205 205 extern void vfs_node_delref(vfs_node_t *); 206 extern int vfs_open_node_remote(vfs_node_t *);207 208 extern int vfs_op_clone(int oldfd, int newfd, bool desc, int *);209 extern int vfs_op_fsprobe(const char *, service_id_t, vfs_fs_probe_info_t *);210 extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd);211 extern int vfs_op_mtab_get(void);212 extern int vfs_op_open(int fd, int flags);213 extern int vfs_op_put(int fd);214 extern int vfs_op_read(int fd, aoff64_t, size_t *out_bytes);215 extern int vfs_op_rename(int basefd, char *old, char *new);216 extern int vfs_op_resize(int fd, int64_t size);217 extern int vfs_op_stat(int fd);218 extern int vfs_op_statfs(int fd);219 extern int vfs_op_sync(int fd);220 extern int vfs_op_unlink(int parentfd, int expectfd, char *path);221 extern int vfs_op_unmount(int mpfd);222 extern int vfs_op_wait_handle(bool high_fd, int *out_fd);223 extern int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd);224 extern int vfs_op_write(int fd, aoff64_t, size_t *out_bytes);206 extern errno_t vfs_open_node_remote(vfs_node_t *); 207 208 extern errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *); 209 extern errno_t vfs_op_fsprobe(const char *, service_id_t, vfs_fs_probe_info_t *); 210 extern errno_t vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd); 211 extern errno_t vfs_op_mtab_get(void); 212 extern errno_t vfs_op_open(int fd, int flags); 213 extern errno_t vfs_op_put(int fd); 214 extern errno_t vfs_op_read(int fd, aoff64_t, size_t *out_bytes); 215 extern errno_t vfs_op_rename(int basefd, char *old, char *new); 216 extern errno_t vfs_op_resize(int fd, int64_t size); 217 extern errno_t vfs_op_stat(int fd); 218 extern errno_t vfs_op_statfs(int fd); 219 extern errno_t vfs_op_sync(int fd); 220 extern errno_t vfs_op_unlink(int parentfd, int expectfd, char *path); 221 extern errno_t vfs_op_unmount(int mpfd); 222 extern errno_t vfs_op_wait_handle(bool high_fd, int *out_fd); 223 extern errno_t vfs_op_walk(int parentfd, int flags, char *path, int *out_fd); 224 extern errno_t vfs_op_write(int fd, aoff64_t, size_t *out_bytes); 225 225 226 226 extern void vfs_register(ipc_callid_t, ipc_call_t *); … … 233 233 } rdwr_io_chunk_t; 234 234 235 extern int vfs_rdwr_internal(int, aoff64_t, bool, rdwr_io_chunk_t *);235 extern errno_t vfs_rdwr_internal(int, aoff64_t, bool, rdwr_io_chunk_t *); 236 236 237 237 extern void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg); -
uspace/srv/vfs/vfs_file.c
r36f0738 rb7fd2a0 64 64 } vfs_boxed_handle_t; 65 65 66 static int _vfs_fd_free(vfs_client_data_t *, int);66 static errno_t _vfs_fd_free(vfs_client_data_t *, int); 67 67 68 68 /** Initialize the table of open files. */ … … 133 133 134 134 /** Close the file in the endpoint FS server. */ 135 static int vfs_file_close_remote(vfs_file_t *file)135 static errno_t vfs_file_close_remote(vfs_file_t *file) 136 136 { 137 137 assert(!file->refcnt); … … 145 145 vfs_exchange_release(exch); 146 146 147 int rc;147 errno_t rc; 148 148 async_wait_for(msg, &rc); 149 149 … … 168 168 * decremented. 169 169 */ 170 static int vfs_file_delref(vfs_client_data_t *vfs_data, vfs_file_t *file)171 { 172 int rc = EOK;170 static errno_t vfs_file_delref(vfs_client_data_t *vfs_data, vfs_file_t *file) 171 { 172 errno_t rc = EOK; 173 173 174 174 assert(fibril_mutex_is_locked(&vfs_data->lock)); … … 192 192 } 193 193 194 static int _vfs_fd_alloc(vfs_client_data_t *vfs_data, vfs_file_t **file, bool desc, int *out_fd)194 static errno_t _vfs_fd_alloc(vfs_client_data_t *vfs_data, vfs_file_t **file, bool desc, int *out_fd) 195 195 { 196 196 if (!vfs_files_init(vfs_data)) … … 254 254 * @return Error code. 255 255 */ 256 int vfs_fd_alloc(vfs_file_t **file, bool desc, int *out_fd)256 errno_t vfs_fd_alloc(vfs_file_t **file, bool desc, int *out_fd) 257 257 { 258 258 return _vfs_fd_alloc(VFS_DATA, file, desc, out_fd); 259 259 } 260 260 261 static int _vfs_fd_free_locked(vfs_client_data_t *vfs_data, int fd)261 static errno_t _vfs_fd_free_locked(vfs_client_data_t *vfs_data, int fd) 262 262 { 263 263 if ((fd < 0) || (fd >= MAX_OPEN_FILES) || !vfs_data->files[fd]) { … … 265 265 } 266 266 267 int rc = vfs_file_delref(vfs_data, vfs_data->files[fd]);267 errno_t rc = vfs_file_delref(vfs_data, vfs_data->files[fd]); 268 268 vfs_data->files[fd] = NULL; 269 269 return rc; 270 270 } 271 271 272 static int _vfs_fd_free(vfs_client_data_t *vfs_data, int fd)273 { 274 int rc;272 static errno_t _vfs_fd_free(vfs_client_data_t *vfs_data, int fd) 273 { 274 errno_t rc; 275 275 276 276 if (!vfs_files_init(vfs_data)) … … 291 291 * descriptor. 292 292 */ 293 int vfs_fd_free(int fd)293 errno_t vfs_fd_free(int fd) 294 294 { 295 295 return _vfs_fd_free(VFS_DATA, fd); … … 305 305 * 306 306 */ 307 int vfs_fd_assign(vfs_file_t *file, int fd)307 errno_t vfs_fd_assign(vfs_file_t *file, int fd) 308 308 { 309 309 if (!vfs_files_init(VFS_DATA)) … … 429 429 } 430 430 431 int vfs_wait_handle_internal(bool high_fd, int *out_fd)431 errno_t vfs_wait_handle_internal(bool high_fd, int *out_fd) 432 432 { 433 433 vfs_client_data_t *vfs_data = VFS_DATA; … … 443 443 444 444 vfs_file_t *file; 445 int rc = _vfs_fd_alloc(vfs_data, &file, high_fd, out_fd);445 errno_t rc = _vfs_fd_alloc(vfs_data, &file, high_fd, out_fd); 446 446 if (rc != EOK) { 447 447 vfs_node_delref(bh->node); -
uspace/srv/vfs/vfs_ipc.c
r36f0738 rb7fd2a0 42 42 43 43 int outfd = -1; 44 int rc = vfs_op_clone(oldfd, newfd, desc, &outfd);44 errno_t rc = vfs_op_clone(oldfd, newfd, desc, &outfd); 45 45 async_answer_1(rid, rc, outfd); 46 46 } … … 53 53 vfs_fs_probe_info_t info; 54 54 size_t len; 55 int rc;55 errno_t rc; 56 56 57 57 /* … … 88 88 size_t len; 89 89 vfs_fstypes_t fstypes; 90 int rc;90 errno_t rc; 91 91 92 92 rc = vfs_get_fstypes(&fstypes); … … 129 129 130 130 /* Now we expect to receive the mount options. */ 131 int rc = async_data_write_accept((void **) &opts, true, 0,131 errno_t rc = async_data_write_accept((void **) &opts, true, 0, 132 132 MAX_MNTOPTS_LEN, 0, NULL); 133 133 if (rc != EOK) { … … 161 161 int mode = IPC_GET_ARG2(*request); 162 162 163 int rc = vfs_op_open(fd, mode);163 errno_t rc = vfs_op_open(fd, mode); 164 164 async_answer_0(rid, rc); 165 165 } … … 168 168 { 169 169 int fd = IPC_GET_ARG1(*request); 170 int rc = vfs_op_put(fd);170 errno_t rc = vfs_op_put(fd); 171 171 async_answer_0(rid, rc); 172 172 } … … 179 179 180 180 size_t bytes = 0; 181 int rc = vfs_op_read(fd, pos, &bytes);181 errno_t rc = vfs_op_read(fd, pos, &bytes); 182 182 async_answer_1(rid, rc, bytes); 183 183 } … … 189 189 char *old = NULL; 190 190 char *new = NULL; 191 int rc;191 errno_t rc; 192 192 193 193 basefd = IPC_GET_ARG1(*request); … … 231 231 int fd = IPC_GET_ARG1(*request); 232 232 int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*request), IPC_GET_ARG3(*request)); 233 int rc = vfs_op_resize(fd, size);233 errno_t rc = vfs_op_resize(fd, size); 234 234 async_answer_0(rid, rc); 235 235 } … … 238 238 { 239 239 int fd = IPC_GET_ARG1(*request); 240 int rc = vfs_op_stat(fd);240 errno_t rc = vfs_op_stat(fd); 241 241 async_answer_0(rid, rc); 242 242 } … … 246 246 int fd = (int) IPC_GET_ARG1(*request); 247 247 248 int rc = vfs_op_statfs(fd);248 errno_t rc = vfs_op_statfs(fd); 249 249 async_answer_0(rid, rc); 250 250 } … … 253 253 { 254 254 int fd = IPC_GET_ARG1(*request); 255 int rc = vfs_op_sync(fd);255 errno_t rc = vfs_op_sync(fd); 256 256 async_answer_0(rid, rc); 257 257 } … … 263 263 264 264 char *path; 265 int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);265 errno_t rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL); 266 266 if (rc == EOK) 267 267 rc = vfs_op_unlink(parentfd, expectfd, path); … … 273 273 { 274 274 int mpfd = IPC_GET_ARG1(*request); 275 int rc = vfs_op_unmount(mpfd);275 errno_t rc = vfs_op_unmount(mpfd); 276 276 async_answer_0(rid, rc); 277 277 } … … 281 281 bool high_fd = IPC_GET_ARG1(*request); 282 282 int fd = -1; 283 int rc = vfs_op_wait_handle(high_fd, &fd);283 errno_t rc = vfs_op_wait_handle(high_fd, &fd); 284 284 async_answer_1(rid, rc, fd); 285 285 } … … 296 296 int fd = 0; 297 297 char *path; 298 int rc = async_data_write_accept((void **)&path, true, 0, 0, 0, NULL);298 errno_t rc = async_data_write_accept((void **)&path, true, 0, 0, 0, NULL); 299 299 if (rc == EOK) { 300 300 rc = vfs_op_walk(parentfd, flags, path, &fd); … … 311 311 312 312 size_t bytes = 0; 313 int rc = vfs_op_write(fd, pos, &bytes);313 errno_t rc = vfs_op_write(fd, pos, &bytes); 314 314 async_answer_1(rid, rc, bytes); 315 315 } -
uspace/srv/vfs/vfs_lookup.c
r36f0738 rb7fd2a0 53 53 uint8_t *plb = NULL; 54 54 55 static int plb_insert_entry(plb_entry_t *entry, char *path, size_t *start,55 static errno_t plb_insert_entry(plb_entry_t *entry, char *path, size_t *start, 56 56 size_t len) 57 57 { … … 138 138 } 139 139 140 int vfs_link_internal(vfs_node_t *base, char *path, vfs_triplet_t *child)140 errno_t vfs_link_internal(vfs_node_t *base, char *path, vfs_triplet_t *child) 141 141 { 142 142 assert(base != NULL); … … 148 148 vfs_lookup_res_t res; 149 149 char component[NAME_MAX + 1]; 150 int rc;150 errno_t rc; 151 151 152 152 size_t len; … … 197 197 198 198 rc = async_data_write_start(exch, component, str_size(component) + 1); 199 int orig_rc;199 errno_t orig_rc; 200 200 async_wait_for(req, &orig_rc); 201 201 vfs_exchange_release(exch); … … 207 207 } 208 208 209 static int out_lookup(vfs_triplet_t *base, size_t *pfirst, size_t *plen,209 static errno_t out_lookup(vfs_triplet_t *base, size_t *pfirst, size_t *plen, 210 210 int lflag, vfs_lookup_res_t *result) 211 211 { … … 213 213 assert(result); 214 214 215 int rc;215 errno_t rc; 216 216 ipc_call_t answer; 217 217 async_exch_t *exch = vfs_exchange_grab(base->fs_handle); … … 238 238 } 239 239 240 static int _vfs_lookup_internal(vfs_node_t *base, char *path, int lflag,240 static errno_t _vfs_lookup_internal(vfs_node_t *base, char *path, int lflag, 241 241 vfs_lookup_res_t *result, size_t len) 242 242 { 243 243 size_t first; 244 int rc;244 errno_t rc; 245 245 246 246 plb_entry_t entry; … … 334 334 * 335 335 */ 336 int vfs_lookup_internal(vfs_node_t *base, char *path, int lflag,336 errno_t vfs_lookup_internal(vfs_node_t *base, char *path, int lflag, 337 337 vfs_lookup_res_t *result) 338 338 { … … 341 341 342 342 size_t len; 343 int rc;343 errno_t rc; 344 344 char *npath = canonify(path, &len); 345 345 if (!npath) { -
uspace/srv/vfs/vfs_node.c
r36f0738 rb7fd2a0 265 265 * 266 266 */ 267 int vfs_open_node_remote(vfs_node_t *node)267 errno_t vfs_open_node_remote(vfs_node_t *node) 268 268 { 269 269 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); … … 275 275 vfs_exchange_release(exch); 276 276 277 int rc;277 errno_t rc; 278 278 async_wait_for(req, &rc); 279 279 … … 318 318 { 319 319 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 320 int rc = async_req_2_0(exch, VFS_OUT_IS_EMPTY, node->service_id,320 errno_t rc = async_req_2_0(exch, VFS_OUT_IS_EMPTY, node->service_id, 321 321 node->index); 322 322 vfs_exchange_release(exch); -
uspace/srv/vfs/vfs_ops.c
r36f0738 rb7fd2a0 52 52 53 53 /* Forward declarations of static functions. */ 54 static int vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,54 static errno_t vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t, 55 55 aoff64_t); 56 56 … … 86 86 } 87 87 88 int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)89 { 90 int rc;88 errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd) 89 { 90 errno_t rc; 91 91 92 92 /* If the file descriptors are the same, do nothing. */ … … 121 121 } 122 122 123 int vfs_op_put(int fd)123 errno_t vfs_op_put(int fd) 124 124 { 125 125 return vfs_fd_free(fd); 126 126 } 127 127 128 static int vfs_connect_internal(service_id_t service_id, unsigned flags,128 static errno_t 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 int rc = async_data_write_start(exch, options, str_size(options));154 errno_t 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 int vfs_op_fsprobe(const char *fs_name, service_id_t sid,190 errno_t 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 int rc;195 int retval;194 errno_t rc; 195 errno_t retval; 196 196 197 197 fibril_mutex_lock(&fs_list_lock); … … 222 222 } 223 223 224 int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,224 errno_t 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 int rc;227 errno_t rc; 228 228 vfs_file_t *mp = NULL; 229 229 vfs_file_t *file = NULL; … … 302 302 } 303 303 304 int vfs_op_open(int fd, int mode)304 errno_t vfs_op_open(int fd, int mode) 305 305 { 306 306 if (mode == 0) … … 336 336 } 337 337 338 int rc = vfs_open_node_remote(file->node);338 errno_t 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 int (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,349 typedef errno_t (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t, 350 350 ipc_call_t *, bool, void *); 351 351 352 static int rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,352 static errno_t 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 int rc;356 errno_t rc; 357 357 358 358 /* … … 378 378 } 379 379 380 static int rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,380 static errno_t 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 int retval = async_data_read_start(exch, chunk->buffer, chunk->size);394 errno_t 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 int rc;400 errno_t rc; 401 401 async_wait_for(msg, &rc); 402 402 403 403 chunk->size = IPC_GET_ARG1(*answer); 404 404 405 return ( int) rc;406 } 407 408 static int vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,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, 409 409 void *ipc_cb_data) 410 410 { … … 475 475 */ 476 476 ipc_call_t answer; 477 int rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);477 errno_t 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 int vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)501 errno_t 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 int vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)506 errno_t 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 int vfs_op_rename(int basefd, char *old, char *new)511 errno_t 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 int rc;526 errno_t rc; 527 527 528 528 size_t shared = shared_path(old, new); … … 610 610 } 611 611 612 int vfs_op_resize(int fd, int64_t size)612 errno_t 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 int rc = vfs_truncate_internal(file->node->fs_handle,620 errno_t 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 int vfs_op_stat(int fd)630 errno_t 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 int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,639 errno_t 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 int vfs_op_statfs(int fd)647 errno_t 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 int rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,656 errno_t 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 int vfs_op_sync(int fd)664 errno_t 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 int rc;679 errno_t rc; 680 680 async_wait_for(msg, &rc); 681 681 … … 685 685 } 686 686 687 static int vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,687 static errno_t 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 int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,691 errno_t 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 ( int) rc;697 } 698 699 int vfs_op_unlink(int parentfd, int expectfd, char *path)700 { 701 int rc = EOK;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; 702 702 vfs_file_t *parent = NULL; 703 703 vfs_file_t *expect = NULL; … … 778 778 } 779 779 780 int vfs_op_unmount(int mpfd)780 errno_t 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 int rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,808 errno_t 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 int vfs_op_wait_handle(bool high_fd, int *out_fd)828 errno_t 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 int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)864 errno_t 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 int rc = vfs_lookup_internal(parent->node, path,876 errno_t rc = vfs_lookup_internal(parent->node, path, 877 877 walk_lookup_flags(flags), &lr); 878 878 if (rc != EOK) { … … 911 911 } 912 912 913 int vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)913 errno_t 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); -
uspace/srv/vfs/vfs_pager.c
r36f0738 rb7fd2a0 48 48 int fd = IPC_GET_ARG3(*request); 49 49 void *page; 50 int rc;50 errno_t rc; 51 51 52 52 page = as_area_create(AS_AREA_ANY, page_size, -
uspace/srv/vfs/vfs_register.c
r36f0738 rb7fd2a0 118 118 119 119 vfs_info_t *vfs_info; 120 int rc = async_data_write_accept((void **) &vfs_info, false,120 errno_t rc = async_data_write_accept((void **) &vfs_info, false, 121 121 sizeof(vfs_info_t), sizeof(vfs_info_t), 0, NULL); 122 122 … … 348 348 * @return EOK on success or an error code 349 349 */ 350 int vfs_get_fstypes(vfs_fstypes_t *fstypes)350 errno_t vfs_get_fstypes(vfs_fstypes_t *fstypes) 351 351 { 352 352 size_t size;
Note:
See TracChangeset
for help on using the changeset viewer.