Changes in uspace/srv/fs/tmpfs/tmpfs_ops.c [b7fd2a0:4f30222] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
rb7fd2a0 r4f30222 64 64 65 65 /* Forward declarations of static functions. */ 66 static errno_t tmpfs_match(fs_node_t **, fs_node_t *, const char *);67 static errno_t tmpfs_node_get(fs_node_t **, service_id_t, fs_index_t);68 static errno_t tmpfs_node_open(fs_node_t *);69 static errno_t tmpfs_node_put(fs_node_t *);70 static errno_t tmpfs_create_node(fs_node_t **, service_id_t, int);71 static errno_t tmpfs_destroy_node(fs_node_t *);72 static errno_t tmpfs_link_node(fs_node_t *, fs_node_t *, const char *);73 static errno_t tmpfs_unlink_node(fs_node_t *, fs_node_t *, const char *);66 static int tmpfs_match(fs_node_t **, fs_node_t *, const char *); 67 static int tmpfs_node_get(fs_node_t **, service_id_t, fs_index_t); 68 static int tmpfs_node_open(fs_node_t *); 69 static int tmpfs_node_put(fs_node_t *); 70 static int tmpfs_create_node(fs_node_t **, service_id_t, int); 71 static int tmpfs_destroy_node(fs_node_t *); 72 static int tmpfs_link_node(fs_node_t *, fs_node_t *, const char *); 73 static int tmpfs_unlink_node(fs_node_t *, fs_node_t *, const char *); 74 74 75 75 /* Implementation of helper functions. */ 76 static errno_t tmpfs_root_get(fs_node_t **rfn, service_id_t service_id)76 static int tmpfs_root_get(fs_node_t **rfn, service_id_t service_id) 77 77 { 78 78 return tmpfs_node_get(rfn, service_id, TMPFS_SOME_ROOT); 79 79 } 80 80 81 static errno_t tmpfs_has_children(bool *has_children, fs_node_t *fn)81 static int tmpfs_has_children(bool *has_children, fs_node_t *fn) 82 82 { 83 83 *has_children = !list_empty(&TMPFS_NODE(fn)->cs_list); … … 227 227 { 228 228 fs_node_t *rfn; 229 errno_t rc;229 int rc; 230 230 231 231 rc = tmpfs_create_node(&rfn, service_id, L_DIRECTORY); … … 252 252 } 253 253 254 errno_t tmpfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)254 int tmpfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component) 255 255 { 256 256 tmpfs_node_t *parentp = TMPFS_NODE(pfn); … … 267 267 } 268 268 269 errno_t tmpfs_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index)269 int tmpfs_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index) 270 270 { 271 271 node_key_t key = { … … 286 286 } 287 287 288 errno_t tmpfs_node_open(fs_node_t *fn)288 int tmpfs_node_open(fs_node_t *fn) 289 289 { 290 290 /* nothing to do */ … … 292 292 } 293 293 294 errno_t tmpfs_node_put(fs_node_t *fn)294 int tmpfs_node_put(fs_node_t *fn) 295 295 { 296 296 /* nothing to do */ … … 298 298 } 299 299 300 errno_t tmpfs_create_node(fs_node_t **rfn, service_id_t service_id, int lflag)300 int tmpfs_create_node(fs_node_t **rfn, service_id_t service_id, int lflag) 301 301 { 302 302 fs_node_t *rootfn; 303 errno_t rc;303 int rc; 304 304 305 305 assert((lflag & L_FILE) ^ (lflag & L_DIRECTORY)); … … 335 335 } 336 336 337 errno_t tmpfs_destroy_node(fs_node_t *fn)337 int tmpfs_destroy_node(fs_node_t *fn) 338 338 { 339 339 tmpfs_node_t *nodep = TMPFS_NODE(fn); … … 351 351 } 352 352 353 errno_t tmpfs_link_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm)353 int tmpfs_link_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm) 354 354 { 355 355 tmpfs_node_t *parentp = TMPFS_NODE(pfn); … … 386 386 } 387 387 388 errno_t tmpfs_unlink_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm)388 int tmpfs_unlink_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm) 389 389 { 390 390 tmpfs_node_t *parentp = TMPFS_NODE(pfn); … … 421 421 */ 422 422 423 static errno_t tmpfs_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info)423 static int tmpfs_fsprobe(service_id_t service_id, vfs_fs_probe_info_t *info) 424 424 { 425 425 return ENOTSUP; 426 426 } 427 427 428 static errno_t428 static int 429 429 tmpfs_mounted(service_id_t service_id, const char *opts, fs_index_t *index, 430 430 aoff64_t *size) 431 431 { 432 432 fs_node_t *rootfn; 433 errno_t rc;433 int rc; 434 434 435 435 /* Check if this device is not already mounted. */ … … 458 458 } 459 459 460 static errno_t tmpfs_unmounted(service_id_t service_id)460 static int tmpfs_unmounted(service_id_t service_id) 461 461 { 462 462 tmpfs_instance_done(service_id); … … 464 464 } 465 465 466 static errno_t tmpfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos,466 static int tmpfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 467 467 size_t *rbytes) 468 468 { … … 525 525 } 526 526 527 static errno_t527 static int 528 528 tmpfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 529 529 size_t *wbytes, aoff64_t *nsize) … … 589 589 } 590 590 591 static errno_t tmpfs_truncate(service_id_t service_id, fs_index_t index,591 static int tmpfs_truncate(service_id_t service_id, fs_index_t index, 592 592 aoff64_t size) 593 593 { … … 626 626 } 627 627 628 static errno_t tmpfs_close(service_id_t service_id, fs_index_t index)629 { 630 return EOK; 631 } 632 633 static errno_t tmpfs_destroy(service_id_t service_id, fs_index_t index)628 static int tmpfs_close(service_id_t service_id, fs_index_t index) 629 { 630 return EOK; 631 } 632 633 static int tmpfs_destroy(service_id_t service_id, fs_index_t index) 634 634 { 635 635 node_key_t key = { … … 646 646 } 647 647 648 static errno_t tmpfs_sync(service_id_t service_id, fs_index_t index)648 static int tmpfs_sync(service_id_t service_id, fs_index_t index) 649 649 { 650 650 /*
Note:
See TracChangeset
for help on using the changeset viewer.