Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/cdfs/cdfs_ops.c

    r5e801dc r48cc66f  
    11/*
     2 * Copyright (c) 2026 Jiri Svoboda
    23 * Copyright (c) 2011 Martin Decky
    34 * All rights reserved.
     
    297298}
    298299
    299 static bool nodes_key_equal(const void *k, const ht_link_t *item)
     300static bool nodes_key_equal(const void *k, size_t hash, const ht_link_t *item)
    300301{
    301302        cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
     
    323324
    324325/** Nodes hash table operations */
    325 static hash_table_ops_t nodes_ops = {
     326static const hash_table_ops_t nodes_ops = {
    326327        .hash = nodes_hash,
    327328        .key_hash = nodes_key_hash,
     
    340341
    341342        ht_link_t *link = hash_table_find(&nodes, &key);
    342         if (link) {
    343                 cdfs_node_t *node =
    344                     hash_table_get_inst(link, cdfs_node_t, nh_link);
    345 
    346                 *rfn = FS_NODE(node);
    347         } else
     343        if (!link) {
    348344                *rfn = NULL;
    349 
     345                return EBADF;
     346        }
     347
     348        cdfs_node_t *node = hash_table_get_inst(link, cdfs_node_t, nh_link);
     349        *rfn = FS_NODE(node);
    350350        return EOK;
    351351}
     
    394394        errno_t rc = cdfs_root_get(&rootfn, fs->service_id);
    395395
    396         assert(rc == EOK);
     396        assert(rc == EOK || rc == EBADF);
    397397
    398398        if (!rootfn)
     
    10931093
    10941094        /* Initialize the block layer */
    1095         errno_t rc = block_init(service_id, BLOCK_SIZE);
     1095        errno_t rc = block_init(service_id);
    10961096        if (rc != EOK)
    10971097                return rc;
     
    11501150{
    11511151        /* Initialize the block layer */
    1152         errno_t rc = block_init(service_id, BLOCK_SIZE);
     1152        errno_t rc = block_init(service_id);
    11531153        if (rc != EOK)
    11541154                return rc;
     
    13531353                cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
    13541354
    1355                 if (!node->opened) {
     1355                /* Remove closed, but root node is always in memory. */
     1356                if (!node->opened && node->index != 0) {
    13561357                        hash_table_remove_item(&nodes, item);
    13571358
Note: See TracChangeset for help on using the changeset viewer.